//
// CCCountdown::lapFinished from 0x2e5594 to 0x2e5656 (194 bytes)
//
// 1 xrefs:
// > CCCountdown::startTimerWithSeconds @ 0x2e5766
//
// 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 *v2; // r1
cocos2d::CCNode *m_targetNode; // r0
void (*ptr)(void); // r3
int v5; // r2
char *v6; // r0
cocos2d::CCLabelBMFont *m_countdownLabel; // r5
void (__fastcall *setString)(cocos2d::CCLabelBMFont *__hidden, const unsigned __int8 *); // r6
cocos2d::CCString *v9; // r0
const char *CString; // r0
cocos2d::CCSequence *v11; // r6
cocos2d::CCFiniteTimeAction *v12; // r0
int v13; // r3
cocos2d::CCAction *v14; // r6
cocos2d::CCDirector *v15; // r0
cocos2d::CCActionManager *v16; // r0
v2 = (const char *)(a1->m_seconds - 1);
a1->m_seconds = (int)v2;
if ( (int)v2 > 0 )
{
m_countdownLabel = a1->m_countdownLabel;
setString = m_countdownLabel->setString;
v9 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", v2);
CString = cocos2d::CCString::getCString(v9);
setString(m_countdownLabel, (const unsigned __int8 *)CString);
cocos2d::CCProgressTimer::setPercentage(a1->m_progressTimer, 100.0);
v11 = (cocos2d::CCSequence *)cocos2d::CCProgressFromTo::create(1.0, 100.0, 0.0);
v12 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCCallFunc::create(a1, CCCountdown::lapFinished, 0);
v14 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v11, v12, 0, v13, CCCountdown::lapFinished, 0);
v14->setTag(v14, 0);
v15 = cocos2d::CCDirector::sharedDirector();
v16 = v15->getActionManager(v15);
cocos2d::CCActionManager::addAction(v16, v14, a1->m_progressTimer, 0);
}
else
{
m_targetNode = a1->m_targetNode;
if ( m_targetNode )
{
ptr = a1->m_callbackSelector.ptr;
v5 = (int)a1->m_callbackSelector.adj >> 1;
if ( (a1->m_callbackSelector.adj & 1) != 0 )
v2 = *(const char **)((char *)&m_targetNode->__vftable + v5);
v6 = (char *)m_targetNode + v5;
if ( (a1->m_callbackSelector.adj & 1) != 0 )
ptr = *(void (**)(void))((char *)ptr + (_DWORD)v2);
((void (__fastcall *)(char *, const char *))ptr)(v6, v2);
}
a1->removeFromParentAndCleanup(a1, 1);
}
}