//
// CCCounterLabel::setTargetCount from 0x1400431a0 to 0x140043221 (129 bytes)
//
// 2 xrefs:
// > GJShopLayer::updateCurrencyCounter @ 0x1402abc9e
// > GJShopLayer::didPurchaseItem @ 0x1402ac6eb
//
// 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::setTargetCount(CCCounterLabel *a1, int a2)
{
int m_stepCount; // eax
float m_currentCount; // xmm0_4
float v4; // xmm1_4
float v5; // xmm2_4
bool v6; // zf
m_stepCount = a1->m_stepCount;
m_currentCount = (float)a1->m_currentCount;
a1->m_targetCount = a2;
v4 = (float)a2 - m_currentCount;
v5 = fabs(v4);
if ( (float)m_stepCount > v5 )
m_stepCount = (int)v5;
v6 = !a1->m_counterEnabled;
a1->m_stepSize = (int)(float)(v4 / (float)m_stepCount);
if ( v6 )
{
v6 = !a1->m_dontSchedule;
a1->m_counterEnabled = 1;
if ( v6 )
cocos2d::CCNode::schedule(a1, CCCounterLabel::updateCounter);
}
}