File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
GeneralsMD/Code/GameEngine Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,11 @@ class Display : public SubsystemInterface
9292 virtual void dumpAssetUsage (const char * mapname) = 0;
9393#endif
9494
95+ // ---------------------------------------------------------------------------------------
96+ // Display scaling methods
97+ Real getWidthScale ();
98+ Real getHeightScale ();
99+
95100 // ---------------------------------------------------------------------------------------
96101 // View management
97102 virtual void attachView ( View *view ); // /< Attach the given view to the world
Original file line number Diff line number Diff line change @@ -202,6 +202,18 @@ void Display::setHeight( UnsignedInt height )
202202
203203}
204204
205+ // Return the ratio of the current display width relative to the default resolution
206+ Real Display::getWidthScale (void )
207+ {
208+ return (Real)m_width / DEFAULT_DISPLAY_WIDTH;
209+ }
210+
211+ // Return the ratio of the current display height relative to the default resolution
212+ Real Display::getHeightScale (void )
213+ {
214+ return (Real)m_height / DEFAULT_DISPLAY_HEIGHT;
215+ }
216+
205217// ============================================================================
206218// Display::playLogoMovie
207219// minMovieLength is in milliseconds
You can’t perform that action at this time.
0 commit comments