forked from electronicarts/CnC_Generals_Zero_Hour
-
Notifications
You must be signed in to change notification settings - Fork 234
tweak(gui): Decouple GUI window-move animations from the render frame rate #2833
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
xezon
merged 6 commits into
TheSuperHackers:main
from
bobtista:bobtista/tweak/decouple-window-move-animation
Aug 4, 2026
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a40483a
tweak: decouple GUI window-move animations from the render frame rate
bobtista e829b80
tweak: decouple GUI window-move animations from the render frame rate…
bobtista c240eba
tweak: use frame pacer ratio for animation pacing and pump the manage…
bobtista 9e1972c
tweak: use frame pacer ratio for animation pacing and pump the manage…
bobtista a1f7b2e
tweak: Remove superfluous comment on the animate window manager update
bobtista 4c00e5c
tweak: Remove superfluous comment on the animate window manager updat…
bobtista File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,6 +57,7 @@ | |
| #include "GameClient/GameWindow.h" | ||
| #include "GameClient/Display.h" | ||
| #include "GameClient/ProcessAnimateWindow.h" | ||
| #include "Common/FramePacer.h" | ||
| //----------------------------------------------------------------------------- | ||
| // DEFINES //////////////////////////////////////////////////////////////////// | ||
| //----------------------------------------------------------------------------- | ||
|
|
@@ -133,6 +134,7 @@ AnimateWindowManager::AnimateWindowManager() | |
| m_winList.clear(); | ||
| m_needsUpdate = FALSE; | ||
| m_reverse = FALSE; | ||
| m_frameAccumulator = 0.0f; | ||
| m_winMustFinishList.clear(); | ||
| } | ||
| AnimateWindowManager::~AnimateWindowManager() | ||
|
|
@@ -159,6 +161,7 @@ void AnimateWindowManager::init() | |
| clearWinList(m_winMustFinishList); | ||
| m_needsUpdate = FALSE; | ||
| m_reverse = FALSE; | ||
| m_frameAccumulator = 0.0f; | ||
| } | ||
|
|
||
| void AnimateWindowManager::reset() | ||
|
|
@@ -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(); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
| Int steps = (Int)m_frameAccumulator; | ||
| m_frameAccumulator -= (Real)steps; | ||
|
|
||
| while (steps-- > 0) | ||
| { | ||
| step(); | ||
| } | ||
| } | ||
|
|
||
| void AnimateWindowManager::step() | ||
| { | ||
|
|
||
| ProcessAnimateWindow *processAnim = nullptr; | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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::updateso 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.
There was a problem hiding this comment.
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