Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,13 @@ class AnimateWindowManager : public SubsystemInterface
Bool isReversed(); ///< Returns whether or not we're in our reversed state.
Bool isEmpty();
private:
void step(); ///< Runs a single base-rate step of all registered window animations

AnimateWindowList m_winList; ///< A list of AnimationWindows that we don't care if their finished animating
AnimateWindowList m_winMustFinishList; ///< A list of AnimationWindows that we do care about
Bool m_needsUpdate; ///< If we're done animating all our monitored windows, then this will be false
Bool m_reverse; ///< Are we in a reverse state?
Real m_frameAccumulator; ///< Carries fractional base-rate frames between updates
ProcessAnimateWindowSlideFromRight *m_slideFromRight; ///< Holds the process in which the windows slide from the right
ProcessAnimateWindowSlideFromRightFast *m_slideFromRightFast;
ProcessAnimateWindowSlideFromTop *m_slideFromTop; ///< Holds the process in which the windows slide from the Top
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
#include "GameClient/GameWindow.h"
#include "GameClient/Display.h"
#include "GameClient/ProcessAnimateWindow.h"
#include "Common/FramePacer.h"
//-----------------------------------------------------------------------------
// DEFINES ////////////////////////////////////////////////////////////////////
//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -133,6 +134,7 @@ AnimateWindowManager::AnimateWindowManager()
m_winList.clear();
m_needsUpdate = FALSE;
m_reverse = FALSE;
m_frameAccumulator = 0.0f;
m_winMustFinishList.clear();
}
AnimateWindowManager::~AnimateWindowManager()
Expand All @@ -159,6 +161,7 @@ void AnimateWindowManager::init()
clearWinList(m_winMustFinishList);
m_needsUpdate = FALSE;
m_reverse = FALSE;
m_frameAccumulator = 0.0f;
}

void AnimateWindowManager::reset()
Expand All @@ -168,9 +171,23 @@ void AnimateWindowManager::reset()
clearWinList(m_winMustFinishList);
m_needsUpdate = FALSE;
m_reverse = FALSE;
m_frameAccumulator = 0.0f;
}

// TheSuperHackers @tweak bobtista 27/06/2026 Decouple GUI window-move animations from the render frame rate
void AnimateWindowManager::update()
{
m_frameAccumulator += TheFramePacer->getBaseOverUpdateFpsRatio();
Int steps = (Int)m_frameAccumulator;
m_frameAccumulator -= (Real)steps;

while (steps-- > 0)
{
step();
}
}

void AnimateWindowManager::step()
{

ProcessAnimateWindow *processAnim = nullptr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,16 +205,15 @@ void Shell::update()

}

// Update the animate window manager
m_animateWindowManager->update();

m_schemeManager->update();

// mark last time we ran the updates
lastUpdate = now;

}

m_animateWindowManager->update();

}

//-------------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,13 @@ class AnimateWindowManager : public SubsystemInterface
Bool isReversed(); ///< Returns whether or not we're in our reversed state.
Bool isEmpty();
private:
void step(); ///< Runs a single base-rate step of all registered window animations

AnimateWindowList m_winList; ///< A list of AnimationWindows that we don't care if their finished animating
AnimateWindowList m_winMustFinishList; ///< A list of AnimationWindows that we do care about
Bool m_needsUpdate; ///< If we're done animating all our monitored windows, then this will be false
Bool m_reverse; ///< Are we in a reverse state?
Real m_frameAccumulator; ///< Carries fractional base-rate frames between updates
ProcessAnimateWindowSlideFromRight *m_slideFromRight; ///< Holds the process in which the windows slide from the right
ProcessAnimateWindowSlideFromRightFast *m_slideFromRightFast;
ProcessAnimateWindowSlideFromTop *m_slideFromTop; ///< Holds the process in which the windows slide from the Top
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
#include "GameClient/GameWindow.h"
#include "GameClient/Display.h"
#include "GameClient/ProcessAnimateWindow.h"
#include "Common/FramePacer.h"
//-----------------------------------------------------------------------------
// DEFINES ////////////////////////////////////////////////////////////////////
//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -133,6 +134,7 @@ AnimateWindowManager::AnimateWindowManager()
m_winList.clear();
m_needsUpdate = FALSE;
m_reverse = FALSE;
m_frameAccumulator = 0.0f;
m_winMustFinishList.clear();
}
AnimateWindowManager::~AnimateWindowManager()
Expand All @@ -159,6 +161,7 @@ void AnimateWindowManager::init()
clearWinList(m_winMustFinishList);
m_needsUpdate = FALSE;
m_reverse = FALSE;
m_frameAccumulator = 0.0f;
}

void AnimateWindowManager::reset()
Expand All @@ -168,9 +171,23 @@ void AnimateWindowManager::reset()
clearWinList(m_winMustFinishList);
m_needsUpdate = FALSE;
m_reverse = FALSE;
m_frameAccumulator = 0.0f;
}

// TheSuperHackers @tweak bobtista 27/06/2026 Decouple GUI window-move animations from the render frame rate
void AnimateWindowManager::update()
{
m_frameAccumulator += TheFramePacer->getBaseOverUpdateFpsRatio();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You did the same thing in TransitionGroup::update so this is consistent.

But I do wonder, can this perhaps animate fluently on high frame rates? Maybe in a follow up change? Right now it decouples from render update, but it still uses a low update step of 30 positions a second.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes in a follow up change

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could also make a follow up for multiplying this by a new TheGlobalData->m_gameWindowMovementSpeedMultiplier

Int steps = (Int)m_frameAccumulator;
m_frameAccumulator -= (Real)steps;

while (steps-- > 0)
{
step();
}
}

void AnimateWindowManager::step()
{

ProcessAnimateWindow *processAnim = nullptr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,16 +205,15 @@ void Shell::update()

}

// Update the animate window manager
m_animateWindowManager->update();

m_schemeManager->update();

// mark last time we ran the updates
lastUpdate = now;

}

m_animateWindowManager->update();

}

//-------------------------------------------------------------------------------------------------
Expand Down
Loading