//
// CCCounterLabel::updateCounter from 0x574aac to 0x574b38 (140 bytes)
//
// 3 xrefs:
// > ??> @ 0x88e60
// > CCCounterLabel::enableCounter @ 0x574890
// > ??> @ 0x122ca40
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void CCCounterLabel::updateCounter(CCCounterLabel *a1, float a2)
{
int m_currentCount; // w1
int m_targetCount; // w3
float v4; // s0
float m_stepSize; // s1
if ( a1->m_counterEnabled )
{
m_currentCount = a1->m_currentCount;
m_targetCount = a1->m_targetCount;
if ( m_currentCount < m_targetCount )
{
v4 = (float)(m_targetCount - m_currentCount);
m_stepSize = (float)a1->m_stepSize;
if ( v4 > m_stepSize )
goto LABEL_5;
goto LABEL_8;
}
if ( m_currentCount > m_targetCount )
{
v4 = (float)(m_targetCount - m_currentCount);
m_stepSize = (float)a1->m_stepSize;
if ( v4 < m_stepSize )
{
LABEL_5:
a1->m_currentCount = (int)(float)((float)m_currentCount + m_stepSize);
LABEL_6:
CCCounterLabel::updateString(a1);
return;
}
LABEL_8:
a1->m_currentCount = (int)(float)((float)m_currentCount + v4);
goto LABEL_6;
}
CCCounterLabel::disableCounter(a1);
}
}