-
Notifications
You must be signed in to change notification settings - Fork 211
tweak: decouple the general promotion star blink from the render frame rate #2835
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
base: main
Are you sure you want to change the base?
Changes from all commits
0dfa1d1
81e3873
a2e2fce
bb94a7b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1681,7 +1681,11 @@ const Image *ControlBar::getStarImage() | |
| return nullptr; | ||
| } | ||
|
|
||
| if(TheGameLogic->getFrame()% LOGICFRAMES_PER_SECOND > LOGICFRAMES_PER_SECOND/2) | ||
| // TheSuperHackers @tweak bobtista 27/06/2026 Blink the general-promotion star on a | ||
| // wall-clock cycle so the blink rate is independent of the render frame rate and the | ||
| // logic time scale, and freezes while the game is paused. | ||
| const UnsignedInt blinkPeriodMs = 1000; | ||
| if( !TheGameLogic->isGamePaused() && timeGetTime() % blinkPeriodMs >= blinkPeriodMs / 2 ) | ||
|
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.
The PR description says the fix "keeps blinking while paused," but Prompt To Fix With AIThis is a comment left during a code review.
Path: Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp
Line: 1688
Comment:
**Paused-state behavior contradicts the PR's stated goal**
The PR description says the fix "keeps blinking while paused," but `!TheGameLogic->isGamePaused()` short-circuits the whole expression to `false` when the game is paused, meaning the star always shows the non-highlighted (normal) image during pause — blinking is fully suppressed. The code comment even acknowledges this by saying "freezes while the game is paused." This doesn't fix the original problem of the stars stopping their blink during pause; it just replaces a stuck-on-highlight state with a stuck-on-normal state. If the intent truly is to keep the star blinking while paused, the `!TheGameLogic->isGamePaused() &&` guard should be removed so `timeGetTime()` drives the blink unconditionally. The same issue is present in `GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp` line 1688.
How can I resolve this? If you propose a fix, please make it concise.
Author
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. This was fixed 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. Can this be simply implemented without timeGetTime somehow? |
||
| { | ||
| GadgetButtonSetEnabledImage(win, m_generalButtonHighlight); | ||
| return nullptr; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1681,7 +1681,11 @@ const Image *ControlBar::getStarImage() | |
| return nullptr; | ||
| } | ||
|
|
||
| if(TheGameLogic->getFrame()% LOGICFRAMES_PER_SECOND > LOGICFRAMES_PER_SECOND/2) | ||
| // TheSuperHackers @tweak bobtista 27/06/2026 Blink the general-promotion star on a | ||
| // wall-clock cycle so the blink rate is independent of the render frame rate and the | ||
| // logic time scale, and freezes while the game is paused. | ||
| const UnsignedInt blinkPeriodMs = 1000; | ||
|
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. If you make it 1024 then you can use bit masking and shifting :) |
||
| if( !TheGameLogic->isGamePaused() && timeGetTime() % blinkPeriodMs >= blinkPeriodMs / 2 ) | ||
| { | ||
| GadgetButtonSetEnabledImage(win, m_generalButtonHighlight); | ||
| return nullptr; | ||
|
|
||
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.
Comment can be simplified