//
// EditorPauseLayer::init from 0x5096e8 to 0x509b3e (1110 bytes)
//
// 1 xrefs:
// > EditorPauseLayer::create @ 0x509bd4
//
// 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:51:26 +0000
//
cocos2d::CCDirector *__fastcall EditorPauseLayer::init(EditorPauseLayer *this, LevelEditorLayer *a2)
{
cocos2d::CCDirector *v3; // r0
int v4; // r5
_DWORD *v5; // r3
int v6; // r6
cocos2d::CCString *v7; // r0
char *CString; // r0
bool *v9; // r1
int v10; // r2
_BOOL4 v11; // r6
cocos2d::CCString *v12; // r0
char *v13; // r0
int v14; // r3
unsigned __int8 *v15; // r0
unsigned __int8 *v16; // r2
int v17; // r1
int v18; // t1
const char *v19; // r1
int v20; // r2
unsigned __int8 *v21; // r3
unsigned __int8 *v22; // r0
int v23; // r2
int v24; // t1
cocos2d::CCString *v25; // r0
char *v26; // r0
cocos2d::CCLabelBMFont *v27; // r0
int v28; // r6
void (__fastcall *v29)(int, _BYTE *); // r7
cocos2d::CCDirector *v30; // r0
void (__fastcall *v31)(int, _BYTE *); // r7
cocos2d::CCDirector *v32; // r0
float v33; // r0
float v34; // s16
cocos2d::CCDirector *v35; // r0
float v36; // r0
float v37; // r0
int v38; // r7
float v39; // r0
int v40; // r7
float v41; // s16
int v42; // r3
int v43; // r11
bool v44; // r2
int LengthKey; // r0
char *v46; // r1
size_t v47; // r0
const char *v48; // r2
char *v49; // r3
cocos2d::CCString *v50; // r0
char *v51; // r2
cocos2d::CCLabelBMFont *v52; // r0
int v53; // r7
void (__fastcall *v54)(int, _BYTE *); // r11
void (__fastcall *v55)(int, _BYTE *); // r11
int v56; // r6
cocos2d::CCDirector *v58; // [sp+10h] [bp-74h]
char *v59; // [sp+14h] [bp-70h]
char *v60; // [sp+14h] [bp-70h]
bool v61; // [sp+27h] [bp-5Dh] BYREF
char v62[8]; // [sp+28h] [bp-5Ch] BYREF
_BYTE v63[8]; // [sp+30h] [bp-54h] BYREF
_BYTE v64[8]; // [sp+38h] [bp-4Ch] BYREF
int v65[2]; // [sp+40h] [bp-44h] BYREF
cocos2d::CCLabelBMFont *v66; // [sp+48h] [bp-3Ch]
unsigned __int8 v67; // [sp+4Ch] [bp-38h] BYREF
char v68; // [sp+4Dh] [bp-37h] BYREF
int v69; // [sp+50h] [bp-34h]
unsigned __int8 *v70; // [sp+54h] [bp-30h]
unsigned __int8 v71; // [sp+58h] [bp-2Ch] BYREF
char v72; // [sp+59h] [bp-2Bh] BYREF
int v73; // [sp+5Ch] [bp-28h]
unsigned __int8 *v74; // [sp+60h] [bp-24h]
int v75[2]; // [sp+64h] [bp-20h] BYREF
char *v76; // [sp+6Ch] [bp-18h]
unsigned __int8 v77; // [sp+70h] [bp-14h] BYREF
char v78; // [sp+71h] [bp-13h] BYREF
char *v79; // [sp+78h] [bp-Ch]
*((_DWORD *)this + 114) = a2;
v3 = (cocos2d::CCDirector *)CCBlockLayer::init(this);
v58 = v3;
if ( !v3 )
return v58;
v4 = *(_DWORD *)(*(_DWORD *)(*((_DWORD *)this + 114) + 1408) + 952);
cocos2d::CCDirector::sharedDirector(v3);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v62);
v5 = *((_DWORD **)this + 114);
v6 = *(unsigned __int8 *)(v5[352] + 984) + *(unsigned __int8 *)(v5[352] + 985);
v65[0] = 0;
v65[1] = 0;
v66 = nullptr;
if ( v6 == 2 )
{
v7 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Objects: %i (Unlimited)",
(const char *)(v5[2967] - v5[2968]));
CString = (char *)cocos2d::CCString::getCString(v7);
std::string::assign(v65, CString);
}
else
{
v10 = 80000;
v11 = v6 > 0;
if ( !v11 )
v10 = 40000;
v12 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Objects: %i/%i",
(const char *)(v5[2967] - v5[2968]),
v10,
40000);
v13 = (char *)cocos2d::CCString::getCString(v12);
std::string::assign(v65, v13);
if ( v11 )
std::string::append(v65, " (high)");
}
v9 = *((bool **)this + 114);
v61 = 0;
LevelEditorLayer::getSongIDs((LevelEditorLayer *)&v67, v9, &v61);
LevelEditorLayer::getSFXIDs((LevelEditorLayer *)&v71, *((_DWORD *)this + 114));
if ( (v67 & 1) != 0 )
{
v14 = v69;
if ( v69 )
{
v15 = v70;
goto LABEL_14;
}
LABEL_20:
v19 = (char *)&dword_0 + 1;
goto LABEL_21;
}
v14 = (int)v67 >> 1;
if ( !v14 )
goto LABEL_20;
v15 = (unsigned __int8 *)&v68;
LABEL_14:
v16 = &v15[v14];
v17 = 0;
while ( v15 != v16 )
{
v18 = *v15++;
if ( v18 == 44 )
++v17;
}
v19 = (const char *)(v17 + 1);
LABEL_21:
if ( (v71 & 1) != 0 )
{
v20 = v73;
if ( v73 )
{
v21 = v74;
goto LABEL_26;
}
}
else
{
v20 = (int)v71 >> 1;
if ( v20 )
{
v21 = (unsigned __int8 *)&v72;
LABEL_26:
v22 = &v21[v20];
v23 = 0;
while ( v21 != v22 )
{
v24 = *v21++;
if ( v24 == 44 )
++v23;
}
v20 = v23 + 1;
}
}
if ( v61 || v20 )
{
v25 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)", Songs: %i, SFX: %i", v19);
v26 = (char *)cocos2d::CCString::getCString(v25);
std::string::append(v65, v26);
}
if ( v4 != 2 )
std::string::append(v65, " (Read-Only)");
if ( (v65[0] & 1) != 0 )
v27 = v66;
else
v27 = (cocos2d::CCLabelBMFont *)((char *)v65 + 1);
v28 = cocos2d::CCLabelBMFont::create(v27, "goldFont.fnt", (const char *)v20);
v29 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v28 + 148);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v64, 0.0, 1.0);
v29(v28, v64);
v30 = (cocos2d::CCDirector *)(*(int (__fastcall **)(EditorPauseLayer *, int))(*(_DWORD *)this + 228))(this, v28);
v31 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v28 + 92);
v32 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v30);
v33 = COERCE_FLOAT(cocos2d::CCDirector::getScreenLeft(v32));
v34 = (float)(v33 + 10.0) + 0.0;
v35 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)LODWORD(v33));
v36 = COERCE_FLOAT(cocos2d::CCDirector::getScreenTop(v35));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v64, v34, v36 - 5.0);
v31(v28, v64);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v28 + 80))(v28, 1056964608);
v37 = COERCE_FLOAT(LevelEditorLayer::getLastObjectX(*((LevelEditorLayer **)this + 114)));
v38 = *(_DWORD *)(*((_DWORD *)this + 114) + 11880);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v64, v37 + 340.0, 0.0);
v39 = COERCE_FLOAT(DrawGridLayer::timeForPos(v38, (const cocos2d::CCPoint *)v64, 0, 0, 0, 0, 0, 0));
v40 = *((_DWORD *)this + 114);
v41 = v39;
v42 = *(_DWORD *)(*(_DWORD *)(v40 + 1408) + 1000);
if ( v42 > 0 && (float)((float)v42 / 240.0) > v39 )
v41 = (float)v42 / 240.0;
v43 = (int)floorf(v41 / 60.0);
LengthKey = GJGameLevel::getLengthKey(
(GJGameLevel *)(int)v41,
*(unsigned __int8 *)(*(_DWORD *)(v40 + 2084) + 281),
v44);
GJGameLevel::lengthKeyToString((GJGameLevel *)&v77, LengthKey);
v46 = (char *)(v77 << 31);
if ( (v77 & 1) == 0 )
v46 = &v78;
v75[0] = 0;
if ( (v77 & 1) != 0 )
v46 = v79;
v75[1] = 0;
v76 = nullptr;
v59 = v46;
v47 = strlen(v46);
std::string::__init(v75, v59, v47);
std::string::~string((int)&v77);
if ( *(_BYTE *)(*(_DWORD *)(*((_DWORD *)this + 114) + 2084) + 281) )
{
v52 = (cocos2d::CCLabelBMFont *)"Length: Platformer";
}
else
{
v60 = (char *)(int)(float)(v41 - (float)(60 * v43));
if ( v43 <= 0 )
{
if ( (v75[0] & 1) != 0 )
v51 = v76;
else
v51 = (char *)v75 + 1;
v50 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Length: %i seconds (%s)",
v60,
v51);
}
else
{
if ( (v75[0] & 1) != 0 )
v49 = v76;
else
v49 = (char *)v75 + 1;
v50 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Length: %imin %is (%s)",
(const char *)v43,
v60,
v49);
}
v52 = (cocos2d::CCLabelBMFont *)cocos2d::CCString::getCString(v50);
}
v53 = cocos2d::CCLabelBMFont::create(v52, "goldFont.fnt", v48);
v54 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v53 + 148);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v64, 0.0, 1.0);
v54(v53, v64);
(*(void (__fastcall **)(EditorPauseLayer *, int))(*(_DWORD *)this + 228))(this, v53);
v55 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v53 + 92);
v56 = (*(int (__fastcall **)(int))(*(_DWORD *)v28 + 96))(v28);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v63, 0.0, -20.0);
cocos2d::CCPoint::operator+(v64, v56, v63);
v55(v53, v64);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v53 + 80))(v53, 1056964608);
std::string::~string((int)v75);
std::string::~string((int)&v71);
std::string::~string((int)&v67);
std::string::~string((int)v65);
return v58;
}