Skip to content

Commit a4f3370

Browse files
committed
tweak: decouple the general promotion star blink from the render frame rate
1 parent c5e3a9e commit a4f3370

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

Core/GameEngine/Include/GameClient/ControlBar.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,6 +1029,7 @@ class ControlBar : public SubsystemInterface
10291029

10301030

10311031
Bool m_genStarFlash;
1032+
Real m_genStarFlashAccumSec;
10321033
Int m_lastFlashedAtPointValue;
10331034

10341035
ICoord2D m_controlBarForegroundMarkerPos;

Core/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#define DEFINE_RADIUSCURSOR_NAMES
3737

3838
#include "Common/ActionManager.h"
39+
#include "Common/FramePacer.h"
3940
#include "Common/GameType.h"
4041
#include "Common/MultiplayerSettings.h"
4142
#include "Common/NameKeyGenerator.h"
@@ -904,6 +905,7 @@ ControlBar::ControlBar()
904905
m_currContext = CB_CONTEXT_NONE;
905906
m_defaultControlBarPosition.x = m_defaultControlBarPosition.y = 0;
906907
m_genStarFlash = FALSE;
908+
m_genStarFlashAccumSec = 0.0f;
907909
m_genStarOff = nullptr;
908910
m_genStarOn = nullptr;
909911
m_UIDirty = FALSE;
@@ -1681,7 +1683,14 @@ const Image *ControlBar::getStarImage()
16811683
return nullptr;
16821684
}
16831685

1684-
if(TheGameLogic->getFrame()% LOGICFRAMES_PER_SECOND > LOGICFRAMES_PER_SECOND/2)
1686+
// TheSuperHackers @tweak bobtista 27/06/2026 Blink on a wall-clock cycle so the rate is independent of render frame rate and logic time scale.
1687+
m_genStarFlashAccumSec += TheFramePacer->getUpdateTime();
1688+
const Real blinkPeriodSec = 1.0f;
1689+
while( m_genStarFlashAccumSec >= blinkPeriodSec )
1690+
{
1691+
m_genStarFlashAccumSec -= blinkPeriodSec;
1692+
}
1693+
if( m_genStarFlashAccumSec >= blinkPeriodSec / 2 )
16851694
{
16861695
GadgetButtonSetEnabledImage(win, m_generalButtonHighlight);
16871696
return nullptr;

0 commit comments

Comments
 (0)