diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/Display.h b/GeneralsMD/Code/GameEngine/Include/GameClient/Display.h index c6c69b6229..2ab4493906 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameClient/Display.h +++ b/GeneralsMD/Code/GameEngine/Include/GameClient/Display.h @@ -90,6 +90,9 @@ class Display : public SubsystemInterface virtual void dumpAssetUsage(const char* mapname) = 0; #endif + virtual UnsignedInt scaleHorizontalConstant(UnsignedInt x) { return (static_cast(x) / DEFAULT_DISPLAY_WIDTH) * getWidth(); } + virtual UnsignedInt scaleVerticalConstant(UnsignedInt y) { return (static_cast(y) / DEFAULT_DISPLAY_HEIGHT) * getHeight(); } + //--------------------------------------------------------------------------------------- // View management virtual void attachView( View *view ); ///< Attach the given view to the world diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ProcessAnimateWindow.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ProcessAnimateWindow.cpp index 3c060e685c..c926ef5c34 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ProcessAnimateWindow.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ProcessAnimateWindow.cpp @@ -75,13 +75,9 @@ ProcessAnimateWindowSlideFromRight::ProcessAnimateWindowSlideFromRight( void ) { - m_maxVel.x = -40.0f; // top speed windows travel in x and y m_maxVel.y = 0.0f; - m_slowDownThreshold = 80; // when windows get this close to their resting - // positions they start to slow down m_slowDownRatio = 0.67f; // how fast the windows slow down (smaller slows quicker) m_speedUpRatio = 2.0f - m_slowDownRatio; // how fast the windows speed up - } //----------------------------------------------------------------------------- @@ -141,6 +137,11 @@ void ProcessAnimateWindowSlideFromRight::initAnimateWindow( wnd::AnimateWindow * //set the window's position to the new start positions. win->winSetPosition(startPos.x, startPos.y); + // TheSuperHackers @bugfix toph 29/01/2026 Use scaled pixel constants + // for slowdown threshold and velocity. + m_maxVel.x = -static_cast(TheDisplay->scaleHorizontalConstant(40)); + m_slowDownThreshold = TheDisplay->scaleHorizontalConstant(80); + //Now initialize the velocities vel.x = m_maxVel.x; vel.y = 0.0f; @@ -261,13 +262,9 @@ Bool ProcessAnimateWindowSlideFromRight::reverseAnimateWindow( wnd::AnimateWindo ProcessAnimateWindowSlideFromLeft::ProcessAnimateWindowSlideFromLeft( void ) { - m_maxVel.x = 40.0f; // top speed windows travel in x and y m_maxVel.y = 0.0f; - m_slowDownThreshold = 80; // when windows get this close to their resting - // positions they start to slow down m_slowDownRatio = 0.67f; // how fast the windows slow down (smaller slows quicker) m_speedUpRatio = 2.0f - m_slowDownRatio; // how fast the windows speed up - } ProcessAnimateWindowSlideFromLeft::~ProcessAnimateWindowSlideFromLeft( void ) { } @@ -322,6 +319,11 @@ void ProcessAnimateWindowSlideFromLeft::initAnimateWindow( wnd::AnimateWindow *a //set the window's position to the new start positions. win->winSetPosition(startPos.x, startPos.y); + // TheSuperHackers @bugfix toph 29/01/2026 Use scaled pixel constants + // for slowdown threshold and velocity. + m_maxVel.x = static_cast(TheDisplay->scaleHorizontalConstant(40)); + m_slowDownThreshold = TheDisplay->scaleHorizontalConstant(80); + //Now initialize the velocities vel = m_maxVel; @@ -439,13 +441,9 @@ Bool ProcessAnimateWindowSlideFromLeft::reverseAnimateWindow( wnd::AnimateWindow ProcessAnimateWindowSlideFromTop::ProcessAnimateWindowSlideFromTop( void ) { - m_maxVel.y = 40.0f; // top speed windows travel in x and y m_maxVel.x = 0.0f; - m_slowDownThreshold = 80; // when windows get this close to their resting - // positions they start to slow down m_slowDownRatio = 0.67f; // how fast the windows slow down (smaller slows quicker) m_speedUpRatio = 2.0f - m_slowDownRatio; // how fast the windows speed up - } ProcessAnimateWindowSlideFromTop::~ProcessAnimateWindowSlideFromTop( void ) { } @@ -500,6 +498,11 @@ void ProcessAnimateWindowSlideFromTop::initAnimateWindow( wnd::AnimateWindow *an //set the window's position to the new start positions. win->winSetPosition(startPos.x, startPos.y); + // TheSuperHackers @bugfix toph 29/01/2026 Use scaled pixel constants + // for slowdown threshold and velocity. + m_maxVel.y = static_cast(TheDisplay->scaleVerticalConstant(40)); + m_slowDownThreshold = TheDisplay->scaleVerticalConstant(80); + //Now initialize the velocities vel = m_maxVel; @@ -618,13 +621,9 @@ Bool ProcessAnimateWindowSlideFromTop::reverseAnimateWindow( wnd::AnimateWindow ProcessAnimateWindowSlideFromBottom::ProcessAnimateWindowSlideFromBottom( void ) { - m_maxVel.y = -40.0f; // top speed windows travel in x and y m_maxVel.x = 0.0f; - m_slowDownThreshold = 80; // when windows get this close to their resting - // positions they start to slow down m_slowDownRatio = 0.67f; // how fast the windows slow down (smaller slows quicker) m_speedUpRatio = 2.0f - m_slowDownRatio; // how fast the windows speed up - } ProcessAnimateWindowSlideFromBottom::~ProcessAnimateWindowSlideFromBottom( void ) { } @@ -680,6 +679,11 @@ void ProcessAnimateWindowSlideFromBottom::initAnimateWindow( wnd::AnimateWindow //set the window's position to the new start positions. win->winSetPosition(startPos.x, startPos.y); + // TheSuperHackers @bugfix toph 29/01/2026 Use scaled pixel constants + // for slowdown threshold and velocity. + m_maxVel.y = -static_cast(TheDisplay->scaleVerticalConstant(40)); + m_slowDownThreshold = TheDisplay->scaleVerticalConstant(80); + //Now initialize the velocities vel = m_maxVel;