//
// LevelInfoLayer::setupPlatformerStats from 0x3b1968 to 0x3b1b66 (510 bytes)
//
// 1 xrefs:
// > LevelInfoLayer::init @ 0x3b5040
//
// 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 LevelInfoLayer::setupPlatformerStats(LevelInfoLayer *a1)
{
cocos2d::CCDirector *v2; // r0
int m_bestTime; // r7
int v4; // r11
int v5; // r10
int v6; // r9
int v7; // r0
cocos2d::CCString *v8; // r0
char *CString; // r0
cocos2d::CCString *v10; // r0
char *v11; // r0
float v12; // s16
cocos2d::CCLabelBMFont *v13; // r7
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r9
unsigned int m_bestPoints; // r1
cocos2d::CCLabelBMFont **v16; // r0
cocos2d::CCLabelBMFont *v17; // r10
void (__fastcall *v18)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8
int v19; // r11
cocos2d::CCLabelBMFont *v20; // [sp+Ch] [bp-28h] BYREF
cocos2d::CCLabelBMFont *v21; // [sp+10h] [bp-24h] BYREF
cocos2d::CCSize v22; // [sp+14h] [bp-20h] BYREF
cocos2d::CCPoint v23; // [sp+1Ch] [bp-18h] BYREF
cocos2d::CCPoint v24; // [sp+24h] [bp-10h] BYREF
v2 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v22, v2);
sub_776584((int)&v20, "No Best Time");
m_bestTime = a1->m_level->m_bestTime;
if ( m_bestTime > 0 )
{
v4 = m_bestTime / 1000;
v5 = m_bestTime % 1000;
v6 = m_bestTime / 1000 / 60 % 60;
v7 = m_bestTime / 1000 / 3600;
if ( v6 )
{
if ( !v7 )
{
v8 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%02d:%02d.%03d",
(const char *)v6,
v4 % 60,
v5);
goto LABEL_5;
}
}
else if ( !v7 )
{
v8 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i.%03d",
(const char *)(v4 % 60),
v5);
LABEL_5:
CString = (char *)cocos2d::CCString::getCString(v8);
sub_7753D4((int)&v20, CString);
v10 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Best Time: %s",
(const char *)v20);
v11 = (char *)cocos2d::CCString::getCString(v10);
sub_7753D4((int)&v20, v11);
v12 = 0.0;
goto LABEL_10;
}
v8 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%02d:%02d:%02d.%03d",
(const char *)(m_bestTime / 1000 / 3600),
v6,
v4 % 60,
v5);
goto LABEL_5;
}
v12 = -10.0;
LABEL_10:
v13 = cocos2d::CCLabelBMFont::create();
a1->addChild_0(a1, v13, 3);
setPosition = v13->setPosition;
cocos2d::CCPoint::CCPoint(&v24, v22.width * 0.5, v12 + 145.0);
setPosition(v13, &v24);
cocos2d::CCLabelBMFont::limitLabelWidth(v13, 200.0, 0.6, 0.0);
m_bestPoints = a1->m_level->m_bestPoints;
if ( m_bestPoints )
{
GameToolbox::pointsToString((GameToolbox *)&v24, m_bestPoints);
v16 = (cocos2d::CCLabelBMFont **)sub_775570((int)&v24, 0, "Best Points: ");
v21 = *v16;
*v16 = (cocos2d::CCLabelBMFont *)&unk_ACDDA8;
sub_774008(&v24);
v17 = cocos2d::CCLabelBMFont::create();
a1->addChild_0(a1, v17, 3);
v18 = v17->setPosition;
v19 = (int)v13->getPosition(v13);
cocos2d::CCPoint::CCPoint(&v23, 0.0, -28.0);
cocos2d::CCPoint::operator+(&v24, v19, &v23);
v18(v17, &v24);
cocos2d::CCLabelBMFont::limitLabelWidth(v17, 200.0, 0.6, 0.0);
sub_774008(&v21);
}
sub_774008(&v20);
}