//
// CCCountdown::init from 0x574294 to 0x5744f8 (612 bytes)
//
// 3 xrefs:
// > CCCountdown::create @ 0x5746f8
// > ??> @ 0x3fd68
// > ??> @ 0x1137270
//
// 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
//
bool CCCountdown::init(CCCountdown *a1)
{
const char *v2; // x1
char v3; // w22
cocos2d::CCSprite *v4; // x0
cocos2d::CCProgressTimer *v5; // x0
cocos2d::CCProgressTimer *m_progressTimer; // x24
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x25
const cocos2d::CCSize *v8; // x0
cocos2d::CCSprite *m_pSprite; // x0
void (__fastcall *setColor)(cocos2d::CCSprite *__hidden, const cocos2d::ccColor3B *); // x2
cocos2d::CCLabelBMFont *v11; // x24
CCCountdown_vtbl *v12; // x1
void (__fastcall *v13)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x25
const cocos2d::CCSize *v14; // x0
cocos2d::CCLabelBMFont *m_countdownLabel; // x24
void (__fastcall *setAnchorPoint)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // x25
cocos2d::CCLabelBMFont *v17; // x24
void (__fastcall *v18)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x25
__int64 v19; // x26
float v21; // [xsp+60h] [xbp+60h]
float v22; // [xsp+60h] [xbp+60h]
cocos2d::CCPoint v23; // [xsp+78h] [xbp+78h] BYREF
cocos2d::CCPoint v24; // [xsp+80h] [xbp+80h] BYREF
v3 = cocos2d::CCSprite::initWithFile(a1, "timer_outerCircle.png");
if ( v3 )
{
v4 = (cocos2d::CCSprite *)cocos2d::CCSprite::create((cocos2d::CCSprite *)"timer_innerCircle.png", v2);
v5 = cocos2d::CCProgressTimer::create(v4);
a1->m_progressTimer = v5;
cocos2d::CCProgressTimer::setType(v5, kCCProgressTimerTypeRadial);
a1->addChild_0(a1, a1->m_progressTimer, -1);
m_progressTimer = a1->m_progressTimer;
setPosition = m_progressTimer->setPosition;
v21 = a1->getContentSize(a1)->width * 0.5;
v8 = a1->getContentSize(a1);
cocos2d::CCPoint::CCPoint(&v24, v21, v8->height * 0.5);
setPosition(m_progressTimer, &v24);
cocos2d::CCProgressTimer::setPercentage(a1->m_progressTimer, 100.0);
m_pSprite = a1->m_progressTimer->m_pSprite;
setColor = m_pSprite->setColor;
LOWORD(v24.x) = 10240;
BYTE2(v24.x) = 70;
setColor(m_pSprite, (const cocos2d::ccColor3B *)&v24);
cocos2d::CCProgressTimer::updateColor(a1->m_progressTimer);
a1->m_progressTimer->m_bReverseDirection = 1;
v11 = cocos2d::CCLabelBMFont::create();
v12 = a1->cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_countdownLabel = v11;
v13 = v11->setPosition;
v22 = v12->getContentSize(a1)->width * 0.5;
v14 = a1->getContentSize(a1);
cocos2d::CCPoint::CCPoint(&v24, v22, v14->height * 0.5);
v13(v11, &v24);
m_countdownLabel = a1->m_countdownLabel;
setAnchorPoint = m_countdownLabel->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v24, 0.5, 0.5);
setAnchorPoint(m_countdownLabel, &v24);
v17 = a1->m_countdownLabel;
v18 = v17->setPosition;
v19 = (__int64)v17->getPosition(v17);
cocos2d::CCPoint::CCPoint(&v23, 0.0, -3.0);
cocos2d::CCPoint::operator+(&v24, v19, &v23);
v18(v17, &v24);
a1->addChild_0(a1, a1->m_countdownLabel, 1);
}
return v3;
}