tweak(gui): Animate GUI window moves fluently on high render frame rates - #3061
Open
bobtista wants to merge 1 commit into
Open
tweak(gui): Animate GUI window moves fluently on high render frame rates#3061bobtista wants to merge 1 commit into
bobtista wants to merge 1 commit into
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
#2833 decoupled GUI window-move animations from the render frame rate, but
AnimateWindowManagerstill accumulates fractional base-rate time and advances theanimations only in whole steps. Window positions therefore change about 30 times per
second even when the game renders faster.
Now the manager passes fractional base-frame deltas to the movement processors, animated
positions keep subpixel precision, and coordinates are rounded only when applied to a
GameWindow. The subpixel precision is required because velocity clamps to1 pixel per base frame near the rest position, which is 0.25 pixel per render frame at
120 fps and truncates to no movement at all with the previous integer position. Velocity
ratios are adjusted for the fractional delta with
powf, which keeps the durationapproximately constant across frame rates rather than exactly equal, since the position
is still integrated once per render frame.
Every completion path now applies its terminal position.
SlideFromRight,SlideFromLeftand
SlideFromRightFastmarked the animation finished without ever writing the endposition, leaving the window short of its rest position by up to one update of travel.
On the in-game control bar, movement increased from 24 position updates in 744 ms at
30 fps to 85 updates in 736 ms at 120 fps.
ProcessAnimateWindow.cppis shared Core code compiled into both games, so the Generalsmanager and header change with it.
This only affects client-side GUI state and does not touch game logic, replays, or CRC
calculations.
Todo: