Fix #2834: Frame-rate-independent general promotion star blink#2844
Closed
secprentice wants to merge 1 commit into
Closed
Fix #2834: Frame-rate-independent general promotion star blink#2844secprentice wants to merge 1 commit into
secprentice wants to merge 1 commit into
Conversation
Replace getFrame() % LOGICFRAMES_PER_SECOND with timeGetTime() % 1000 so the general promotion button blinks at a steady ~1 Hz regardless of the game's logic frame rate or display FPS. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Duplicate of #2835 |
|
#2835 is the better implementation. Closing this one. Please search for existing PR's before opening a new one to prevent duplicates. |
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.
Summary
Fixes #2834.
The general promotion star button used
TheGameLogic->getFrame() % LOGICFRAMES_PER_SECOND > LOGICFRAMES_PER_SECOND / 2to drive its blink animation. At high FPS (e.g. uncapped or 144 Hz), logic frames advance faster than real time, causing the button to blink far too rapidly and become visually distracting.Change: Replaced the frame-based blink condition with
timeGetTime() % 1000 > 500in bothGeneralsandGeneralsMDControlBar.cpp. This gives a steady, wall-clock 1 Hz blink (500 ms on / 500 ms off) that is completely independent of game speed or frame rate.Files changed
Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cppGeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cppTest plan