//
// PlayLayer::setupHasCompleted from 0x5dc284 to 0x5dd060 (3548 bytes)
//
// 2 xrefs:
// > PlayLayer::processCreateObjectsFromSetup @ 0x5dd9f4
// > ??> @ 0x63678
//
// 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 PlayLayer::setupHasCompleted(PlayLayer *a1)
{
cocos2d::CCDirector *v2; // x0
void *v3; // x0
LevelSettingsObject *m_levelSettings; // x0
PlayerObject *m_player2; // x2
GJEffectManager *m_effectManager; // x0
ColorAction *ColorAction; // x0
PlayerObject *m_player1; // x2
GLubyte r; // w4
GLubyte g; // w3
ColorAction *v11; // x0
PlayerObject *v12; // x1
GLubyte v13; // w3
GLubyte v14; // w2
GameManager *v15; // x0
GameManager *v16; // x20
GameManager *v17; // x0
LevelSettingsObject *v18; // x3
int m_middleGroundIndex; // w1
PlayerObject *v20; // x4
cocos2d::CCParticleSystemQuad *m_glitterParticles; // x0
int v22; // w20
float b; // s3
void (__fastcall *setStartColor)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // x2
GLuint v25; // s4
cocos2d::CCParticleSystemQuad *v26; // x0
void (__fastcall *setEndColor)(cocos2d::CCParticleSystem *__hidden, const cocos2d::ccColor4F *); // x2
FMODAudioEngine *v28; // x20
void *v29; // x0
FMODAudioEngine *v30; // x0
MusicDownloadManager *v31; // x0
FMODAudioEngine *v32; // x0
float BackgroundMusicVolume; // s0
LevelTools *m_audioTrack; // x0
_BOOL4 v35; // w1
void *v36; // x0
GameManager *v37; // x25
GameManager *v38; // x0
cocos2d::CCLabelBMFont *v39; // x0
cocos2d::CCLabelBMFont *v40; // x0
cocos2d::CCLabelBMFont *m_infoLabel; // x26
void (__fastcall *setAnchorPoint)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // x27
cocos2d::CCLabelBMFont *v43; // x26
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x27
float v45; // s10
const char *v46; // x1
cocos2d::CCSprite *v47; // x0
const char *v48; // x1
cocos2d::CCSprite *v49; // x0
cocos2d::CCSprite_vtbl *v50; // x3
cocos2d::CCSprite *m_progressBar; // x4
float width; // s0
__int64 (*getTexture)(void); // x2
cocos2d::CCTexture2D *v54; // x0
PlayerObject *v55; // x2
cocos2d::CCSprite *m_progressFill; // x0
GLubyte v57; // w5
GLubyte v58; // w4
void (__fastcall *setColor)(cocos2d::CCSprite *__hidden, const cocos2d::ccColor3B *); // x3
cocos2d::CCSprite *v60; // x22
void (__fastcall *v61)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x26
cocos2d::CCSprite *v62; // x22
void (__fastcall *v63)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x26
cocos2d::CCSprite *v64; // x22
void (__fastcall *v65)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x26
cocos2d::CCLabelBMFont *v66; // x0
cocos2d::CCLabelBMFont_vtbl *v67; // x1
cocos2d::CCLabelBMFont *m_percentageLabel; // x22
void (__fastcall *v69)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x26
cocos2d::CCLabelBMFont *v70; // x22
void (__fastcall *v71)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // x26
LevelSettingsObject *v72; // x0
StartPosObject *m_startPosObject; // x0
LevelSettingsObject *m_startSettings; // x1
PlayLayer_vtbl *v75; // x1
GameManager *v76; // x0
ObjectToolbox *v77; // x0
char *v78; // x0
GameObject *v79; // x0
GameObject_vtbl *v80; // x1
GameObject *m_anticheatSpike; // x26
void *v82; // x0
GameObject *v83; // x26
void (__fastcall *setupCustomSprites)(GameObject *__hidden, std::string); // x22
long double v85; // q0
void *v86; // x0
GameObject *v87; // x22
void (__fastcall *setStartPos)(GameObject *__hidden, cocos2d::CCPoint); // x25
const cocos2d::CCPoint *v89; // x0
GameObject *v90; // x1
cocos2d::CCLabelBMFont *m_attemptLabel; // x22
void (__fastcall *v92)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x25
PlayLayer_vtbl *v93; // x1
cocos2d::CCSequence *v94; // x21
cocos2d::CCFiniteTimeAction *v95; // x0
cocos2d::CCAction *v96; // x0
__int64 v97; // x19
void *v98; // x21
FMODAudioEngine *v99; // x0
cocos2d::CCSequence *v100; // x26
cocos2d::CCFiniteTimeAction *v101; // x0
cocos2d::CCAction *v102; // x0
unsigned int *v103; // x19
int v104; // w0
unsigned int *v105; // x1
int v106; // w2
unsigned int *v107; // x1
int v108; // w2
unsigned int *v109; // x1
int v110; // w2
unsigned int *v111; // x1
int v112; // w2
unsigned int *v113; // x2
int v114; // w1
LevelSettingsObject *v115; // x0
__int64 v116; // [xsp+0h] [xbp+0h] BYREF
int v117[2]; // [xsp+88h] [xbp+88h]
float v118; // [xsp+98h] [xbp+98h]
float v119; // [xsp+9Ch] [xbp+9Ch]
__int64 v120; // [xsp+A0h] [xbp+A0h] BYREF
cocos2d::CCPoint v121; // [xsp+A8h] [xbp+A8h] BYREF
cocos2d::CCPoint v122; // [xsp+B0h] [xbp+B0h] BYREF
cocos2d::ccTexParams v123; // [xsp+B8h] [xbp+B8h] BYREF
std::string v124; // 0:x1.8
v2 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v2);
GJBaseGameLayer::createTextLayers(a1);
GJBaseGameLayer::updateSpecialGroupData(a1);
PlayLayer::optimizeColorGroups(a1);
PlayLayer::optimizeOpacityGroups(a1);
PlayLayer::scanDynamicSaveObjects(a1);
PlayLayer::scanActiveSaveObjects(a1);
sub_D18D28(&v123, &a1->m_level->m_capacityString);
GJBaseGameLayer::updateLayerCapacity((int)a1, (int)&v123);
v3 = (void *)(*(_QWORD *)&v123.minFilter - 24LL);
if ( (__int64 *)(*(_QWORD *)&v123.minFilter - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v109 = (unsigned int *)(*(_QWORD *)&v123.minFilter - 8LL);
do
v110 = __ldaxr(v109);
while ( __stlxr(v110 - 1, v109) );
}
else
{
v110 = *(_DWORD *)(*(_QWORD *)&v123.minFilter - 8LL);
*(_DWORD *)(*(_QWORD *)&v123.minFilter - 8LL) = v110 - 1;
}
if ( v110 <= 0 )
operator delete(v3);
}
GJBaseGameLayer::increaseBatchNodeCapacity(a1);
m_levelSettings = a1->m_levelSettings;
if ( !m_levelSettings )
{
v115 = LevelSettingsObject::create();
a1->m_levelSettings = v115;
v115->m_level = a1->m_level;
cocos2d::CCObject::retain(a1->m_levelSettings);
m_levelSettings = a1->m_levelSettings;
}
m_player2 = a1->m_player2;
m_effectManager = m_levelSettings->m_effectManager;
a1->m_player1->m_isPlatformer = a1->m_isPlatformer;
m_player2->m_isPlatformer = a1->m_isPlatformer;
ColorAction = GJEffectManager::getColorAction(m_effectManager, 1005);
m_player1 = a1->m_player1;
ColorAction->m_duration = 0.0;
r = m_player1->m_playerColor1.r;
g = m_player1->m_playerColor1.g;
ColorAction->m_fromColor.b = m_player1->m_playerColor1.b;
ColorAction->m_fromColor.r = r;
ColorAction->m_fromColor.g = g;
ColorAction->m_blending = 1;
v11 = GJEffectManager::getColorAction(a1->m_levelSettings->GJBaseGameLayer::m_effectManager, 1006);
v12 = a1->m_player1;
v11->m_duration = 0.0;
v13 = v12->m_playerColor2.r;
v14 = v12->m_playerColor2.g;
v11->m_fromColor.b = v12->m_playerColor2.b;
v11->m_fromColor.r = v13;
v11->m_fromColor.g = v14;
v11->m_blending = 1;
v15 = GameManager::sharedState();
if ( v15->m_playerDeathEffect.random - v15->m_playerDeathEffect.seed > 0 )
{
v16 = GameManager::sharedState();
v17 = GameManager::sharedState();
GameManager::loadDeathEffect(v16, v17->m_playerDeathEffect.random - v17->m_playerDeathEffect.seed);
}
GJBaseGameLayer::createBackground(a1, a1->m_levelSettings->m_backgroundIndex);
v18 = a1->m_levelSettings;
m_middleGroundIndex = v18->m_middleGroundIndex;
if ( m_middleGroundIndex > 0 )
{
GJBaseGameLayer::createMiddleground(a1, m_middleGroundIndex);
v18 = a1->m_levelSettings;
}
GJBaseGameLayer::createGroundLayer(a1, v18->m_groundIndex, v18->m_groundLineIndex);
UILayer::togglePlatformerMode(a1->m_uiLayer, a1->m_isPlatformer);
v20 = a1->m_player1;
m_glitterParticles = a1->m_glitterParticles;
v22 = v20->m_playerColor1.r;
b = (float)v20->m_playerColor1.b;
setStartColor = m_glitterParticles->setStartColor;
*(float *)&v25 = (float)v20->m_playerColor1.g / 255.0;
v123.wrapT = 1.0;
v123.magFilter = v25;
*(float *)&v123.minFilter = (float)v22 / 255.0;
*(float *)&v123.wrapS = b / 255.0;
setStartColor(m_glitterParticles, (const cocos2d::ccColor4F *)&v123);
v26 = a1->m_glitterParticles;
setEndColor = v26->setEndColor;
*(_QWORD *)&v123.minFilter = 0;
v123.wrapS = 0;
v123.wrapT = 1.0;
setEndColor(v26, (const cocos2d::ccColor4F *)&v123);
GJBaseGameLayer::resetPlayer(a1);
v28 = FMODAudioEngine::sharedEngine();
GJGameLevel::getAudioFileName((__int64 *)&v123, a1->m_level);
FMODAudioEngine::loadMusic((__int64)v28, &v123, 1u, 0, 0, a1->m_levelSettings->m_dontReset, 1.0, 0.0, 1.0);
v29 = (void *)(*(_QWORD *)&v123.minFilter - 24LL);
if ( (__int64 *)(*(_QWORD *)&v123.minFilter - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v111 = (unsigned int *)(*(_QWORD *)&v123.minFilter - 8LL);
do
v112 = __ldaxr(v111);
while ( __stlxr(v112 - 1, v111) );
}
else
{
v112 = *(_DWORD *)(*(_QWORD *)&v123.minFilter - 8LL);
*(_DWORD *)(*(_QWORD *)&v123.minFilter - 8LL) = v112 - 1;
}
if ( v112 <= 0 )
operator delete(v29);
}
if ( a1->m_levelSettings->m_level->m_songID || a1->m_level->m_audioTrack > 19 )
{
*(_QWORD *)v117 = (unsigned int)a1->m_levelSettings->m_level->m_songID;
v30 = FMODAudioEngine::sharedEngine();
FMODAudioEngine::enableMetering(v30);
a1->m_skipAudioStep = (unsigned __int8)&dword_0 + 1;
v31 = MusicDownloadManager::sharedState();
MusicDownloadManager::incrementPriorityForSong(v31, v117[0]);
}
else
{
v99 = FMODAudioEngine::sharedEngine();
FMODAudioEngine::disableMetering(v99);
}
v32 = FMODAudioEngine::sharedEngine();
BackgroundMusicVolume = FMODAudioEngine::getBackgroundMusicVolume(v32);
m_audioTrack = (LevelTools *)(unsigned int)a1->m_level->m_audioTrack;
v35 = BackgroundMusicVolume <= 0.0;
a1->m_isSilent = v35;
LevelTools::getAudioString(m_audioTrack, v35);
a1->m_audioEffectsLayer = (AudioEffectsLayer *)AudioEffectsLayer::create((AudioEffectsLayer *)&v123, v124);
v36 = (void *)(*(_QWORD *)&v123.minFilter - 24LL);
if ( (__int64 *)(*(_QWORD *)&v123.minFilter - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v113 = (unsigned int *)(*(_QWORD *)&v123.minFilter - 8LL);
do
v114 = __ldaxr(v113);
while ( __stlxr(v114 - 1, v113) );
}
else
{
v114 = *(_DWORD *)(*(_QWORD *)&v123.minFilter - 8LL);
*(_DWORD *)(*(_QWORD *)&v123.minFilter - 8LL) = v114 - 1;
}
if ( v114 <= 0 )
operator delete(v36);
}
((void (__fastcall *)(cocos2d::CCLayer *))a1->m_objectLayer->addChild_0)(a1->m_objectLayer);
a1->m_audioEffectsLayer->setVisible(a1->m_audioEffectsLayer, 0);
v37 = GameManager::sharedState();
v38 = GameManager::sharedState();
GameManager::getFontFile(v37, v38->m_loadedFont);
v39 = cocos2d::CCLabelBMFont::create();
a1->m_attemptLabel = v39;
a1->m_objectLayer->addChild_0(a1->m_objectLayer, v39, 1400);
if ( a1->m_doNot )
a1->m_attemptLabel->setScaleY(a1->m_attemptLabel, -1.0);
v40 = cocos2d::CCLabelBMFont::create();
a1->m_infoLabel = v40;
a1->addChild_0(a1, v40, 1000);
m_infoLabel = a1->m_infoLabel;
setAnchorPoint = m_infoLabel->setAnchorPoint;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v123, 0.0, 1.0);
setAnchorPoint(m_infoLabel, (const cocos2d::CCPoint *)&v123);
v43 = a1->m_infoLabel;
setPosition = v43->setPosition;
cocos2d::CCPoint::CCPoint(&v121, 0.0, 0.0);
cocos2d::CCPoint::CCPoint(&v122, 5.0, v119 - 10.0);
cocos2d::CCPoint::operator+(&v123, &v121, &v122);
setPosition(v43, (const cocos2d::CCPoint *)&v123);
a1->m_infoLabel->setOpacity(a1->m_infoLabel, 4294967190LL);
a1->m_infoLabel->setScale(a1->m_infoLabel, 0.5);
PlayLayer::updateInfoLabel(a1);
a1->toggleInfoLabel(a1);
if ( !a1->m_levelSettings->m_twoPlayerMode
|| a1->m_isTestMode
|| a1->m_level->m_levelType == Editor
|| a1->m_isPlatformer )
{
v45 = 1.0;
}
else
{
v45 = 2.0;
a1->m_attemptLabel->setVisible(a1->m_attemptLabel, 0);
v100 = (cocos2d::CCSequence *)cocos2d::CCDelayTime::create(0.5);
v101 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCCallFunc::create(a1, PlayLayer::showTwoPlayerGuide, 0);
v102 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v100, v101, 0);
cocos2d::CCNode::runAction(a1, v102);
}
a1->m_freezeStartCamera = 1;
a1->m_unk322a = 1;
a1->m_skipArtReload = 1;
GJBaseGameLayer::updateCamera(a1, 0.0);
v47 = (cocos2d::CCSprite *)cocos2d::CCSprite::create((cocos2d::CCSprite *)"slidergroove2.png", v46);
a1->m_progressBar = v47;
a1->addChild_0(a1, v47, 10);
v49 = (cocos2d::CCSprite *)cocos2d::CCSprite::create((cocos2d::CCSprite *)"sliderBar2.png", v48);
v50 = v49->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
m_progressBar = a1->m_progressBar;
a1->m_progressFill = v49;
width = m_progressBar->m_obRect.size.width;
*(_QWORD *)&v123.minFilter = 0x260100002601LL;
getTexture = (__int64 (*)(void))v50->getTexture;
v123.wrapS = 10497;
v123.wrapT = 10497;
a1->m_progressHeight = 8.0;
a1->m_progressWidth = width - 4.0;
v54 = (cocos2d::CCTexture2D *)getTexture();
cocos2d::CCTexture2D::setTexParameters(v54, &v123);
v55 = a1->m_player1;
m_progressFill = a1->m_progressFill;
v57 = v55->m_playerColor1.g;
v58 = v55->m_playerColor1.b;
setColor = m_progressFill->setColor;
LOBYTE(v122.x) = v55->m_playerColor1.r;
BYTE1(v122.x) = v57;
BYTE2(v122.x) = v58;
setColor(m_progressFill, (const cocos2d::ccColor3B *)&v122);
a1->m_progressBar->addChild_0(a1->m_progressBar, a1->m_progressFill, -1);
v60 = a1->m_progressFill;
v61 = v60->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v122, 0.0, 0.0);
v61(v60, &v122);
v62 = a1->m_progressFill;
v63 = v62->setPosition;
cocos2d::CCPoint::CCPoint(&v122, 2.0, 4.0);
v63(v62, &v122);
v64 = a1->m_progressBar;
v65 = v64->setPosition;
cocos2d::CCPoint::CCPoint(&v122, v118 * 0.5, v119 - 8.0);
v65(v64, &v122);
v66 = cocos2d::CCLabelBMFont::create();
v67 = v66->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_percentageLabel = v66;
((void (__fastcall *)(float))v67->setScale)(0.5);
a1->addChild_0(a1, a1->m_percentageLabel, 15);
m_percentageLabel = a1->m_percentageLabel;
v69 = m_percentageLabel->setPosition;
cocos2d::CCPoint::CCPoint(&v122, (float)(v118 * 0.5) + 110.0, v119 - 8.0);
v69(m_percentageLabel, &v122);
v70 = a1->m_percentageLabel;
v71 = v70->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v122, 0.0, 0.5);
v71(v70, &v122);
PlayLayer::updateProgressbar(a1);
a1->toggleProgressbar(a1);
if ( a1->m_isTestMode || (v72 = a1->m_levelSettings, v72->m_propertykA24) || v72->m_spawnGroup > 0 )
{
a1->m_player1->setVisible(a1->m_player1, 1);
a1->m_player2->setVisible(a1->m_player2, 1);
PlayLayer::loadDefaultColors(a1);
GJBaseGameLayer::updateLevelColors(a1);
m_startPosObject = a1->m_startPosObject;
if ( !m_startPosObject )
{
LABEL_35:
m_startSettings = a1->m_levelSettings;
goto LABEL_22;
}
}
else
{
a1->m_player1->setVisible(a1->m_player1, 0);
a1->m_player2->setVisible(a1->m_player2, 0);
PlayLayer::loadDefaultColors(a1);
GJBaseGameLayer::updateLevelColors(a1);
m_startPosObject = a1->m_startPosObject;
if ( !m_startPosObject )
goto LABEL_35;
}
m_startSettings = m_startPosObject->m_startSettings;
LABEL_22:
GJBaseGameLayer::setupLevelStart(a1, m_startSettings);
v75 = a1->GJBaseGameLayer::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_objectsDeactivated = 1;
v75->updateVisibility(a1, 0.0);
GJBaseGameLayer::updateCamera(a1, 0.0);
a1->toggleGlitter(a1, 0);
v76 = GameManager::sharedState();
a1->m_disableGravityEffect = GameManager::getGameVariable(v76, "0072");
v77 = ObjectToolbox::sharedState();
v78 = (char *)ObjectToolbox::intKeyToFrame(v77, 8);
sub_D153B8((unsigned int)&v116 + 160, v78);
v79 = GameObject::createWithKey((int)byte_8);
v80 = v79->CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_anticheatSpike = v79;
((void (*)(void))v80->customSetup)();
m_anticheatSpike = a1->m_anticheatSpike;
sub_D18D28(&v121, &v120);
GameObject::addColorSprite(m_anticheatSpike, (std::string)&v121);
v82 = (void *)(*(_QWORD *)&v121 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v121 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v107 = (unsigned int *)(*(_QWORD *)&v121 - 8LL);
do
v108 = __ldaxr(v107);
while ( __stlxr(v108 - 1, v107) );
}
else
{
v108 = *(_DWORD *)(*(_QWORD *)&v121 - 8LL);
*(_DWORD *)(*(_QWORD *)&v121 - 8LL) = v108 - 1;
}
if ( v108 <= 0 )
operator delete(v82);
}
v83 = a1->m_anticheatSpike;
setupCustomSprites = v83->setupCustomSprites;
*(__n128 *)&v85 = sub_D18D28(&v122, &v120);
((void (__fastcall *)(GameObject *, cocos2d::CCPoint *, long double))setupCustomSprites)(v83, &v122, v85);
v86 = (void *)(*(_QWORD *)&v122 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v122 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v105 = (unsigned int *)(*(_QWORD *)&v122 - 8LL);
do
v106 = __ldaxr(v105);
while ( __stlxr(v106 - 1, v105) );
}
else
{
v106 = *(_DWORD *)(*(_QWORD *)&v122 - 8LL);
*(_DWORD *)(*(_QWORD *)&v122 - 8LL) = v106 - 1;
}
if ( v106 <= 0 )
operator delete(v86);
}
v87 = a1->m_anticheatSpike;
setStartPos = v87->setStartPos;
v89 = a1->m_player1->getPosition(a1->m_player1);
cocos2d::CCPoint::CCPoint(&v122, v89);
((void (__fastcall *)(GameObject *, cocos2d::CCPoint *))setStartPos)(v87, &v122);
v90 = a1->m_anticheatSpike;
v90->m_bDontDraw = 1;
PlayLayer::addObject(a1, v90);
GJBaseGameLayer::createPlayerCollisionBlock(a1);
m_attemptLabel = a1->m_attemptLabel;
v92 = m_attemptLabel->setPosition;
cocos2d::CCPoint::CCPoint(
&v122,
a1->m_gameState.m_cameraPosition.x + (float)(v118 * 0.5),
(float)(a1->m_gameState.m_cameraPosition.y + (float)(v119 * 0.5)) + 85.0);
v92(m_attemptLabel, &v122);
if ( a1->m_isTestMode )
a1->m_attemptLabel->setOpacity(a1->m_attemptLabel, 50);
v93 = a1->GJBaseGameLayer::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_freezeStartCamera = 1;
v93->resetLevel(a1);
a1->m_started = 0;
PlayLayer::prepareMusic(a1, 0);
if ( a1->m_passedIntegrity )
{
v94 = (cocos2d::CCSequence *)cocos2d::CCDelayTime::create(v45);
v95 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCCallFunc::create(a1, PlayLayer::startGame, 0);
}
else
{
v94 = (cocos2d::CCSequence *)cocos2d::CCDelayTime::create(v45);
v95 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCCallFunc::create(a1, PlayLayer::onQuit, 0);
}
v96 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v94, v95, 0);
cocos2d::CCNode::runAction(a1, v96);
cocos2d::CCNode::scheduleUpdate(a1);
GJBaseGameLayer::checkSpawnObjects(a1);
GJEffectManager::updateEffects(a1->m_effectManager, 0.0);
a1->updateVisibility(a1, 0.0);
GJBaseGameLayer::updateLevelColors(a1);
GJBaseGameLayer::updateProximityVolumeEffects(a1);
PlayLayer::updateTestModeLabel(a1);
if ( GJBaseGameLayer::shouldExitHackedLevel(a1) )
{
PlayLayer::removeAllObjects(a1);
PlayLayer::onQuit(a1);
v97 = v120;
v98 = (void *)(v120 - 24);
if ( (__int64 *)(v120 - 24) == &qword_124B6B0 )
return;
}
else
{
v97 = v120;
v98 = (void *)(v120 - 24);
if ( (__int64 *)(v120 - 24) == &qword_124B6B0 )
return;
}
if ( &pthread_create )
{
v103 = (unsigned int *)(v97 - 8);
do
v104 = __ldaxr(v103);
while ( __stlxr(v104 - 1, v103) );
}
else
{
v104 = *(_DWORD *)(v97 - 8);
*(_DWORD *)(v97 - 8) = v104 - 1;
}
if ( v104 <= 0 )
operator delete(v98);
}