//
// CCCountdown::lapFinished from 0x5744fc to 0x574630 (308 bytes)
//
// 4 xrefs:
// > CCCountdown::startTimerWithSeconds @ 0x5747bc
// > ??> @ 0x57780
// > CCCountdown::lapFinished @ 0x574580
// > ??> @ 0x122ace0
//
// 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 CCCountdown::lapFinished(CCCountdown *a1)
{
const char *v1; // x1
cocos2d::CCLabelBMFont *m_countdownLabel; // x20
void (__fastcall *setString)(cocos2d::CCLabelBMFont *__hidden, const unsigned __int8 *); // x21
cocos2d::CCString *v5; // x0
const char *CString; // x0
cocos2d::CCSequence *v7; // x20
cocos2d::CCFiniteTimeAction *v8; // x0
cocos2d::CCAction *v9; // x20
cocos2d::CCDirector *v10; // x0
cocos2d::CCActionManager *v11; // x0
cocos2d::CCNode *m_targetNode; // x2
signed __int64 adj; // x0
v1 = (const char *)(unsigned int)(a1->m_seconds - 1);
a1->m_seconds = (int)v1;
if ( (int)v1 <= 0 )
{
m_targetNode = a1->m_targetNode;
if ( m_targetNode )
{
adj = a1->m_callbackSelector.adj;
if ( (adj & 1) != 0 )
(*(void (__fastcall **)(__int64))((char *)&(*(cocos2d::CCNode_vtbl **)((char *)&m_targetNode->__vftable
+ (adj >> 1)))->copyWithZone
+ (unsigned __int64)a1->m_callbackSelector.ptr))((__int64)m_targetNode + (adj >> 1));
else
((void (__fastcall *)(char *))a1->m_callbackSelector.ptr)((char *)m_targetNode + (adj >> 1));
}
a1->removeFromParentAndCleanup(a1, 1);
}
else
{
m_countdownLabel = a1->m_countdownLabel;
setString = m_countdownLabel->setString;
v5 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", v1);
CString = cocos2d::CCString::getCString(v5);
setString(m_countdownLabel, (const unsigned __int8 *)CString);
cocos2d::CCProgressTimer::setPercentage(a1->m_progressTimer, 100.0);
v7 = (cocos2d::CCSequence *)cocos2d::CCProgressFromTo::create(1.0, 100.0, 0.0);
v8 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCCallFunc::create(a1, CCCountdown::lapFinished, 0);
v9 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v7, v8, 0);
v9->setTag(v9, 0);
v10 = cocos2d::CCDirector::sharedDirector();
v11 = v10->getActionManager(v10);
cocos2d::CCActionManager::addAction(v11, v9, a1->m_progressTimer, 0);
}
}