Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions GeneralsMD/Code/GameEngine/Include/GameClient/Display.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ class Display : public SubsystemInterface
virtual void dumpAssetUsage(const char* mapname) = 0;
#endif

virtual UnsignedInt scaleHorizontalConstant(UnsignedInt x) { return (static_cast<Real>(x) / DEFAULT_DISPLAY_WIDTH) * getWidth(); }
virtual UnsignedInt scaleVerticalConstant(UnsignedInt y) { return (static_cast<Real>(y) / DEFAULT_DISPLAY_HEIGHT) * getHeight(); }

//---------------------------------------------------------------------------------------
// View management
virtual void attachView( View *view ); ///< Attach the given view to the world
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

}

//-----------------------------------------------------------------------------
Expand Down Expand 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<Real>(TheDisplay->scaleHorizontalConstant(40));
m_slowDownThreshold = TheDisplay->scaleHorizontalConstant(80);

//Now initialize the velocities
vel.x = m_maxVel.x;
vel.y = 0.0f;
Expand Down Expand Up @@ -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 ) { }
Expand Down Expand Up @@ -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<Real>(TheDisplay->scaleHorizontalConstant(40));
m_slowDownThreshold = TheDisplay->scaleHorizontalConstant(80);

//Now initialize the velocities
vel = m_maxVel;

Expand Down Expand Up @@ -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 ) { }
Expand Down Expand Up @@ -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<Real>(TheDisplay->scaleVerticalConstant(40));
m_slowDownThreshold = TheDisplay->scaleVerticalConstant(80);

//Now initialize the velocities
vel = m_maxVel;

Expand Down Expand Up @@ -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 ) { }
Expand Down Expand Up @@ -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<Real>(TheDisplay->scaleVerticalConstant(40));
m_slowDownThreshold = TheDisplay->scaleVerticalConstant(80);

//Now initialize the velocities
vel = m_maxVel;

Expand Down