Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,28 @@
// PRIVATE FUNCTIONS //////////////////////////////////////////////////////////
//-----------------------------------------------------------------------------

static Real getDisplayWidthScaler()
{
return static_cast<Real>(TheDisplay->getWidth()) / DEFAULT_DISPLAY_WIDTH;
}

static Real getDisplayHeightScaler()
{
return static_cast<Real>(TheDisplay->getHeight()) / DEFAULT_DISPLAY_HEIGHT;
}

//-----------------------------------------------------------------------------
// ProcessAnimateWindowSlideFromRight PUBLIC FUNCTIONS ////////////////////////
//-----------------------------------------------------------------------------

ProcessAnimateWindowSlideFromRight::ProcessAnimateWindowSlideFromRight( void )
{
m_maxVel.x = -40.0f; // top speed windows travel in x and y
m_maxVel.x = 0.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_slowDownThreshold = 0; // 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 +149,12 @@ void ProcessAnimateWindowSlideFromRight::initAnimateWindow( wnd::AnimateWindow *
//set the window's position to the new start positions.
win->winSetPosition(startPos.x, startPos.y);

// TheSuperHackers @bugfix tophroxx 31/01/2026 Use scaled pixel constants
// for slowdown threshold and velocity.
const Real widthScaler = getDisplayWidthScaler();
m_maxVel.x = -40 * widthScaler;
m_slowDownThreshold = 80 * widthScaler;

//Now initialize the velocities
vel.x = m_maxVel.x;
vel.y = 0.0f;
Expand Down Expand Up @@ -261,13 +275,12 @@ Bool ProcessAnimateWindowSlideFromRight::reverseAnimateWindow( wnd::AnimateWindo

ProcessAnimateWindowSlideFromLeft::ProcessAnimateWindowSlideFromLeft( void )
{
m_maxVel.x = 40.0f; // top speed windows travel in x and y
m_maxVel.x = 0.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_slowDownThreshold = 0; // 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 +335,12 @@ void ProcessAnimateWindowSlideFromLeft::initAnimateWindow( wnd::AnimateWindow *a
//set the window's position to the new start positions.
win->winSetPosition(startPos.x, startPos.y);

// TheSuperHackers @bugfix tophroxx 31/01/2026 Use scaled pixel constants
// for slowdown threshold and velocity.
const Real widthScaler = getDisplayWidthScaler();
m_maxVel.x = 40 * widthScaler;
m_slowDownThreshold = 80 * widthScaler;

//Now initialize the velocities
vel = m_maxVel;

Expand Down Expand Up @@ -439,13 +458,12 @@ 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_maxVel.x = 0.0f; // top speed windows travel in x and y
m_maxVel.y = 0.0f;
m_slowDownThreshold = 0; // 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 +518,12 @@ void ProcessAnimateWindowSlideFromTop::initAnimateWindow( wnd::AnimateWindow *an
//set the window's position to the new start positions.
win->winSetPosition(startPos.x, startPos.y);

// TheSuperHackers @bugfix tophroxx 31/01/2026 Use scaled pixel constants
// for slowdown threshold and velocity.
const Real heightScaler = getDisplayHeightScaler();
m_maxVel.y = 40 * heightScaler;
m_slowDownThreshold = 80 * heightScaler;

//Now initialize the velocities
vel = m_maxVel;

Expand Down Expand Up @@ -618,13 +642,12 @@ 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_maxVel.x = 0.0f; // top speed windows travel in x and y
m_maxVel.y = 0.0f;
m_slowDownThreshold = 0; // 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 +703,12 @@ void ProcessAnimateWindowSlideFromBottom::initAnimateWindow( wnd::AnimateWindow
//set the window's position to the new start positions.
win->winSetPosition(startPos.x, startPos.y);

// TheSuperHackers @bugfix tophroxx 31/01/2026 Use scaled pixel constants
// for slowdown threshold and velocity.
const Real heightScaler = getDisplayHeightScaler();
m_maxVel.y = -40 * heightScaler;
m_slowDownThreshold = 80 * heightScaler;

//Now initialize the velocities
vel = m_maxVel;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,28 @@
// PRIVATE FUNCTIONS //////////////////////////////////////////////////////////
//-----------------------------------------------------------------------------

static Real getDisplayWidthScaler()
{
return static_cast<Real>(TheDisplay->getWidth()) / DEFAULT_DISPLAY_WIDTH;
}

static Real getDisplayHeightScaler()
{
return static_cast<Real>(TheDisplay->getHeight()) / DEFAULT_DISPLAY_HEIGHT;
}

//-----------------------------------------------------------------------------
// ProcessAnimateWindowSlideFromRight PUBLIC FUNCTIONS ////////////////////////
//-----------------------------------------------------------------------------

ProcessAnimateWindowSlideFromRight::ProcessAnimateWindowSlideFromRight( void )
{
m_maxVel.x = -40.0f; // top speed windows travel in x and y
m_maxVel.x = 0.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_slowDownThreshold = 0; // 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 +149,12 @@ void ProcessAnimateWindowSlideFromRight::initAnimateWindow( wnd::AnimateWindow *
//set the window's position to the new start positions.
win->winSetPosition(startPos.x, startPos.y);

// TheSuperHackers @bugfix tophroxx 31/01/2026 Use scaled pixel constants
// for slowdown threshold and velocity.
const Real widthScaler = getDisplayWidthScaler();
m_maxVel.x = -40 * widthScaler;
m_slowDownThreshold = 80 * widthScaler;

//Now initialize the velocities
vel.x = m_maxVel.x;
vel.y = 0.0f;
Expand Down Expand Up @@ -261,13 +275,12 @@ Bool ProcessAnimateWindowSlideFromRight::reverseAnimateWindow( wnd::AnimateWindo

ProcessAnimateWindowSlideFromLeft::ProcessAnimateWindowSlideFromLeft( void )
{
m_maxVel.x = 40.0f; // top speed windows travel in x and y
m_maxVel.x = 0.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_slowDownThreshold = 0; // 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 +335,12 @@ void ProcessAnimateWindowSlideFromLeft::initAnimateWindow( wnd::AnimateWindow *a
//set the window's position to the new start positions.
win->winSetPosition(startPos.x, startPos.y);

// TheSuperHackers @bugfix tophroxx 31/01/2026 Use scaled pixel constants
// for slowdown threshold and velocity.
const Real widthScaler = getDisplayWidthScaler();
m_maxVel.x = 40 * widthScaler;
m_slowDownThreshold = 80 * widthScaler;

//Now initialize the velocities
vel = m_maxVel;

Expand Down Expand Up @@ -439,13 +458,12 @@ 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_maxVel.x = 0.0f; // top speed windows travel in x and y
m_maxVel.y = 0.0f;
m_slowDownThreshold = 0; // 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 +518,12 @@ void ProcessAnimateWindowSlideFromTop::initAnimateWindow( wnd::AnimateWindow *an
//set the window's position to the new start positions.
win->winSetPosition(startPos.x, startPos.y);

// TheSuperHackers @bugfix tophroxx 31/01/2026 Use scaled pixel constants
// for slowdown threshold and velocity.
const Real heightScaler = getDisplayHeightScaler();
m_maxVel.y = 40 * heightScaler;
m_slowDownThreshold = 80 * heightScaler;

//Now initialize the velocities
vel = m_maxVel;

Expand Down Expand Up @@ -618,13 +642,12 @@ 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_maxVel.x = 0.0f; // top speed windows travel in x and y
m_maxVel.y = 0.0f;
m_slowDownThreshold = 0; // 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 +703,12 @@ void ProcessAnimateWindowSlideFromBottom::initAnimateWindow( wnd::AnimateWindow
//set the window's position to the new start positions.
win->winSetPosition(startPos.x, startPos.y);

// TheSuperHackers @bugfix tophroxx 31/01/2026 Use scaled pixel constants
// for slowdown threshold and velocity.
const Real heightScaler = getDisplayHeightScaler();
m_maxVel.y = -40 * heightScaler;
m_slowDownThreshold = 80 * heightScaler;

//Now initialize the velocities
vel = m_maxVel;

Expand Down