From 168bf74ef6b38d3c61e6631c49ebe8bc6ab9409e Mon Sep 17 00:00:00 2001 From: secprentice Date: Mon, 29 Jun 2026 20:54:50 +0100 Subject: [PATCH] Fix #2834: Frame-rate-independent promotion star blink 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 --- .../GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp | 3 ++- .../GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp index 09735b3187a..144717e9217 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp @@ -1681,7 +1681,8 @@ const Image *ControlBar::getStarImage() return nullptr; } - if(TheGameLogic->getFrame()% LOGICFRAMES_PER_SECOND > LOGICFRAMES_PER_SECOND/2) + // TheSuperHackers @bugfix Use wall-clock time so blink rate is frame-rate independent. + if(timeGetTime() % 1000 > 500) { GadgetButtonSetEnabledImage(win, m_generalButtonHighlight); return nullptr; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp index 2c90a3d80d2..daae3d8f367 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp @@ -1681,7 +1681,8 @@ const Image *ControlBar::getStarImage() return nullptr; } - if(TheGameLogic->getFrame()% LOGICFRAMES_PER_SECOND > LOGICFRAMES_PER_SECOND/2) + // TheSuperHackers @bugfix Use wall-clock time so blink rate is frame-rate independent. + if(timeGetTime() % 1000 > 500) { GadgetButtonSetEnabledImage(win, m_generalButtonHighlight); return nullptr;