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 @@ -90,6 +90,11 @@ class Display : public SubsystemInterface
9090 virtual void dumpAssetUsage (const char * mapname) = 0;
9191#endif
9292
93+ // ---------------------------------------------------------------------------------------
94+ // Display scaling methods
95+ Real getWidthScale ();
96+ Real getHeightScale ();
97+
9398 // ---------------------------------------------------------------------------------------
9499 // View management
95100 virtual void attachView ( View *view ); // /< Attach the given view to the world
Original file line number Diff line number Diff line change @@ -199,6 +199,18 @@ void Display::setHeight( UnsignedInt height )
199199
200200}
201201
202+ // Return the ratio of the current display width relative to the default resolution
203+ Real Display::getWidthScale (void )
204+ {
205+ return (Real)m_width / DEFAULT_DISPLAY_WIDTH;
206+ }
207+
208+ // Return the ratio of the current display height relative to the default resolution
209+ Real Display::getHeightScale (void )
210+ {
211+ return (Real)m_height / DEFAULT_DISPLAY_HEIGHT;
212+ }
213+
202214// ============================================================================
203215// Display::playLogoMovie
204216// minMovieLength is in milliseconds
You can’t perform that action at this time.
0 commit comments