Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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_updateAccumulator; ///< Carries fractional base-rate steps 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_updateAccumulator = 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_updateAccumulator = 0.0f;
}

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

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

// Clamp the delta so a long stall (load, alt-tab) cannot snap an animation to its end.
const Real maxCatchUpSeconds = 0.2f;
if (deltaSeconds > maxCatchUpSeconds)
{
deltaSeconds = maxCatchUpSeconds;
}

m_updateAccumulator += deltaSeconds * (Real)BaseFps;
Int steps = (Int)m_updateAccumulator;
m_updateAccumulator -= (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 @@ -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_updateAccumulator; ///< Carries fractional base-rate steps 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_updateAccumulator = 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_updateAccumulator = 0.0f;
}

void AnimateWindowManager::reset()
Expand All @@ -168,9 +171,32 @@ void AnimateWindowManager::reset()
clearWinList(m_winMustFinishList);
m_needsUpdate = FALSE;
m_reverse = FALSE;
m_updateAccumulator = 0.0f;
Comment thread
bobtista marked this conversation as resolved.
Outdated
}

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

// Clamp the delta so a long stall (load, alt-tab) cannot snap an animation to its end.
const Real maxCatchUpSeconds = 0.2f;
Comment thread
bobtista marked this conversation as resolved.
Outdated
if (deltaSeconds > maxCatchUpSeconds)
{
deltaSeconds = maxCatchUpSeconds;
}

m_updateAccumulator += deltaSeconds * (Real)BaseFps;
Comment thread
bobtista marked this conversation as resolved.
Outdated
Int steps = (Int)m_updateAccumulator;
m_updateAccumulator -= (Real)steps;

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

void AnimateWindowManager::step()
{

ProcessAnimateWindow *processAnim = nullptr;
Expand Down
Loading