//
// LevelEditorLayer::init from 0x475b0c to 0x476748 (3132 bytes)
//
// 1 xrefs:
// > LevelEditorLayer::create @ 0x477e8e
//
// 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:10 +0000
//
EditorSFXManager *__fastcall LevelEditorLayer::init(LevelEditorLayer *this, GJGameLevel *a2, int a3)
{
EditorSFXManager *v4; // r0
EditorSFXManager *v5; // r0
MusicDownloadManager *v6; // r0
MusicDownloadManager *v7; // r0
EditorSFXManager *Libraries; // r0
EditorSFXManager *v9; // r0
GameManager *v10; // r0
GameManager *v11; // r0
GameManager *GameVariable; // r0
GameManager *v13; // r0
GameManager *v14; // r0
GameManager *v15; // r0
GameManager *v16; // r0
GameManager *v17; // r0
FMODAudioEngine *v18; // r0
FMODAudioEngine *v19; // r0
GameManager *v20; // r0
GameManager *v21; // r0
cocos2d::CCArray *v22; // r0
cocos2d::CCObject *v23; // r0
cocos2d::CCDictionary *v24; // r0
cocos2d::CCObject *v25; // r0
cocos2d::CCDictionary *v26; // r0
cocos2d::CCObject *v27; // r0
cocos2d::CCDictionary *v28; // r0
cocos2d::CCObject *v29; // r0
cocos2d::CCArray *v30; // r0
cocos2d::CCObject *v31; // r0
cocos2d::CCArray *v32; // r0
cocos2d::CCObject *v33; // r0
cocos2d::CCArray *v34; // r0
cocos2d::CCObject *v35; // r0
cocos2d::CCArray *v36; // r0
cocos2d::CCObject *v37; // r0
cocos2d::CCArray *v38; // r0
cocos2d::CCObject *v39; // r0
cocos2d::CCDictionary *v40; // r0
cocos2d::CCObject *v41; // r0
cocos2d::CCArray *v42; // r0
cocos2d::CCObject *v43; // r0
cocos2d::CCDictionary *v44; // r0
cocos2d::CCObject *v45; // r0
cocos2d::CCArray *v46; // r0
cocos2d::CCObject *v47; // r0
cocos2d::CCArray *v48; // r0
cocos2d::CCObject *v49; // r0
cocos2d::CCArray *v50; // r0
cocos2d::CCObject *v51; // r0
cocos2d::CCArray *v52; // r0
cocos2d::CCObject *v53; // r0
cocos2d::CCArray *v54; // r0
cocos2d::CCObject *v55; // r0
cocos2d::CCArray *v56; // r0
cocos2d::CCObject *v57; // r0
cocos2d::CCArray *v58; // r0
cocos2d::CCObject *v59; // r0
int v60; // r3
unsigned int v61; // r1
_DWORD *v62; // r1
int v63; // r3
int v64; // r3
unsigned int v65; // r1
int v66; // r3
_DWORD *i; // r1
int v68; // r3
unsigned int v69; // r1
int v70; // r3
_DWORD *j; // r1
int v72; // r3
unsigned int v73; // r1
unsigned int m; // r3
int v75; // r3
_DWORD *k; // r1
int v77; // r0
_DWORD *v78; // r2
int *v79; // r0
int v80; // r3
int v81; // r3
unsigned int v82; // r1
cocos2d::CCArray *v83; // r0
int v84; // r6
cocos2d::CCArray *v85; // r9
int v86; // r3
unsigned __int8 *v87; // r5
unsigned __int8 *v88; // r6
unsigned __int8 *v89; // r0
int v90; // r5
int v91; // r6
unsigned int v92; // r7
const char *v93; // r11
size_t v94; // r0
cocos2d::CCObject *v95; // r0
unsigned __int8 *v96; // r5
unsigned int v97; // r3
unsigned __int8 *v98; // r11
unsigned __int8 *first_of; // r0
unsigned int n; // r6
cocos2d::CCString *v101; // r0
unsigned int v102; // r0
unsigned int v103; // r1
int v104; // r3
int v105; // r0
int v106; // r6
int jj; // r5
int v108; // r3
_DWORD *ii; // r2
int v110; // r3
unsigned int kk; // r6
int (__fastcall *v112)(LevelEditorLayer *, float); // r9
int *v113; // r0
cocos2d::CCDirector *v114; // r0
LevelEditorLayer *v115; // r2
cocos2d::CCLayer *v116; // r5
int v117; // r6
int (__fastcall *v118)(int, cocos2d::CCLayer *, int, int, int *); // r7
GameManager *v119; // r0
int v120; // r0
int v121; // r2
cocos2d::CCDrawNode *v122; // r0
int v123; // r0
cocos2d::CCDrawNode *v124; // r0
int v125; // r0
const char *v126; // r1
int v127; // r0
int v128; // r1
_BYTE *v129; // r2
bool v130; // zf
int v131; // r3
int v132; // r1
int v133; // r2
LevelSettingsObject *v134; // r0
int ColorAction; // r0
_BYTE *v136; // r2
char v137; // r5
char v138; // r1
int v139; // r0
cocos2d::CCNode *v140; // r0
int v141; // r3
unsigned __int8 *v142; // r3
LevelEditorLayer *v143; // r1
unsigned __int8 v144; // r2
int v145; // r0
_BOOL4 v146; // r3
int v147; // r6
void (__fastcall *v148)(int, int (__fastcall **)(LevelEditorLayer *, float)); // r7
EditorUI *v149; // r0
EditorUI *v150; // r0
int v151; // r3
_DWORD *v152; // r3
LabelGameObject **v153; // r6
LabelGameObject **v154; // r5
LabelGameObject *v155; // r1
LabelGameObject *v156; // t1
int v157; // r3
int *v158; // r2
int v159; // r3
int *v160; // r2
int *v161; // r3
int v162; // r1
int v163; // t1
GameManager *updated; // r0
GameManager *v165; // r0
char v166; // r0
EditorSFXManager *v167; // r0
EditorSFXManager *v168; // r0
char *v170; // r0
const char *v171; // r0
int v172; // s16
char *v173; // r0
const char *v174; // r0
int v175; // r0
int v176; // r9
int *v177; // [sp+0h] [bp-A4h]
cocos2d::CCPoint *v178; // [sp+Ch] [bp-98h]
EditorSFXManager *v180; // [sp+1Ch] [bp-88h]
char v182[8]; // [sp+28h] [bp-7Ch] BYREF
_DWORD v183[2]; // [sp+30h] [bp-74h] BYREF
float v184[2]; // [sp+38h] [bp-6Ch] BYREF
char v185[4]; // [sp+40h] [bp-64h] BYREF
float v186; // [sp+44h] [bp-60h]
int v187; // [sp+48h] [bp-5Ch] BYREF
unsigned int v188; // [sp+4Ch] [bp-58h]
unsigned __int8 *v189; // [sp+50h] [bp-54h]
int v190[3]; // [sp+54h] [bp-50h] BYREF
int (__fastcall *v191)(LevelEditorLayer *, float); // [sp+60h] [bp-44h] BYREF
int v192; // [sp+64h] [bp-40h]
int v193; // [sp+68h] [bp-3Ch]
int v194[3]; // [sp+6Ch] [bp-38h] BYREF
int v195; // [sp+78h] [bp-2Ch] BYREF
int v196; // [sp+7Ch] [bp-28h]
int v197; // [sp+80h] [bp-24h]
int v198[3]; // [sp+84h] [bp-20h] BYREF
int v199[3]; // [sp+90h] [bp-14h] BYREF
v4 = (EditorSFXManager *)GJBaseGameLayer::init(this);
v180 = v4;
if ( !v4 )
return v180;
v5 = (EditorSFXManager *)EditorSFXManager::sharedState(v4);
v6 = (MusicDownloadManager *)EditorSFXManager::setEditorLoading(v5, 1);
v7 = (MusicDownloadManager *)MusicDownloadManager::sharedState(v6);
Libraries = (EditorSFXManager *)MusicDownloadManager::tryLoadLibraries(v7);
v9 = (EditorSFXManager *)EditorSFXManager::sharedState(Libraries);
EditorSFXManager::ensureLoaded(v9);
v10 = (GameManager *)UILayer::enableEditorMode(*((UILayer **)this + 2810));
*((_BYTE *)this + 10612) = 1;
*((_BYTE *)this + 11824) = 1;
v11 = (GameManager *)GameManager::sharedState(v10);
GameVariable = (GameManager *)GameManager::getGameVariable(v11, "0102");
*((_BYTE *)this + 11709) = (_BYTE)GameVariable;
v13 = (GameManager *)GameManager::sharedState(GameVariable);
v14 = (GameManager *)GameManager::getGameVariable(v13, "0117");
*((_BYTE *)this + 11704) = (_BYTE)v14;
v15 = (GameManager *)GameManager::sharedState(v14);
*((_BYTE *)this + 11705) = GameManager::getGameVariable(v15, "0118");
v16 = (GameManager *)*((unsigned __int8 *)this + 11708);
if ( !*((_BYTE *)this + 11708) )
{
v17 = (GameManager *)GameManager::sharedState(v16);
LOBYTE(v16) = GameManager::getGameVariable(v17, "0137");
}
*((_BYTE *)this + 11707) = (_BYTE)v16;
LevelEditorLayer::updateOptions((EditorUI **)this);
v18 = (FMODAudioEngine *)LevelEditorLayer::setObjectCount(this, 0);
v19 = (FMODAudioEngine *)FMODAudioEngine::sharedEngine(v18);
FMODAudioEngine::stopAllMusic(v19, 1);
*((_DWORD *)this + 352) = a2;
v20 = (GameManager *)cocos2d::CCObject::retain(a2);
v21 = (GameManager *)GameManager::sharedState(v20);
*((_BYTE *)v21 + 506) = 1;
v22 = (cocos2d::CCArray *)GameManager::sharedState(v21);
*((_DWORD *)v22 + 102) = this;
v23 = (cocos2d::CCObject *)cocos2d::CCArray::create(v22);
*((_DWORD *)this + 2931) = v23;
v24 = (cocos2d::CCDictionary *)cocos2d::CCObject::retain(v23);
v25 = (cocos2d::CCObject *)cocos2d::CCDictionary::create(v24);
*((_DWORD *)this + 2981) = v25;
v26 = (cocos2d::CCDictionary *)cocos2d::CCObject::retain(v25);
v27 = (cocos2d::CCObject *)cocos2d::CCDictionary::create(v26);
*((_DWORD *)this + 2954) = v27;
v28 = (cocos2d::CCDictionary *)cocos2d::CCObject::retain(v27);
v29 = (cocos2d::CCObject *)cocos2d::CCDictionary::create(v28);
*((_DWORD *)this + 2955) = v29;
v30 = (cocos2d::CCArray *)cocos2d::CCObject::retain(v29);
v31 = (cocos2d::CCObject *)cocos2d::CCArray::create(v30);
*((_DWORD *)this + 2932) = v31;
v32 = (cocos2d::CCArray *)cocos2d::CCObject::retain(v31);
v33 = (cocos2d::CCObject *)cocos2d::CCArray::create(v32);
*((_DWORD *)this + 2933) = v33;
v34 = (cocos2d::CCArray *)cocos2d::CCObject::retain(v33);
v35 = (cocos2d::CCObject *)cocos2d::CCArray::create(v34);
*((_DWORD *)this + 2934) = v35;
v36 = (cocos2d::CCArray *)cocos2d::CCObject::retain(v35);
v37 = (cocos2d::CCObject *)cocos2d::CCArray::create(v36);
*((_DWORD *)this + 2935) = v37;
v38 = (cocos2d::CCArray *)cocos2d::CCObject::retain(v37);
v39 = (cocos2d::CCObject *)cocos2d::CCArray::create(v38);
*((_DWORD *)this + 2941) = v39;
v40 = (cocos2d::CCDictionary *)cocos2d::CCObject::retain(v39);
v41 = (cocos2d::CCObject *)cocos2d::CCDictionary::create(v40);
*((_DWORD *)this + 2940) = v41;
v42 = (cocos2d::CCArray *)cocos2d::CCObject::retain(v41);
v43 = (cocos2d::CCObject *)cocos2d::CCArray::create(v42);
*((_DWORD *)this + 2952) = v43;
v44 = (cocos2d::CCDictionary *)cocos2d::CCObject::retain(v43);
v45 = (cocos2d::CCObject *)cocos2d::CCDictionary::create(v44);
*((_DWORD *)this + 2944) = v45;
v46 = (cocos2d::CCArray *)cocos2d::CCObject::retain(v45);
v47 = (cocos2d::CCObject *)cocos2d::CCArray::create(v46);
*((_DWORD *)this + 2945) = v47;
v48 = (cocos2d::CCArray *)cocos2d::CCObject::retain(v47);
*((_BYTE *)this + 11785) = 1;
v49 = (cocos2d::CCObject *)cocos2d::CCArray::create(v48);
*((_DWORD *)this + 2936) = v49;
v50 = (cocos2d::CCArray *)cocos2d::CCObject::retain(v49);
v51 = (cocos2d::CCObject *)cocos2d::CCArray::create(v50);
*((_DWORD *)this + 2965) = v51;
v52 = (cocos2d::CCArray *)cocos2d::CCObject::retain(v51);
v53 = (cocos2d::CCObject *)cocos2d::CCArray::create(v52);
*((_DWORD *)this + 2966) = v53;
v54 = (cocos2d::CCArray *)cocos2d::CCObject::retain(v53);
v55 = (cocos2d::CCObject *)cocos2d::CCArray::create(v54);
*((_DWORD *)this + 2937) = v55;
v56 = (cocos2d::CCArray *)cocos2d::CCObject::retain(v55);
v57 = (cocos2d::CCObject *)cocos2d::CCArray::create(v56);
*((_DWORD *)this + 2938) = v57;
v58 = (cocos2d::CCArray *)cocos2d::CCObject::retain(v57);
v59 = (cocos2d::CCObject *)cocos2d::CCArray::create(v58);
*((_DWORD *)this + 2939) = v59;
cocos2d::CCObject::retain(v59);
v60 = *((_DWORD *)this + 2975);
v61 = (*((_DWORD *)this + 2976) - v60) >> 2;
if ( v61 > 0x270F )
{
if ( v61 != 10000 )
{
v62 = (_DWORD *)((char *)this + 11904);
v63 = v60 + 40000;
while ( v63 != *v62 )
*v62 -= 4;
}
}
else
{
std::vector::__append((_DWORD *)this + 2975, 10000 - v61);
}
std::vector::resize((void **)this + 2997, 0x2710u, 0);
v178 = (LevelEditorLayer *)((char *)this + 12000);
std::vector::resize((void **)this + 3000, 0x2710u, 0);
v64 = *((_DWORD *)this + 3015);
v65 = *((_DWORD *)this + 3016) - v64;
if ( v65 > 0x270F )
{
if ( v65 != 10000 )
{
v66 = v64 + 10000;
for ( i = (_DWORD *)((char *)this + 12064); v66 != *i; --*i )
;
}
}
else
{
std::vector::__append((int)this + 12060, 10000 - v65);
}
std::vector::resize((void **)this + 3012, 0x2710u, 0);
std::vector::resize((void **)this + 3009, 0x2710u, 0);
v68 = *((_DWORD *)this + 2982);
v69 = (*((_DWORD *)this + 2983) - v68) >> 2;
if ( v69 > 0x270F )
{
if ( v69 != 10000 )
{
v70 = v68 + 40000;
for ( j = (_DWORD *)((char *)this + 11932); v70 != *j; *j -= 4 )
;
}
}
else
{
std::vector::__append((int)this + 11928, 10000 - v69);
}
std::vector::resize((void **)this + 2994, 0x2710u, 0);
v72 = *((_DWORD *)this + 3018);
v73 = (*((_DWORD *)this + 3019) - v72) >> 2;
if ( v73 > 0x270F )
{
if ( v73 != 10000 )
{
v75 = v72 + 40000;
for ( k = (_DWORD *)((char *)this + 12076); v75 != *k; *k -= 4 )
;
}
}
else
{
std::vector::__append((int)this + 12072, 10000 - v73);
}
for ( m = 0; m != 10000; ++m )
{
*(_DWORD *)(*((_DWORD *)this + 2975) + 4 * m) = 0;
v77 = ~(1 << (m & 0x1F));
*(_DWORD *)(*((_DWORD *)this + 2997) + 4 * (m >> 5)) &= v77;
*(_DWORD *)(*((_DWORD *)this + 3012) + 4 * (m >> 5)) &= v77;
*(_DWORD *)(*(_DWORD *)v178 + 4 * (m >> 5)) &= v77;
*(_DWORD *)(*((_DWORD *)this + 3009) + 4 * (m >> 5)) &= v77;
*(_DWORD *)(*((_DWORD *)this + 2994) + 4 * (m >> 5)) &= v77;
*(_BYTE *)(*((_DWORD *)this + 3015) + m) = 0;
*(_DWORD *)(*((_DWORD *)this + 2982) + 4 * m) = 0;
v78 = (_DWORD *)(*((_DWORD *)this + 3018) + 4 * m);
*v78 = 0;
}
v79 = std::string::basic_string(&v187, *((_DWORD *)this + 352) + 372);
if ( (v187 & 1) != 0 )
v80 = v188;
else
v80 = (int)(unsigned __int8)v187 >> 1;
if ( v80 )
{
v83 = (cocos2d::CCArray *)cocos2d::CCArray::create((cocos2d::CCArray *)v79);
v84 = (unsigned __int8)v187;
v85 = v83;
if ( (v187 & 1) != 0 )
{
v86 = v188;
v87 = v189;
if ( !v188 )
{
v90 = -1;
LABEL_44:
v91 = v188;
LABEL_48:
v92 = 0;
while ( 1 )
{
v177 = &v187;
std::string::basic_string(v198, (unsigned __int8 *)&v187, v92, v90 - v92);
if ( (v198[0] & 1) != 0 )
{
if ( v198[1] || v92 != v91 )
{
v93 = (const char *)v198[2];
LABEL_58:
memset(v199, 0, sizeof(v199));
v94 = strlen(v93);
std::string::__init(v199, v93, v94);
v95 = (cocos2d::CCObject *)cocos2d::CCString::create(v199);
cocos2d::CCArray::addObject(v85, v95);
std::string::~string((int)v199);
}
}
else if ( LOBYTE(v198[0]) >> 1 || v92 != v91 )
{
v93 = (char *)v198 + 1;
goto LABEL_58;
}
if ( v90 == -1 )
{
std::string::~string((int)v198);
for ( n = 0; n < cocos2d::CCArray::count(v85); ++n )
{
v101 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v85, n);
v102 = cocos2d::CCString::intValue(v101);
if ( v102 - 1 <= 0x270E )
{
v103 = v102 >> 5;
v104 = 1 << (v102 & 0x1F);
v105 = *(_DWORD *)(*(_DWORD *)v178 + 4 * (v102 >> 5));
if ( (v105 & v104) == 0 )
{
*(_DWORD *)(*(_DWORD *)v178 + 4 * v103) = v104 | v105;
++*((_DWORD *)this + 3003);
}
}
}
goto LABEL_34;
}
v92 = v90 + 1;
if ( (v187 & 1) != 0 )
{
v96 = v189;
v97 = v188;
}
else
{
v97 = (int)(unsigned __int8)v187 >> 1;
v96 = (unsigned __int8 *)&v187 + 1;
}
if ( v92 >= v97
|| (v98 = &v96[v97],
first_of = std::__find_first_of_ce(
&v96[v92],
&v96[v97],
(int)",",
(int)"",
(int (__fastcall *)(_DWORD, int))std::char_traits::eq),
first_of == v98) )
{
v90 = -1;
}
else
{
v90 = first_of - v96;
}
std::string::~string((int)v198);
}
}
}
else
{
v86 = (int)(unsigned __int8)v187 >> 1;
if ( !v86 )
{
v90 = -1;
goto LABEL_47;
}
v87 = (unsigned __int8 *)&v187 + 1;
}
v88 = &v87[v86];
v89 = std::__find_first_of_ce(
v87,
&v87[v86],
(int)",",
(int)"",
(int (__fastcall *)(_DWORD, int))std::char_traits::eq);
v130 = v89 == v88;
v84 = (unsigned __int8)v187;
if ( v130 )
v90 = -1;
else
v90 = v89 - v87;
if ( (v187 & 1) != 0 )
goto LABEL_44;
LABEL_47:
v91 = v84 >> 1;
goto LABEL_48;
}
LABEL_34:
v81 = *((_DWORD *)this + 3004);
v82 = (*((_DWORD *)this + 3005) - v81) >> 3;
if ( v82 > 9 )
{
if ( v82 != 10 )
{
v108 = v81 + 80;
for ( ii = (_DWORD *)((char *)this + 12020); v108 != *ii; *ii -= 8 )
;
}
}
else
{
std::vector::__append((int)this + 12016, 10 - v82);
}
v106 = *((_DWORD *)this + 3004);
for ( jj = (*((_DWORD *)this + 3005) - v106) >> 3; jj > 0; --jj )
{
cocos2d::CCPoint::operator=(v106, &flt_D2B8B8);
v106 += 8;
}
std::string::basic_string(v190, *((_DWORD *)this + 352) + 384);
if ( (v190[0] & 1) != 0 )
v110 = v190[1];
else
v110 = (int)LOBYTE(v190[0]) >> 1;
if ( v110 )
{
v191 = nullptr;
v192 = 0;
v193 = 0;
sub_469BE4((unsigned __int8 *)v190, ",", (int *)&v191);
for ( kk = 0; ; kk += 2 )
{
v112 = v191;
if ( kk >= -1431655765 * ((v192 - (int)v191) >> 2) - 1 || kk == 20 )
break;
v170 = (char *)v191 + 12 * kk;
if ( (*v170 & 1) != 0 )
v171 = *((const char **)v170 + 2);
else
v171 = v170 + 1;
v172 = atoi(v171);
v173 = (char *)v112 + 12 * kk + 12;
if ( (*v173 & 1) != 0 )
v174 = *((const char **)v173 + 2);
else
v174 = v173 + 1;
v175 = atoi(v174);
v176 = *((_DWORD *)this + 3004) + 4 * kk;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v185, (float)v172, (float)v175);
cocos2d::CCPoint::operator=(v176, v185);
}
std::__vector_base::~__vector_base((int)&v191);
}
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v191, (const cocos2d::CCPoint *)(*((_DWORD *)this + 352) + 396));
cocos2d::CCPoint::operator=((char *)this + 12028, &v191);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v191, (const cocos2d::CCPoint *)&flt_D2B8B8);
v113 = OBB2D::create((const cocos2d::CCPoint *)&v191, 1.0, 1.0, 0.0);
*((_DWORD *)this + 2958) = v113;
v114 = (cocos2d::CCDirector *)cocos2d::CCObject::retain((cocos2d::CCObject *)v113);
cocos2d::CCDirector::sharedDirector(v114);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v182);
GJBaseGameLayer::setupLayers(this);
v116 = DrawGridLayer::create(*((DrawGridLayer **)this + 609), this, v115);
*((_DWORD *)this + 2970) = v116;
v117 = *((_DWORD *)this + 609);
v118 = *(int (__fastcall **)(int, cocos2d::CCLayer *, int, int, int *))(*(_DWORD *)v117 + 232);
v119 = (GameManager *)GameManager::sharedState(v116);
v120 = GameManager::getGameVariable(v119, "0039");
v121 = -1599;
if ( v120 )
v121 = 1399;
v122 = (cocos2d::CCDrawNode *)v118(v117, v116, v121, 1399, v177);
v123 = cocos2d::CCDrawNode::create(v122);
*((_DWORD *)this + 2894) = v123;
v183[0] = 770;
v183[1] = 771;
cocos2d::CCDrawNode::setBlendFunc(v123, v183);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 2894) + 36))(*((_DWORD *)this + 2894), -9999);
v124 = (cocos2d::CCDrawNode *)(*(int (__fastcall **)(_DWORD, _DWORD, int))(**((_DWORD **)this + 611) + 232))(
*((_DWORD *)this + 611),
*((_DWORD *)this + 2894),
1401);
v125 = cocos2d::CCDrawNode::create(v124);
*((_DWORD *)this + 2895) = v125;
cocos2d::CCDrawNode::setBlendFunc(v125, v183);
(*(void (__fastcall **)(_DWORD, _DWORD))(**((_DWORD **)this + 2894) + 228))(
*((_DWORD *)this + 2894),
*((_DWORD *)this + 2895));
GJBaseGameLayer::createPlayer(this);
v127 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"d_cross_01_001.png", v126);
*((_DWORD *)this + 2961) = v127;
(*(void (__fastcall **)(_DWORD, int, int))(**((_DWORD **)this + 429) + 232))(*((_DWORD *)this + 429), v127, 10);
(*(void (__fastcall **)(_DWORD, void *))(**((_DWORD **)this + 2961) + 480))(*((_DWORD *)this + 2961), &unk_BEBCCC);
(*(void (__fastcall **)(_DWORD, _DWORD))(**((_DWORD **)this + 2961) + 172))(*((_DWORD *)this + 2961), 0);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 2961) + 80))(*((_DWORD *)this + 2961), 1060320051);
GJBaseGameLayer::createPlayerCollisionBlock(this);
*((_BYTE *)this + 11716) = 1;
LevelEditorLayer::removePlayerCollisionBlock((int)this);
std::string::basic_string(v194, *((_DWORD *)this + 352) + 304);
cocos2d::ZipUtils::decompressString(&v195, v194, 0, 11);
v129 = (_BYTE *)(&stru_2E6C + 4);
v131 = *((_BYTE *)this + 11888) & 1;
v130 = v131 == 0;
if ( (*((_BYTE *)this + 11888) & 1) != 0 )
v129 = *((_BYTE **)this + 2974);
else
v128 = 11889;
if ( (*((_BYTE *)this + 11888) & 1) != 0 )
{
v131 = 0;
}
else
{
*((_BYTE *)this + v128) = v131;
v129[(_DWORD)this] = v131;
}
if ( !v130 )
{
*v129 = v131;
*((_DWORD *)this + 2973) = v131;
}
std::string::reserve((int *)this + 2972, 0);
v132 = v196;
v133 = v197;
*((_DWORD *)this + 2972) = v195;
*((_DWORD *)this + 2973) = v132;
*((_DWORD *)this + 2974) = v133;
v195 = 0;
v196 = 0;
v197 = 0;
std::string::~string((int)&v195);
std::string::~string((int)v194);
LevelEditorLayer::createObjectsFromSetup((int)this, (int)this + 11888);
GJBaseGameLayer::createTextLayers(this);
v134 = (LevelSettingsObject *)GJBaseGameLayer::increaseBatchNodeCapacity(this);
if ( !*((_DWORD *)this + 521) )
{
v140 = LevelSettingsObject::create(v134);
v141 = *((_DWORD *)this + 352);
*((_DWORD *)this + 521) = v140;
*((_DWORD *)v140 + 80) = v141;
cocos2d::CCObject::retain(*((cocos2d::CCObject **)this + 521));
GJBaseGameLayer::loadLevelSettings(this);
}
ColorAction = GJEffectManager::getColorAction(*(GJEffectManager **)(*((_DWORD *)this + 521) + 264), 1005);
*(_DWORD *)(ColorAction + 76) = 0;
v136 = *((_BYTE **)this + 519);
v137 = v136[2106];
v138 = v136[2107];
LOBYTE(v136) = v136[2108];
*(_BYTE *)(ColorAction + 68) = v137;
*(_BYTE *)(ColorAction + 69) = v138;
*(_BYTE *)(ColorAction + 70) = (_BYTE)v136;
*(_BYTE *)(ColorAction + 80) = 1;
v139 = GJEffectManager::getColorAction(*(GJEffectManager **)(*((_DWORD *)this + 521) + 264), 1006);
*(_DWORD *)(v139 + 76) = 0;
v142 = *((unsigned __int8 **)this + 519);
v143 = (LevelEditorLayer *)v142[2109];
v144 = v142[2110];
LOBYTE(v142) = v142[2111];
*(_BYTE *)(v139 + 68) = (_BYTE)v143;
*(_BYTE *)(v139 + 69) = v144;
*(_BYTE *)(v139 + 70) = (_BYTE)v142;
*(_BYTE *)(v139 + 80) = 1;
if ( !a3 )
{
v145 = EditorUI::create(this, v143);
*((_DWORD *)this + 2964) = v145;
(*(void (__fastcall **)(LevelEditorLayer *, int, int))(*(_DWORD *)this + 232))(this, v145, 100);
}
GJBaseGameLayer::createGroundLayer(
this,
*(_DWORD *)(*((_DWORD *)this + 521) + 296),
*(_DWORD *)(*((_DWORD *)this + 521) + 344));
*((_BYTE *)this + 11812) = 1;
GJBaseGameLayer::createBackground(this, *(_DWORD *)(*((_DWORD *)this + 521) + 292));
GJBaseGameLayer::createMiddleground(this, *(_DWORD *)(*((_DWORD *)this + 521) + 304));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v184, (const cocos2d::CCPoint *)(*((_DWORD *)this + 352) + 928));
if ( v184[0] == flt_D2B8B8 )
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v185, (const cocos2d::CCPoint *)(*((_DWORD *)this + 352) + 928));
v146 = v186 != flt_D2B8BC;
}
else
{
v146 = (_BOOL4)v180;
}
if ( v146 )
{
v147 = *((_DWORD *)this + 609);
v148 = *(void (__fastcall **)(int, int (__fastcall **)(LevelEditorLayer *, float)))(*(_DWORD *)v147 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v191, (GJGameLevel *)((char *)a2 + 928));
v148(v147, &v191);
v149 = *((EditorUI **)this + 2964);
if ( v149 )
EditorUI::updateSlider(v149);
}
if ( *(float *)(*((_DWORD *)this + 352) + 936) != 0.0 )
{
(*(void (__fastcall **)(_DWORD, _DWORD))(**((_DWORD **)this + 609) + 80))(
*((_DWORD *)this + 609),
*(_DWORD *)(*((_DWORD *)this + 352) + 936));
v150 = *((EditorUI **)this + 2964);
if ( v150 )
EditorUI::updateSlider(v150);
}
v151 = *((_DWORD *)this + 522);
if ( v151 )
{
v152 = *(_DWORD **)(v151 + 52);
if ( *v152 )
{
v153 = (LabelGameObject **)v152[3];
v154 = &v153[*v152] + 0x3FFFFFFF;
while ( v153 <= v154 )
{
v156 = *v153++;
v155 = v156;
if ( !v156 )
break;
if ( *((_DWORD *)v155 + 223) == 1615 )
GJBaseGameLayer::addObjectCounter(this, v155);
}
}
}
GJBaseGameLayer::resetGroupCounters(this, 0);
GJBaseGameLayer::sortStickyGroups(this);
(*(void (__fastcall **)(LevelEditorLayer *))(*(_DWORD *)this + 808))(this);
v157 = *((_DWORD *)this + 617);
if ( v157 )
{
v158 = *(int **)(v157 + 52);
v159 = *v158;
if ( *v158 )
{
v160 = (int *)v158[3];
v161 = &v160[v159 - 1];
while ( v160 <= v161 )
{
v163 = *v160++;
v162 = v163;
if ( !v163 )
break;
*(_BYTE *)(v162 + 284) = 1;
}
}
}
memcpy((char *)this + 12104, (const void *)(*((_DWORD *)this + 352) + 488), 0x64u);
*((_DWORD *)this + 3050) = -1;
if ( !a3 )
{
++*((_DWORD *)this + 3036);
if ( !*((_QWORD *)this + 1519) )
*((_QWORD *)this + 1519) = time(nullptr);
}
v191 = LevelEditorLayer::updateEditor;
v192 = 0;
cocos2d::CCNode::schedule(this, LevelEditorLayer::updateEditor, 0);
*((_BYTE *)this + 11885) = 1;
LevelEditorLayer::updateGameObjects(this);
LevelEditorLayer::updateEditorMode(this);
GJBaseGameLayer::refreshKeyframeAnims(this);
updated = (GameManager *)LevelEditorLayer::updateAnimateOnTriggerObjects((int)this, 1);
*((_BYTE *)this + 11824) = 0;
v165 = (GameManager *)GameManager::sharedState(updated);
v166 = GameManager::getGameVariable(v165, "0037");
v167 = (EditorSFXManager *)LevelEditorLayer::toggleGround(this, v166);
if ( !a3 && (LevelEditorLayer::s_showLocalDeaths || LevelEditorLayer::s_showGlobalDeaths) )
v167 = LevelEditorLayer::rebuildDeathOverlay(this);
*((_DWORD *)this + 2697) = 1065353216;
v168 = (EditorSFXManager *)EditorSFXManager::sharedState(v167);
EditorSFXManager::setEditorLoading(v168, 0);
std::string::~string((int)v190);
std::string::~string((int)&v187);
return v180;
}