//
// LevelEditorLayer::onPlaytest from 0x79626c to 0x796884 (1560 bytes)
//
// 2 xrefs:
// > EditorUI::onPlaytest @ 0x7ce828
// > ??> @ 0x5d5c8
//
// This function is hookable on this platform (idp: arm, 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 12:53:34 +0000
//
__int64 __fastcall LevelEditorLayer::onPlaytest(LevelEditorLayer *this)
{
char *v1; // x23
__int64 v3; // x1
cocos2d::CCDirector *v4; // x0
__int64 v5; // x0
__int64 v6; // x0
float v7; // s0
__int64 v8; // x1
long double v9; // q0
__int64 v10; // x0
__int64 v11; // x0
unsigned int *v12; // x1
GameObject **v13; // x21
__int64 v14; // x0
char *v15; // x24
GameObject *v16; // x20
StartPosObject *StartPosObject; // x0
__int64 v18; // x0
unsigned int *v19; // x1
cocos2d::CCObject **v20; // x20
__int64 v21; // x0
char *v22; // x24
cocos2d::CCObject *v23; // x1
char v24; // w0
__int64 v25; // x0
StartPosObject *v26; // x1
GJBaseGameLayer *v27; // x0
GameManager *v28; // x0
GameManager *v29; // x0
__int64 v30; // x20
const cocos2d::CCPoint *v31; // x0
__n128 v32; // q0
GameObject *v33; // x20
const cocos2d::CCPoint *v34; // x0
long double v35; // q0
GameManager *v36; // x0
GameManager *v37; // x0
float v38; // s0
__int64 v40; // x0
unsigned int *v41; // x1
char *v42; // x20
__int64 v43; // x0
char *v44; // x21
cocos2d::CCDirector *v45; // x0
cocos2d::CCDirector *fixed; // x0
GameObject *v47; // x20
const cocos2d::CCPoint *v48; // x0
__int64 v49; // x20
const cocos2d::CCPoint *v50; // x0
cocos2d::CCObject *v51; // [xsp+48h] [xbp+48h]
char v52[8]; // [xsp+50h] [xbp+50h] BYREF
__int64 v53; // [xsp+58h] [xbp+58h]
v1 = (char *)this + 12288;
v3 = _stack_chk_guard;
++*((_DWORD *)this + 3682);
v53 = v3;
v4 = (cocos2d::CCDirector *)EditorBuildStats::noteAction((LevelEditorLayer *)((char *)this + 14704));
v5 = cocos2d::CCDirector::sharedDirector(v4);
*(_BYTE *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v5 + 192LL))(v5) + 132) = 1;
GJBaseGameLayer::preResumeGame(this);
UILayer::editorPlaytest(*((UILayer **)this + 1661), 1u);
UILayer::togglePlatformerMode(*((UILayer **)this + 1661), *((_BYTE *)this + 12238));
*((float *)this + 107) = -1.0;
GJBaseGameLayer::updateZoom(this, 1.0, 0.0, 0, 0.0, -1, -1);
GJBaseGameLayer::resetLevelVariables(this);
*((_BYTE *)this + 1982) = 0;
*((_BYTE *)this + 1721) = 1;
*((_QWORD *)this + 1665) = 0;
LevelEditorLayer::addPlayerCollisionBlock((__int64)this);
*((_DWORD *)this + 3505) = 0;
GJBaseGameLayer::loadLevelSettings(this);
GJBaseGameLayer::updateMaxGameplayY(this);
if ( v1[1729] )
{
v45 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)(unsigned __int8)v1[1729]);
fixed = (cocos2d::CCDirector *)cocos2d::CCDirector::resetSmoothFixCounter(v45);
*(_BYTE *)(cocos2d::CCDirector::sharedDirector(fixed) + 178) = 1;
}
GJEffectManager::removePersistentFromAllItems(*((GJEffectManager **)this + 269));
GJEffectManager::reset(*((GJEffectManager **)this + 269));
LevelEditorLayer::transferDefaultColors(
this,
*(GJEffectManager **)(*((_QWORD *)this + 409) + 320LL),
*((GJEffectManager **)this + 269));
GJEffectManager::updateEffects(*((GJEffectManager **)this + 269), 0.0);
GJEffectManager::processColors(*((GJEffectManager **)this + 269));
LevelEditorLayer::updateBlendValues((GJEffectManager **)this);
GJBaseGameLayer::togglePlayerVisibility(this, 1);
v6 = *((_QWORD *)this + 490);
*((_DWORD *)this + 3560) = 0;
v7 = (*(float (__fastcall **)(__int64))(*(_QWORD *)v6 + 168LL))(v6);
v8 = *((_QWORD *)this + 490);
*((float *)this + 3553) = v7;
*(float *)&v9 = (*(float (__fastcall **)(__int64))(*(_QWORD *)v8 + 168LL))(v8);
v10 = *((_QWORD *)this + 490);
*((_DWORD *)this + 3553) = LODWORD(v9);
if ( *(float *)&v9 >= 0.7 )
LODWORD(v9) = 1060320051;
(*(void (__fastcall **)(__int64, long double))(*(_QWORD *)v10 + 160LL))(v10, v9);
*((_QWORD *)this + 115) = 0;
LevelEditorLayer::clearPlayerPoints(this);
LevelEditorLayer::clearTouchPoints((__int64)this);
GJBaseGameLayer::clearHitboxTrail(this);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 407) + 344LL))(*((_QWORD *)this + 407), 1);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 408) + 344LL))(*((_QWORD *)this + 408), 1);
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 1779) + 344LL))(*((_QWORD *)this + 1779), 0);
GJBaseGameLayer::setActiveStartPosObject(this, nullptr);
v11 = *((_QWORD *)this + 410);
if ( v11 )
{
v12 = *(unsigned int **)(v11 + 56);
if ( *v12 )
{
v13 = *((GameObject ***)v12 + 2);
v14 = 8LL * *v12 - 8;
v15 = (char *)v13 + v14;
if ( v13 <= (GameObject **)((char *)v13 + v14) )
{
do
{
v16 = *v13;
if ( !*v13 )
break;
(*(void (__fastcall **)(GameObject *))(*(_QWORD *)v16 + 1376LL))(*v13);
(*(void (__fastcall **)(GameObject *))(*(_QWORD *)v16 + 1288LL))(v16);
(*(void (__fastcall **)(GameObject *, __int64))(*(_QWORD *)v16 + 1776LL))(v16, 1);
if ( (*(unsigned int (__fastcall **)(GameObject *))(*(_QWORD *)v16 + 1800LL))(v16) == 25 )
GameObject::determineSlopeDirection(v16);
else
GameObject::updateIsOriented((__int64)v16);
++v13;
}
while ( v15 >= (char *)v13 );
}
}
}
LevelEditorLayer::updateAnimateOnTriggerObjects(this, 0);
StartPosObject = (StartPosObject *)LevelEditorLayer::findStartPosObject(this);
GJBaseGameLayer::setActiveStartPosObject(this, StartPosObject);
cocos2d::CCArray::removeAllObjects(*((cocos2d::CCArray **)this + 413));
v18 = *((_QWORD *)this + 1764);
if ( v18 )
{
v19 = *(unsigned int **)(v18 + 56);
if ( *v19 )
{
v20 = *((cocos2d::CCObject ***)v19 + 2);
v21 = 8LL * *v19 - 8;
v22 = (char *)v20 + v21;
if ( v20 <= (cocos2d::CCObject **)((char *)v20 + v21) )
{
do
{
v23 = *v20;
if ( !*v20 )
break;
if ( *((_BYTE *)v23 + 1472) || *((_BYTE *)v23 + 1473) )
{
v51 = *v20;
v24 = (*(__int64 (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)v23 + 1688LL))(*v20);
v23 = v51;
if ( !v24 )
continue;
}
cocos2d::CCArray::addObject(*((cocos2d::CCArray **)this + 413), v23);
++v20;
}
while ( v22 >= (char *)v20 );
}
}
}
GJBaseGameLayer::orderSpawnObjects(this);
GJBaseGameLayer::resetSpawnChannelIndex(this);
LevelEditorLayer::resetToggledGroupsAndObjects(this);
GJEffectManager::resetEffects(*(GJEffectManager **)(*((_QWORD *)this + 409) + 320LL));
LevelEditorLayer::recreateGroups((cocos2d::CCArray **)this);
GJBaseGameLayer::updateSpecialGroupData(this);
LevelEditorLayer::dirtifyTriggers(this);
GJBaseGameLayer::resetGroupCounters(this, 1);
GJBaseGameLayer::resetPlayer(this);
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 408) + 912LL))(*((_QWORD *)this + 408), 0);
GJBaseGameLayer::updateCamera(this, 0.0);
v25 = *((_QWORD *)this + 1554);
if ( !v25 )
{
GJBaseGameLayer::setupLevelStart(this, *((LevelSettingsObject **)this + 409));
v26 = *((StartPosObject **)this + 1554);
v27 = this;
if ( v26 )
goto LABEL_23;
LABEL_41:
*((_BYTE *)this + 1983) = 1;
GJBaseGameLayer::checkSpawnObjects(v27);
goto LABEL_24;
}
GJBaseGameLayer::setupLevelStart(this, *(LevelSettingsObject **)(v25 + 1840));
v26 = *((StartPosObject **)this + 1554);
v27 = this;
if ( !v26 )
goto LABEL_41;
LABEL_23:
v28 = (GameManager *)GJBaseGameLayer::loadStartPosObject(v27, v26);
v29 = (GameManager *)GameManager::sharedState(v28);
if ( (unsigned __int8)GameManager::getGameVariable(v29, "0151") )
{
v40 = *((_QWORD *)this + 410);
if ( v40 )
{
v41 = *(unsigned int **)(v40 + 56);
if ( *v41 )
{
v42 = *((char **)v41 + 2);
v43 = 8LL * *v41 - 8;
v44 = &v42[v43];
while ( v44 >= v42 )
{
if ( !*(_QWORD *)v42 )
break;
v42 += 8;
(*(void (__fastcall **)(LevelEditorLayer *))(*(_QWORD *)this + 1368LL))(this);
}
}
}
}
LABEL_24:
GJBaseGameLayer::syncBGTextures(this);
v30 = *((_QWORD *)this + 407);
v31 = (const cocos2d::CCPoint *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v30 + 192LL))(v30);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v52, v31);
v32 = cocos2d::CCPoint::operator=(v30 + 2608, v52);
if ( *((_BYTE *)this + 1010) )
{
v49 = *((_QWORD *)this + 408);
v50 = (const cocos2d::CCPoint *)(*(__int64 (__fastcall **)(__int64, long double))(*(_QWORD *)v49 + 192LL))(
v49,
*(long double *)&v32);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v52, v50);
v32 = cocos2d::CCPoint::operator=(v49 + 2608, v52);
}
v33 = *((GameObject **)this + 407);
v34 = (const cocos2d::CCPoint *)(*(__int64 (__fastcall **)(GameObject *, long double))(*(_QWORD *)v33 + 192LL))(
v33,
*(long double *)&v32);
*(__n128 *)&v35 = GameObject::setLastPosition(v33, v34);
if ( *((_BYTE *)this + 1010) )
{
v47 = *((GameObject **)this + 408);
v48 = (const cocos2d::CCPoint *)(*(__int64 (__fastcall **)(GameObject *, long double))(*(_QWORD *)v47 + 192LL))(
v47,
v35);
GameObject::setLastPosition(v47, v48);
}
cocos2d::CCNode::resumeSchedulerAndActions(*((cocos2d::CCNode **)this + 407));
cocos2d::CCNode::resumeSchedulerAndActions(*((cocos2d::CCNode **)this + 408));
LevelEditorLayer::updatePlayerState((__int64)this, 1);
LevelEditorLayer::updatePreviewParticles((cocos2d::CCArray **)this);
GJBaseGameLayer::stopCameraShake(this);
if ( v1[2009] )
GJBaseGameLayer::updateLevelColors(this);
GJBaseGameLayer::updateGradientLayers(this);
GJBaseGameLayer::updateShaderLayer(this, 0.0);
GJBaseGameLayer::updateCamera(this, 0.0);
v36 = (GameManager *)(*(__int64 (__fastcall **)(LevelEditorLayer *, float))(*(_QWORD *)this + 1192LL))(this, 0.0);
v37 = (GameManager *)GameManager::sharedState(v36);
if ( (unsigned __int8)GameManager::getGameVariable(v37, "0002") )
{
v38 = *((double *)this + 116);
GJBaseGameLayer::processActivatedAudioTriggers(this, v38);
GJBaseGameLayer::clearActivatedAudioTriggers(this);
GJBaseGameLayer::processQueuedAudioTriggers(this);
}
*((_BYTE *)this + 1983) = 0;
v1[317] = 0;
return _stack_chk_guard;
}