//
// PlayLayer::setupHasCompleted from 0x140504710 to 0x140505bb2 (5282 bytes)
//
// 2 xrefs:
// > PlayLayer::processCreateObjectsFromSetup @ 0x14050c138
// > ??> @ 0x14092a878
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// 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:33:26 +0000
//
// Hidden C++ exception states: #wind=19
void __fastcall PlayLayer::setupHasCompleted(__int64 a1)
{
__int64 v2; // rax
__int64 v3; // rdi
unsigned int *v4; // rdi
__int64 v5; // rax
__int64 *v6; // rdi
__int64 *i; // r14
__int64 v8; // rbx
_QWORD *v9; // rcx
_BYTE *v10; // rdx
signed int v11; // ebx
struct cocos2d::CCObject *v12; // rax
struct cocos2d::CCObject *v13; // rdi
cocos2d::CCObject *v14; // rcx
_QWORD *v15; // rcx
__int64 v16; // rcx
void **v17; // r8
void *v18; // rdx
unsigned __int64 v19; // rcx
__int64 v20; // rdx
int v21; // r8d
int v22; // eax
__int64 v23; // rcx
__int64 v24; // rax
__int64 v25; // rdx
__int64 v26; // rax
cocos2d::CCObject *v27; // rbx
__int64 v28; // rdi
char *v29; // rbx
char *ColorSprite; // rax
__int64 v31; // rcx
__int64 v32; // rdi
char *v33; // rbx
char *v34; // rax
__int64 v35; // rcx
_DWORD *v36; // r14
int v37; // eax
int v38; // r15d
int v39; // edx
cocos2d::CCString *v40; // rax
const char *CString; // rbx
__int64 v42; // rcx
cocos2d::CCTextureCache *v43; // rax
cocos2d::CCString *v44; // rax
const char *v45; // rbx
__int64 v46; // rcx
cocos2d::CCTextureCache *v47; // rax
cocos2d::CCString *v48; // rax
const char *v49; // rbx
__int64 v50; // rdx
__int64 v51; // rcx
cocos2d::CCSpriteFrameCache *v52; // rax
int v53; // edx
__int64 v54; // rax
int v55; // edx
float v56; // xmm8_4
_QWORD *AudioFileName; // rbx
__int64 v58; // rcx
unsigned int v59; // edi
__int64 v60; // rax
__int64 v61; // rbx
struct cocos2d::CCObject *SongInfoObject; // rax
void *AudioString; // rdi
cocos2d::CCLayerColor *v64; // rbx
_QWORD *v65; // rax
__int64 v66; // rcx
__int64 v67; // rbx
int v68; // eax
int v69; // ebx
cocos2d::CCString *v70; // rax
const char *v71; // rax
struct cocos2d::CCLabelBMFont *v72; // rax
struct cocos2d::CCLabelBMFont *v73; // rax
__int64 v74; // rdi
__int64 v75; // rbx
__int64 v76; // rax
__int64 v77; // rax
__int64 v78; // rbx
__int64 v79; // rax
__int64 v80; // rdx
__int64 v81; // rbx
struct cocos2d::CCFiniteTimeAction *v82; // rax
struct cocos2d::CCAction *v83; // rax
struct cocos2d::CCSprite *v84; // rax
struct cocos2d::CCSprite *v85; // rax
cocos2d::CCTexture2D *v86; // rax
__int64 v87; // rcx
size_t v88; // r14
__int64 v89; // rdi
__int64 v90; // rbx
__int64 v91; // rax
__int64 v92; // rdi
__int64 v93; // rbx
__int64 v94; // rax
__int64 v95; // rdi
__int64 v96; // rbx
__int64 v97; // rax
struct cocos2d::CCLabelBMFont *v98; // rax
__int64 v99; // rdi
__int64 v100; // rbx
__int64 v101; // rax
__int64 v102; // rdi
__int64 v103; // rbx
__int64 v104; // rax
__int64 v105; // rdx
__int64 v106; // rax
__int64 v107; // rdx
__int64 v108; // rax
__int64 v109; // rdx
__int64 v110; // rcx
__int64 v111; // rax
_QWORD *v112; // rax
char *v113; // rax
__int64 v114; // rcx
void **v115; // r12
void **v116; // r15
unsigned __int64 v117; // r13
__int64 v118; // r14
unsigned __int64 v119; // rbx
unsigned __int64 v120; // rdi
void **v121; // rdi
__int64 v122; // rdi
__int64 v123; // rbx
const struct cocos2d::CCPoint *v124; // rax
__int64 v125; // rax
__int64 v126; // rdi
__int64 v127; // rbx
__int64 v128; // rax
__int64 v129; // rdx
__int64 (__fastcall *v130)(); // rdx
__int64 v131; // rbx
struct cocos2d::CCFiniteTimeAction *v132; // rax
struct cocos2d::CCAction *v133; // rax
void **v134; // rax
__int64 v135[2]; // [rsp+58h] [rbp-B0h] BYREF
void *v136; // [rsp+68h] [rbp-A0h] BYREF
float v137; // [rsp+70h] [rbp-98h] BYREF
float v138; // [rsp+74h] [rbp-94h]
__int128 v139; // [rsp+78h] [rbp-90h] BYREF
unsigned __int64 v140; // [rsp+88h] [rbp-80h]
__int64 v141; // [rsp+90h] [rbp-78h]
void *Src[2]; // [rsp+98h] [rbp-70h] BYREF
unsigned __int64 v143; // [rsp+A8h] [rbp-60h]
unsigned __int64 v144; // [rsp+B0h] [rbp-58h]
_DWORD v145[4]; // [rsp+B8h] [rbp-50h] BYREF
void *v146[4]; // [rsp+C8h] [rbp-40h] BYREF
v2 = cocos2d::CCDirector::sharedDirector(a1);
cocos2d::CCDirector::getWinSize(v2, &v137);
GJBaseGameLayer::createTextLayers(a1);
GJBaseGameLayer::updateSpecialGroupData(a1);
PlayLayer::optimizeColorGroups(a1);
PlayLayer::optimizeOpacityGroups(a1);
PlayLayer::scanDynamicSaveObjects(a1);
v3 = *(_QWORD *)(a1 + 3536);
if ( v3 )
{
v4 = *(unsigned int **)(v3 + 56);
v5 = *v4;
if ( (_DWORD)v5 )
{
v6 = *((__int64 **)v4 + 2);
for ( i = &v6[v5 - 1]; v6 <= i; ++v6 )
{
v8 = *v6;
if ( !*v6 )
break;
if ( (*(unsigned __int8 (__fastcall **)(__int64))(*(_QWORD *)v8 + 1480LL))(*v6) )
{
if ( !(*(unsigned __int8 (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v8 + 1592LL))(
v8,
*(unsigned __int8 *)(a1 + 12670)) )
{
v135[0] = v8;
v9 = (_QWORD *)(a1 + 14752);
v10 = *(_BYTE **)(a1 + 14760);
if ( v10 == *(_BYTE **)(a1 + 14768) )
goto LABEL_14;
*(_QWORD *)v10 = v8;
*(_QWORD *)(a1 + 14760) += 8LL;
}
}
else
{
if ( *(_DWORD *)(v8 + 1256) != 2 || !*(_BYTE *)(v8 + 1544) )
continue;
v135[0] = v8;
v9 = (_QWORD *)(a1 + 14776);
v10 = *(_BYTE **)(a1 + 14784);
if ( v10 == *(_BYTE **)(a1 + 14792) )
{
LABEL_14:
sub_1400699B0(v9, v10, v135);
continue;
}
*(_QWORD *)v10 = v8;
*(_QWORD *)(a1 + 14784) += 8LL;
}
}
}
}
GJBaseGameLayer::sortStartPosObjects(a1);
if ( *(_DWORD *)(*(_QWORD *)(a1 + 2168) + 1220LL) == 2 )
{
v11 = cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 12920)) - 1;
if ( v11 >= 0 )
{
while ( 1 )
{
v12 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 12920), v11);
v13 = v12;
if ( !*(_BYTE *)(*((_QWORD *)v12 + 232) + 472LL) )
break;
if ( --v11 < 0 )
goto LABEL_25;
}
if ( *(struct cocos2d::CCObject **)(a1 + 12912) != v12 )
{
cocos2d::CCObject::retain(v12);
v14 = *(cocos2d::CCObject **)(a1 + 12912);
if ( v14 )
cocos2d::CCObject::release(v14);
*(_QWORD *)(a1 + 12912) = v13;
*(_BYTE *)(a1 + 13096) = v13 != nullptr;
}
}
}
LABEL_25:
v15 = *(_QWORD **)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v135[0] = (__int64)operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager(v135[0]);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v15 = *(_QWORD **)&qword_14090BFB0;
}
GameLevelManager::getDeathDisplayData(
v15,
(__int64)v146,
*(_DWORD *)(*(_QWORD *)(a1 + 2168) + 328LL) - *(_DWORD *)(*(_QWORD *)(a1 + 2168) + 332LL));
if ( !v146[2] )
{
v17 = (void **)(*(_QWORD *)(a1 + 2168) + 1992LL);
if ( v146 != v17 )
{
v18 = (void *)(*(_QWORD *)(a1 + 2168) + 1992LL);
if ( *(_QWORD *)(*(_QWORD *)(a1 + 2168) + 2016LL) > 0xFu )
v18 = *v17;
sub_1400405A0(v146, v18, *(_QWORD *)(*(_QWORD *)(a1 + 2168) + 2008LL));
}
}
*(_BYTE *)(a1 + 2201) = GJGameLevel::dtParseGlobalBlob(v16, (const void **)v146, (_QWORD *)(a1 + 15072));
*(_DWORD *)(a1 + 15144) = 0;
v19 = 2;
v20 = *(_QWORD *)(a1 + 15072);
if ( (unsigned __int64)((*(_QWORD *)(a1 + 15080) - v20) >> 2) > 2 )
{
v21 = 0;
do
{
v22 = *(_DWORD *)(v20 + 4 * v19);
if ( v22 > v21 )
{
v21 = *(_DWORD *)(v20 + 4 * v19);
*(_DWORD *)(a1 + 15144) = v22;
}
v19 += 9LL;
}
while ( v19 < (*(_QWORD *)(a1 + 15080) - v20) >> 2 );
}
sub_14003D310((__int64)v146);
v24 = *(_QWORD *)(a1 + 15096);
if ( v24 != *(_QWORD *)(a1 + 15104) )
*(_QWORD *)(a1 + 15104) = v24;
*(_BYTE *)(a1 + 15120) = 0;
v25 = *(_QWORD *)(a1 + 2168);
if ( v25 )
GJGameLevel::scoreStringToVector(v23, (size_t *)(v25 + 1944), a1 + 15096);
PlayLayer::dtLiveMarkersChanged(a1);
sub_14003F4F0((__int64)Src, *(_QWORD *)(a1 + 2168) + 1264LL);
GJBaseGameLayer::updateLayerCapacity(a1, (__int64 *)Src);
GJBaseGameLayer::increaseBatchNodeCapacity(a1);
if ( !*(_QWORD *)(a1 + 3528) )
{
v135[0] = (__int64)operator new(0x2D8u);
v26 = sub_1403ECAC0(v135[0]);
v27 = (cocos2d::CCObject *)v26;
if ( v26 )
{
if ( (*(unsigned __int8 (__fastcall **)(__int64))(*(_QWORD *)v26 + 72LL))(v26) )
{
cocos2d::CCObject::autorelease(v27);
}
else
{
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v27 + 8LL))(v27, 1);
v27 = nullptr;
}
}
*(_QWORD *)(a1 + 3528) = v27;
*((_QWORD *)v27 + 48) = *(_QWORD *)(a1 + 2168);
cocos2d::CCObject::retain(*(cocos2d::CCObject **)(a1 + 3528));
}
*(_BYTE *)(*(_QWORD *)(a1 + 3512) + 2936LL) = *(_BYTE *)(a1 + 12670);
*(_BYTE *)(*(_QWORD *)(a1 + 3520) + 2936LL) = *(_BYTE *)(a1 + 12670);
v28 = *(_QWORD *)(*(_QWORD *)(a1 + 3528) + 320LL);
v29 = *(char **)(*(_QWORD *)(v28 + 736) + 8040LL);
if ( !v29 )
{
v29 = ColorAction::create();
*((_DWORD *)v29 + 23) = 1005;
cocos2d::CCDictionary::setObject(*(cocos2d::CCDictionary **)(v28 + 328), (struct cocos2d::CCObject *)v29, 1005);
*(_QWORD *)(*(_QWORD *)(v28 + 736) + 8040LL) = v29;
ColorSprite = GJEffectManager::getColorSprite(v28, 1005);
*((_QWORD *)v29 + 18) = ColorSprite;
*((_QWORD *)ColorSprite + 43) = v29;
}
*((_DWORD *)v29 + 20) = 0;
v31 = *(_QWORD *)(a1 + 3512);
*((_WORD *)v29 + 36) = *(_WORD *)(v31 + 2706);
v29[74] = *(_BYTE *)(v31 + 2708);
v29[84] = 1;
v32 = *(_QWORD *)(*(_QWORD *)(a1 + 3528) + 320LL);
v33 = *(char **)(*(_QWORD *)(v32 + 736) + 8048LL);
if ( !v33 )
{
v33 = ColorAction::create();
*((_DWORD *)v33 + 23) = 1006;
cocos2d::CCDictionary::setObject(*(cocos2d::CCDictionary **)(v32 + 328), (struct cocos2d::CCObject *)v33, 1006);
*(_QWORD *)(*(_QWORD *)(v32 + 736) + 8048LL) = v33;
v34 = GJEffectManager::getColorSprite(v32, 1006);
*((_QWORD *)v33 + 18) = v34;
*((_QWORD *)v34 + 43) = v33;
}
*((_DWORD *)v33 + 20) = 0;
v35 = *(_QWORD *)(a1 + 3512);
*((_WORD *)v33 + 36) = *(_WORD *)(v35 + 2709);
v33[74] = *(_BYTE *)(v35 + 2711);
v33[84] = 1;
v36 = (_DWORD *)qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v135[0] = (__int64)operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v135[0]);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v36 = (_DWORD *)qword_14090BFD0;
}
if ( v36[226] - v36[227] > 0 )
{
v37 = 20;
if ( v36[226] - v36[227] < 20 )
v37 = v36[226] - v36[227];
v38 = 1;
if ( v37 > 1 )
v38 = v37;
v39 = v36[257];
if ( v38 != v39 )
{
if ( v39 > 1 )
{
v40 = cocos2d::CCString::createWithFormat("PlayerExplosion_%02d.png", v39 - 1);
CString = cocos2d::CCString::getCString(v40);
v43 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache(v42);
cocos2d::CCTextureCache::removeTextureForKey(v43, CString);
}
if ( v38 > 1 )
{
v44 = cocos2d::CCString::createWithFormat("PlayerExplosion_%02d.png", v38 - 1);
v45 = cocos2d::CCString::getCString(v44);
v47 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache(v46);
cocos2d::CCTextureCache::addImage(v47, v45, 0);
v48 = cocos2d::CCString::createWithFormat("PlayerExplosion_%02d.plist", v38 - 1);
v49 = cocos2d::CCString::getCString(v48);
v52 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v51, v50);
cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile(v52, v49);
}
v36[257] = v38;
}
}
GJBaseGameLayer::createBackground(a1, *(_DWORD *)(*(_QWORD *)(a1 + 3528) + 352LL));
v53 = *(_DWORD *)(*(_QWORD *)(a1 + 3528) + 364LL);
if ( v53 > 0 )
GJBaseGameLayer::createMiddleground(a1, v53);
GJBaseGameLayer::createGroundLayer(
a1,
*(_DWORD *)(*(_QWORD *)(a1 + 3528) + 356LL),
*(_DWORD *)(*(_QWORD *)(a1 + 3528) + 432LL));
UILayer::togglePlatformerMode(*(_QWORD *)(a1 + 13888), *(unsigned __int8 *)(a1 + 12670));
v54 = *(_QWORD *)(a1 + 3512);
LOWORD(v135[0]) = *(_WORD *)(v54 + 2706);
v55 = *(unsigned __int8 *)(v54 + 2708);
*(float *)&v139 = (float)LOBYTE(v135[0]) / 255.0;
*((float *)&v139 + 1) = (float)BYTE1(v135[0]) / 255.0;
*((float *)&v139 + 2) = (float)v55 / 255.0;
v56 = 1.0;
HIDWORD(v139) = 1065353216;
(*(void (__fastcall **)(_QWORD, __int128 *))(**(_QWORD **)(a1 + 13120) + 1352LL))(*(_QWORD *)(a1 + 13120), &v139);
*(_QWORD *)&v139 = 0;
*((_QWORD *)&v139 + 1) = 0x3F80000000000000LL;
(*(void (__fastcall **)(_QWORD, __int128 *))(**(_QWORD **)(a1 + 13120) + 1384LL))(*(_QWORD *)(a1 + 13120), &v139);
GJBaseGameLayer::resetPlayer((_QWORD *)a1);
v135[0] = (__int64)Src;
AudioFileName = GJGameLevel::getAudioFileName(*(_QWORD *)(a1 + 2168), Src);
v58 = qword_14090BF60;
if ( !qword_14090BF60 )
{
v136 = operator new(0x8A8u);
qword_14090BF60 = FMODAudioEngine::FMODAudioEngine((__int64)v136);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BF60 + 72LL))(qword_14090BF60);
v58 = qword_14090BF60;
}
FMODAudioEngine::loadMusic(
v58,
(__int64)AudioFileName,
1.0,
0.0,
1065353216,
1,
0,
0,
*(_BYTE *)(*(_QWORD *)(a1 + 3528) + 350LL));
v59 = *(_DWORD *)(*(_QWORD *)(*(_QWORD *)(a1 + 3528) + 384LL) + 680LL);
if ( v59 || *(int *)(*(_QWORD *)(a1 + 2168) + 676LL) >= 20 )
{
v60 = qword_14090BF60;
if ( !qword_14090BF60 )
{
v136 = operator new(0x8A8u);
qword_14090BF60 = FMODAudioEngine::FMODAudioEngine((__int64)v136);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BF60 + 72LL))(qword_14090BF60);
v60 = qword_14090BF60;
}
*(_BYTE *)(v60 + 544) = 1;
*(_DWORD *)(v60 + 528) = 1036831949;
*(_QWORD *)(v60 + 532) = 1036831949;
*(_BYTE *)(a1 + 15064) = 1;
v61 = qword_14090C070;
if ( !qword_14090C070 )
{
v136 = operator new(0x3D0u);
qword_14090C070 = MusicDownloadManager::MusicDownloadManager((__int64)v136);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090C070 + 72LL))(qword_14090C070);
v61 = qword_14090C070;
}
SongInfoObject = MusicDownloadManager::getSongInfoObject(v61, v59);
if ( SongInfoObject )
*((_DWORD *)SongInfoObject + 119) = ++*(_DWORD *)(v61 + 360);
}
else
{
if ( !qword_14090BF60 )
{
v136 = operator new(0x8A8u);
qword_14090BF60 = FMODAudioEngine::FMODAudioEngine((__int64)v136);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BF60 + 72LL))(qword_14090BF60);
}
*(_BYTE *)(qword_14090BF60 + 544) = 0;
}
if ( !qword_14090BF60 )
{
v136 = operator new(0x8A8u);
qword_14090BF60 = FMODAudioEngine::FMODAudioEngine((__int64)v136);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BF60 + 72LL))(qword_14090BF60);
}
*(_BYTE *)(a1 + 14944) = *(float *)(qword_14090BF60 + 512) <= 0.0;
AudioString = (void *)LevelTools::getAudioString((__int64)Src, *(_DWORD *)(*(_QWORD *)(a1 + 2168) + 676LL));
v136 = AudioString;
v64 = (cocos2d::CCLayerColor *)operator new(0x250u);
v135[0] = (__int64)v64;
cocos2d::CCLayerColor::CCLayerColor(v64);
*(_QWORD *)v64 = &AudioEffectsLayer::`vftable';
*((_QWORD *)v64 + 40) = &AudioEffectsLayer::`vftable';
*((_QWORD *)v64 + 41) = &AudioEffectsLayer::`vftable';
*((_QWORD *)v64 + 42) = &AudioEffectsLayer::`vftable';
*((_QWORD *)v64 + 43) = &AudioEffectsLayer::`vftable';
*((_QWORD *)v64 + 44) = &AudioEffectsLayer::`vftable';
*((_QWORD *)v64 + 51) = &AudioEffectsLayer::`vftable';
*((_QWORD *)v64 + 54) = &AudioEffectsLayer::`vftable';
*((_QWORD *)v64 + 68) = 0;
*((_QWORD *)v64 + 69) = 0;
*((_QWORD *)v64 + 70) = 0;
*((_QWORD *)v64 + 71) = 0;
*((_BYTE *)v64 + 576) = 0;
*((_DWORD *)v64 + 145) = 0;
*((_BYTE *)v64 + 584) = 0;
v65 = (_QWORD *)sub_14003F4F0((__int64)&v139, (__int64)AudioString);
if ( AudioEffectsLayer::init(v64, v65) )
{
cocos2d::CCObject::autorelease(v64);
}
else
{
(*(void (__fastcall **)(cocos2d::CCLayerColor *, __int64))(*(_QWORD *)v64 + 8LL))(v64, 1);
v64 = nullptr;
}
sub_14003D310((__int64)AudioString);
*(_QWORD *)(a1 + 13168) = v64;
(*(void (__fastcall **)(_QWORD, cocos2d::CCLayerColor *, __int64))(**(_QWORD **)(a1 + 4296) + 456LL))(
*(_QWORD *)(a1 + 4296),
v64,
1);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 13168) + 336LL))(*(_QWORD *)(a1 + 13168), 0);
v66 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v136 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v136);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v66 = qword_14090BFD0;
}
v67 = v66;
if ( !v66 )
{
v136 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v136);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v66 = qword_14090BFD0;
}
v68 = *(_DWORD *)(v67 + 1024);
v69 = 59;
if ( v68 < 59 )
v69 = v68;
if ( v69 <= 0 )
{
GameManager::loadFont(v66, 0);
v71 = (const char *)&qword_140704F78;
}
else
{
GameManager::loadFont(v66, v69);
v70 = cocos2d::CCString::createWithFormat("gjFont%02d.fnt", v69);
v71 = cocos2d::CCString::getCString(v70);
}
v72 = cocos2d::CCLabelBMFont::create("Attempt 1", v71);
*(_QWORD *)(a1 + 14984) = v72;
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *, __int64))(**(_QWORD **)(a1 + 4296) + 456LL))(
*(_QWORD *)(a1 + 4296),
v72,
1400);
if ( *(_BYTE *)(a1 + 15056) )
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 14984) + 136LL))(*(_QWORD *)(a1 + 14984));
v73 = cocos2d::CCLabelBMFont::create(&byte_1406ED6E0, "chatFont.fnt");
*(_QWORD *)(a1 + 15440) = v73;
(*(void (__fastcall **)(__int64, struct cocos2d::CCLabelBMFont *, __int64))(*(_QWORD *)a1 + 456LL))(a1, v73, 1000);
v74 = **(_QWORD **)(a1 + 15440);
v75 = *(_QWORD *)(a1 + 15440);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v136, 0.0, 1.0);
(*(void (__fastcall **)(__int64, __int64))(v74 + 288))(v75, v76);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v136, 5.0, v138 - 10.0);
v78 = v77;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v139, 0.0, 0.0);
cocos2d::CCPoint::operator+(v79, v135, v78);
(*(void (__fastcall **)(_QWORD, __int64 *))(**(_QWORD **)(a1 + 15440) + 184LL))(*(_QWORD *)(a1 + 15440), v135);
LOBYTE(v80) = -106;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)(*(_QWORD *)(a1 + 15440) + 368LL) + 40LL))(
*(_QWORD *)(a1 + 15440) + 368LL,
v80);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 15440) + 160LL))(*(_QWORD *)(a1 + 15440));
PlayLayer::updateInfoLabel(a1);
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 1424LL))(a1);
if ( *(_BYTE *)(*(_QWORD *)(a1 + 3528) + 340LL)
&& !*(_BYTE *)(a1 + 13096)
&& *(_DWORD *)(*(_QWORD *)(a1 + 2168) + 1220LL) != 2
&& !*(_BYTE *)(a1 + 12670) )
{
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 14984) + 336LL))(*(_QWORD *)(a1 + 14984), 0);
v81 = cocos2d::CCCallFunc::create(a1, PlayLayer::showTwoPlayerGuide);
v82 = cocos2d::CCDelayTime::create(0.5);
v83 = cocos2d::CCSequence::create(v82, v81, 0);
cocos2d::CCNode::runAction((cocos2d::CCNode *)a1, v83);
v56 = 2.0;
}
*(_WORD *)(a1 + 13097) = 257;
*(_BYTE *)(a1 + 13085) = 1;
GJBaseGameLayer::updateCamera(a1, 0.0);
v84 = cocos2d::CCSprite::create("slidergroove2.png");
*(_QWORD *)(a1 + 15008) = v84;
(*(void (__fastcall **)(__int64, struct cocos2d::CCSprite *, __int64))(*(_QWORD *)a1 + 456LL))(a1, v84, 10);
v85 = cocos2d::CCSprite::create("sliderBar2.png");
*(_QWORD *)(a1 + 15016) = v85;
*(float *)(a1 + 15024) = *(float *)(*(_QWORD *)(a1 + 15008) + 432LL) - 4.0;
*(_DWORD *)(a1 + 15028) = 1090519040;
v145[0] = 9729;
v145[1] = 9729;
v145[2] = 10497;
v145[3] = 10497;
v86 = (cocos2d::CCTexture2D *)(*(__int64 (__fastcall **)(__int64))(*((_QWORD *)v85 + 43) + 16LL))((__int64)v85 + 344);
cocos2d::CCTexture2D::setTexParameters(v86, (struct cocos2d::_ccTexParams *)v145);
v87 = *(_QWORD *)(a1 + 3512);
LOWORD(v135[0]) = *(_WORD *)(v87 + 2706);
BYTE2(v135[0]) = *(_BYTE *)(v87 + 2708);
(**(void (__fastcall ***)(__int64, __int64 *))(*(_QWORD *)(a1 + 15016) + 320LL))(
*(_QWORD *)(a1 + 15016) + 320LL,
v135);
v88 = -1;
(*(void (__fastcall **)(_QWORD, _QWORD, __int64))(**(_QWORD **)(a1 + 15008) + 456LL))(
*(_QWORD *)(a1 + 15008),
*(_QWORD *)(a1 + 15016),
0xFFFFFFFFLL);
v89 = **(_QWORD **)(a1 + 15016);
v90 = *(_QWORD *)(a1 + 15016);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v139, 0.0, 0.0);
(*(void (__fastcall **)(__int64, __int64))(v89 + 288))(v90, v91);
v92 = **(_QWORD **)(a1 + 15016);
v93 = *(_QWORD *)(a1 + 15016);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v139, 2.0, 4.0);
(*(void (__fastcall **)(__int64, __int64))(v92 + 184))(v93, v94);
v95 = **(_QWORD **)(a1 + 15008);
v96 = *(_QWORD *)(a1 + 15008);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v139, v137 * 0.5, v138 - 8.0);
(*(void (__fastcall **)(__int64, __int64))(v95 + 184))(v96, v97);
v98 = cocos2d::CCLabelBMFont::create("100%", (const char *)&qword_140704F78);
*(_QWORD *)(a1 + 14992) = v98;
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v98 + 160LL))(v98);
(*(void (__fastcall **)(__int64, _QWORD, __int64))(*(_QWORD *)a1 + 456LL))(a1, *(_QWORD *)(a1 + 14992), 15);
v99 = **(_QWORD **)(a1 + 14992);
v100 = *(_QWORD *)(a1 + 14992);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v139, (float)(v137 * 0.5) + 110.0, v138 - 8.0);
(*(void (__fastcall **)(__int64, __int64))(v99 + 184))(v100, v101);
v102 = **(_QWORD **)(a1 + 14992);
v103 = *(_QWORD *)(a1 + 14992);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v139, 0.0, 0.5);
(*(void (__fastcall **)(__int64, __int64))(v102 + 288))(v103, v104);
PlayLayer::updateProgressbar(a1);
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 1416LL))(a1);
if ( *(_BYTE *)(a1 + 13096) || (v106 = *(_QWORD *)(a1 + 3528), *(_BYTE *)(v106 + 437)) || *(int *)(v106 + 452) > 0 )
{
LOBYTE(v105) = 1;
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 3512) + 336LL))(*(_QWORD *)(a1 + 3512), v105);
LOBYTE(v107) = 1;
}
else
{
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 3512) + 336LL))(*(_QWORD *)(a1 + 3512), 0);
v107 = 0;
}
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 3520) + 336LL))(*(_QWORD *)(a1 + 3520), v107);
PlayLayer::loadDefaultColors(a1);
GJBaseGameLayer::updateLevelColors((_QWORD *)a1);
v108 = *(_QWORD *)(a1 + 12912);
if ( v108 )
v109 = *(_QWORD *)(v108 + 1856);
else
v109 = *(_QWORD *)(a1 + 3528);
GJBaseGameLayer::setupLevelStart(a1, v109);
*(_BYTE *)(a1 + 12904) = 1;
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 1072LL))(a1);
GJBaseGameLayer::updateCamera(a1, 0.0);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 1136LL))(a1, 0);
v110 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
*(_QWORD *)&v139 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v139);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v110 = qword_14090BFD0;
}
*(_BYTE *)(a1 + 15432) = GameManager::getGameVariable(v110, "0072");
LODWORD(v135[0]) = 8;
v111 = ObjectToolbox::sharedState();
v112 = (_QWORD *)sub_1402D6130((__int64 *)(v111 + 320), (int *)v135);
if ( v112[3] > 0xFu )
v112 = (_QWORD *)*v112;
*(_OWORD *)Src = 0;
v143 = 0;
v144 = 0;
do
++v88;
while ( *((_BYTE *)v112 + v88) );
sub_14003D230(Src, v112, v88);
v113 = GameObject::createWithKey(8);
*(_QWORD *)(a1 + 14560) = v113;
(*(void (__fastcall **)(char *))(*(_QWORD *)v113 + 1112LL))(v113);
v139 = 0;
v140 = 0;
v141 = 0;
v115 = Src;
v116 = (void **)Src[0];
v117 = v144;
if ( v144 > 0xF )
v115 = (void **)Src[0];
v118 = 0x7FFFFFFFFFFFFFFFLL;
v119 = v143;
if ( v143 > 0x7FFFFFFFFFFFFFFFLL )
sub_140009D90(v114);
if ( v143 > 0xF )
{
v120 = v143 | 0xF;
if ( (v143 | 0xF) <= 0x7FFFFFFFFFFFFFFFLL )
{
if ( v120 < 0x16 )
v120 = 22;
}
else
{
v120 = 0x7FFFFFFFFFFFFFFFLL;
}
*(_QWORD *)&v139 = sub_14003D460(v120 + 1);
v140 = v119;
v141 = v120;
memcpy((void *)v139, v115, v119 + 1);
}
else
{
v140 = v143;
v141 = 15;
v139 = *(_OWORD *)v115;
}
GameObject::addColorSprite(*(_QWORD *)(a1 + 14560), (__int64)&v139);
v139 = 0;
v140 = 0;
v141 = 0;
v121 = Src;
if ( v117 > 0xF )
v121 = v116;
if ( v119 > 0xF )
{
if ( (v119 | 0xF) <= 0x7FFFFFFFFFFFFFFFLL )
{
v118 = v119 | 0xF;
if ( (v119 | 0xF) < 0x16 )
v118 = 22;
}
*(_QWORD *)&v139 = sub_14003D460(v118 + 1);
v140 = v119;
v141 = v118;
memcpy((void *)v139, v121, v119 + 1);
}
else
{
v140 = v119;
v141 = 15;
v139 = *(_OWORD *)v121;
}
(*(void (__fastcall **)(_QWORD, __int128 *))(**(_QWORD **)(a1 + 14560) + 1120LL))(*(_QWORD *)(a1 + 14560), &v139);
v122 = **(_QWORD **)(a1 + 14560);
v123 = *(_QWORD *)(a1 + 14560);
v124 = (const struct cocos2d::CCPoint *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 3512) + 200LL))(*(_QWORD *)(a1 + 3512));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v139, v124);
(*(void (__fastcall **)(__int64, __int64))(v122 + 1216))(v123, v125);
*(_BYTE *)(*(_QWORD *)(a1 + 14560) + 559LL) = 1;
PlayLayer::addObject(a1, *(_QWORD *)(a1 + 14560));
GJBaseGameLayer::createPlayerCollisionBlock(a1);
v126 = **(_QWORD **)(a1 + 14984);
v127 = *(_QWORD *)(a1 + 14984);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v139,
(float)(v137 * 0.5) + *(float *)(a1 + 1040),
(float)((float)(v138 * 0.5) + *(float *)(a1 + 1044)) + 85.0);
(*(void (__fastcall **)(__int64, __int64))(v126 + 184))(v127, v128);
if ( *(_BYTE *)(a1 + 13096) )
{
LOBYTE(v129) = 50;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)(*(_QWORD *)(a1 + 14984) + 368LL) + 40LL))(
*(_QWORD *)(a1 + 14984) + 368LL,
v129);
}
*(_BYTE *)(a1 + 13097) = 1;
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 1456LL))(a1);
*(_BYTE *)(a1 + 13144) = 0;
PlayLayer::prepareMusic(a1);
v130 = PlayLayer::startGame;
if ( !*(_BYTE *)(a1 + 14720) )
v130 = (__int64 (__fastcall *)())PlayLayer::onQuit;
v131 = cocos2d::CCCallFunc::create(a1, v130);
v132 = cocos2d::CCDelayTime::create(v56);
v133 = cocos2d::CCSequence::create(v132, v131, 0);
cocos2d::CCNode::runAction((cocos2d::CCNode *)a1, v133);
cocos2d::CCNode::scheduleUpdate((cocos2d::CCNode *)a1);
GJBaseGameLayer::checkSpawnObjects(a1);
GJEffectManager::updateEffects(*(_QWORD **)(a1 + 2408), 0.0);
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 1072LL))(a1);
GJBaseGameLayer::updateLevelColors((_QWORD *)a1);
GJBaseGameLayer::updateProximityVolumeEffects(a1);
PlayLayer::updateTestModeLabel(a1);
if ( GJBaseGameLayer::shouldExitHackedLevel(a1) )
{
PlayLayer::removeAllObjects(a1);
PlayLayer::onQuit(a1);
}
if ( v117 > 0xF )
{
v134 = v116;
if ( v117 + 1 >= 0x1000 )
{
v116 = (void **)*(v116 - 1);
if ( (unsigned __int64)((char *)v134 - (char *)v116 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v116);
}
}