//
// LevelInfoLayer::setupPlatformerStats from 0x49ce68 to 0x49d1a0 (824 bytes)
//
// 1 xrefs:
// > LevelInfoLayer::init @ 0x49eb52
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:49:46 +0000
//
int __fastcall LevelInfoLayer::setupPlatformerStats(LevelInfoLayer *this)
{
GJGameLevel *v2; // r0
int v3; // r4
const char *NormalPercent; // r0
const char *v5; // r2
const char *v6; // r6
cocos2d::CCString *v7; // r0
cocos2d::CCDirector *v8; // r4
float v9; // s16
cocos2d::CCDirector *v10; // r0
float v11; // r0
int v12; // r11
int v13; // r10
int v14; // r6
int v15; // r0
cocos2d::CCString *v16; // r0
char *CString; // r0
cocos2d::CCString *v18; // r0
char *v19; // r0
float v20; // s17
cocos2d::CCLabelBMFont *v21; // r0
cocos2d::CCLabelBMFont *v22; // r10
void (__fastcall *v23)(cocos2d::CCLabelBMFont *, _BYTE *); // r4
unsigned int v24; // r1
int v25; // r1
size_t v26; // r4
unsigned int v27; // r1
const char *v28; // r11
char *v29; // r3
const char *v30; // r3
const char *v31; // r1
char *v32; // r2
int v33; // t1
size_t v34; // r4
int v35; // r0
size_t v36; // r1
cocos2d::CCLabelBMFont *v37; // r2
const char *v38; // r2
cocos2d::CCLabelBMFont *v39; // r0
cocos2d::CCLabelBMFont *v40; // r6
void (__fastcall *v41)(cocos2d::CCLabelBMFont *, _BYTE *); // r11
int v42; // r10
char *v44; // [sp+14h] [bp-48h]
float v45[2]; // [sp+18h] [bp-44h] BYREF
_BYTE v46[8]; // [sp+20h] [bp-3Ch] BYREF
_BYTE v47[8]; // [sp+28h] [bp-34h] BYREF
int v48[2]; // [sp+30h] [bp-2Ch] BYREF
cocos2d::CCLabelBMFont *v49; // [sp+38h] [bp-24h]
_DWORD v50[2]; // [sp+3Ch] [bp-20h] BYREF
cocos2d::CCLabelBMFont *v51; // [sp+44h] [bp-18h]
int v52; // [sp+48h] [bp-14h] BYREF
size_t v53; // [sp+4Ch] [bp-10h]
void *v54; // [sp+50h] [bp-Ch]
cocos2d::CCDirector::sharedDirector(this);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v45);
v48[0] = 0;
v48[1] = 0;
v49 = nullptr;
std::string::__init(v48, "No Best Time", 0xCu);
v2 = *((GJGameLevel **)this + 91);
v3 = *((_DWORD *)v2 + 260);
NormalPercent = (const char *)GJGameLevel::getNormalPercent(v2);
v6 = NormalPercent;
if ( v3 > 0 )
{
v12 = v3 / 1000;
v13 = v3 % 1000;
v14 = v3 / 1000 / 60 % 60;
v15 = v3 / 1000 / 3600;
if ( v14 )
{
if ( !v15 )
{
v16 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%02d:%02d.%03d",
(const char *)v14,
v12 % 60,
v13);
goto LABEL_7;
}
}
else if ( !v15 )
{
v16 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i.%03d",
(const char *)(v12 % 60),
v13);
LABEL_7:
CString = (char *)cocos2d::CCString::getCString(v16);
std::string::assign(v48, CString);
if ( (v48[0] & 1) != 0 )
v18 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Best Time: %s",
(const char *)v49);
else
v18 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Best Time: %s",
(const char *)v48 + 1);
v19 = (char *)cocos2d::CCString::getCString(v18);
std::string::assign(v48, v19);
v20 = 0.0;
goto LABEL_15;
}
v16 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%02d:%02d:%02d.%03d",
(const char *)(v3 / 1000 / 3600),
v14,
v12 % 60,
v13);
goto LABEL_7;
}
if ( (unsigned int)(NormalPercent - 1) <= 0x62 )
{
v7 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i%%", NormalPercent);
v8 = (cocos2d::CCDirector *)cocos2d::CCString::getCString(v7);
v9 = v45[0] * 0.5;
v10 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v8);
v11 = COERCE_FLOAT(cocos2d::CCDirector::getScreenBottom(v10));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v47, v9, v11 + 120.0);
LevelInfoLayer::addProgressBar((int)this, (int)v47, v6, 65280, (cocos2d::CCLabelBMFont *)"Best", v8);
return std::string::~string((int)v48);
}
v20 = -10.0;
LABEL_15:
if ( (v48[0] & 1) != 0 )
v21 = v49;
else
v21 = (cocos2d::CCLabelBMFont *)((char *)v48 + 1);
v22 = (cocos2d::CCLabelBMFont *)cocos2d::CCLabelBMFont::create(v21, "goldFont.fnt", v5);
(*(void (__fastcall **)(LevelInfoLayer *, cocos2d::CCLabelBMFont *, int))(*(_DWORD *)this + 232))(this, v22, 3);
v23 = *(void (__fastcall **)(cocos2d::CCLabelBMFont *, _BYTE *))(*(_DWORD *)v22 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v47, v45[0] * 0.5, v20 + 145.0);
v23(v22, v47);
cocos2d::CCLabelBMFont::limitLabelWidth(v22, 200.0, 0.6, 0.0);
v24 = *(_DWORD *)(*((_DWORD *)this + 91) + 1068);
if ( v24 )
{
GameToolbox::pointsToString((GameToolbox *)&v52, v24);
v26 = (unsigned __int8)v52;
if ( (v52 & 1) != 0 )
v25 = v52;
else
v26 = (int)(unsigned __int8)v52 >> 1;
if ( (v52 & 1) != 0 )
{
v26 = v53;
v27 = (v25 & 0xFFFFFFFE) - 1;
}
else
{
v27 = 10;
}
if ( v27 - v26 <= 0xC )
{
std::string::__grow_by_and_replace((int)&v52, v27, v26 + 13 - v27, v26, 0, 0, 0xDu, "Best Points: ");
}
else
{
if ( (v52 & 1) != 0 )
v28 = (const char *)v54;
else
v28 = (char *)&v52 + 1;
if ( v26 )
{
v29 = "Best Points: ";
if ( v28 <= "Best Points: " && &v28[v26] > "Best Points: " )
v29 = "";
v44 = v29;
memmove((void *)(v28 + 13), v28, v26);
v30 = v44;
}
else
{
v30 = "Best Points: ";
}
v31 = v30 + 12;
v32 = (char *)v28;
do
{
v33 = *(_DWORD *)v30;
v30 += 4;
*(_DWORD *)v32 = v33;
v32 += 4;
}
while ( v30 != v31 );
v34 = v26 + 13;
*v32 = *v30;
if ( (v52 & 1) != 0 )
v53 = v34;
else
LOBYTE(v52) = 2 * v34;
v28[v34] = 0;
}
v35 = v52;
v36 = v53;
v37 = (cocos2d::CCLabelBMFont *)v54;
v52 = 0;
v53 = 0;
v54 = nullptr;
v50[0] = v35;
v50[1] = v36;
v51 = v37;
std::string::~string((int)&v52);
if ( (v50[0] & 1) != 0 )
v39 = v51;
else
v39 = (cocos2d::CCLabelBMFont *)((char *)v50 + 1);
v40 = (cocos2d::CCLabelBMFont *)cocos2d::CCLabelBMFont::create(v39, "goldFont.fnt", v38);
(*(void (__fastcall **)(LevelInfoLayer *, cocos2d::CCLabelBMFont *, int))(*(_DWORD *)this + 232))(this, v40, 3);
v41 = *(void (__fastcall **)(cocos2d::CCLabelBMFont *, _BYTE *))(*(_DWORD *)v40 + 92);
v42 = (*(int (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_DWORD *)v22 + 96))(v22);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v46, 0.0, -28.0);
cocos2d::CCPoint::operator+(v47, v42, v46);
v41(v40, v47);
cocos2d::CCLabelBMFont::limitLabelWidth(v40, 200.0, 0.6, 0.0);
std::string::~string((int)v50);
}
return std::string::~string((int)v48);
}