//
// LevelEditorLayer::onStopPlaytest from 0x462964 to 0x462bfe (666 bytes)
//
// 2 xrefs:
// > LevelEditorLayer::postUpdate @ 0x46ae10
// > EditorUI::onStopPlaytest @ 0x48a05c
//
// 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:48:54 +0000
//
EditorUI *__fastcall LevelEditorLayer::onStopPlaytest(GJEffectManager **this)
{
int v2; // r0
int v3; // r1
cocos2d::CCDirector *v4; // r0
cocos2d::CCDirector *v5; // r0
cocos2d::CCDirector *fixed; // r0
GJEffectManager *v7; // r3
int v8; // r1
int v9; // r2
_BYTE *v10; // r0
_DWORD *v11; // r7
unsigned int v12; // r6
_DWORD *v13; // r2
int v14; // r3
int v15; // r8
_DWORD *v16; // r2
int v17; // r9
_BYTE *v18; // r5
const cocos2d::CCPoint *v19; // r0
int v20; // r1
int v21; // r2
int v22; // r3
FMODAudioEngine *v23; // r0
int v24; // r0
FMODAudioEngine *v25; // r0
FMODAudioEngine *v26; // r0
char **v27; // r0
FMOD::ChannelControl **v28; // r0
EditorUI *result; // r0
int v30; // r7
void (__fastcall *v31)(int, int); // r8
int v32; // r0
int v33; // [sp+Ch] [bp-38h]
int v34; // [sp+18h] [bp-2Ch]
_DWORD *v35; // [sp+24h] [bp-20h]
float v36[2]; // [sp+2Ch] [bp-18h] BYREF
float v37[2]; // [sp+34h] [bp-10h] BYREF
v2 = cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)this);
*(_BYTE *)((*(int (__fastcall **)(int))(*(_DWORD *)v2 + 96))(v2) + 92) = 0;
UILayer::editorPlaytest(*(this + 2810), 0);
GJBaseGameLayer::restoreAllUIObjects((GJBaseGameLayer *)this);
GJBaseGameLayer::resetStoppedAreaObjects((GJBaseGameLayer *)this);
LevelEditorLayer::quickUpdateAllPositions((int)this, v3);
GJBaseGameLayer::resetLevelVariables((GJBaseGameLayer *)this);
GJBaseGameLayer::syncBGTextures((GJBaseGameLayer *)this);
v4 = (cocos2d::CCDirector *)LevelEditorLayer::removePlayerCollisionBlock((int)this);
if ( *((_BYTE *)this + 11709) )
{
v5 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v4);
fixed = (cocos2d::CCDirector *)cocos2d::CCDirector::resetSmoothFixCounter(v5);
*(_BYTE *)(cocos2d::CCDirector::sharedDirector(fixed) + 142) = 0;
}
GJBaseGameLayer::setActiveStartPosObject((GJBaseGameLayer *)this, nullptr);
*(this + 2959) = (GJEffectManager *)1065353216;
v7 = *this;
*((_BYTE *)this + 1438) = 1;
(*((void (__fastcall **)(GJEffectManager **, int))v7 + 183))(this, 1065353216);
*(this + 2960) = (GJEffectManager *)1065353216;
LevelEditorLayer::updatePlayerState((int)this, 0);
PlayerObject::releaseAllButtons(*(this + 519), v8, v9);
cocos2d::CCNode::pauseSchedulerAndActions(*(this + 519));
LevelEditorLayer::updatePreviewParticles((LevelEditorLayer *)this);
GJBaseGameLayer::toggleDualMode((GJBaseGameLayer *)this, nullptr, 0, *(this + 519), 1);
v10 = *(this + 519);
if ( v10[1960] || *((_BYTE *)this + 866) && (v10 = *(this + 520), v10[1960]) )
{
v30 = (int)*(this + 2961);
v31 = *(void (__fastcall **)(int, int))(*(_DWORD *)v30 + 92);
v32 = (*(int (__fastcall **)(_BYTE *))(*(_DWORD *)v10 + 96))(v10);
v31(v30, v32);
(*(void (__fastcall **)(_DWORD, int))(*(_DWORD *)*(this + 2961) + 172))(*(this + 2961), 1);
}
v11 = this + 2823;
v12 = 0;
(*(void (__fastcall **)(_DWORD, _DWORD))(*(_DWORD *)*(this + 519) + 172))(*(this + 519), 0);
(*(void (__fastcall **)(_DWORD, _DWORD))(*(_DWORD *)*(this + 520) + 172))(*(this + 520), 0);
while ( v12 < (*(this + 2824) - *(this + 2823)) >> 2 )
{
v13 = *(_DWORD **)(*v11 + 4 * v12);
if ( v13 )
v14 = (v13[1] - *v13) >> 2;
else
v14 = -1;
v15 = 0;
v33 = v14;
while ( v15 < v33 )
{
v16 = *(_DWORD **)(**(_DWORD **)(*v11 + 4 * v12) + 4 * v15);
if ( v16 )
{
v17 = 0;
v34 = *(_DWORD *)(**((_DWORD **)*(this + 2844) + v12) + 4 * v15);
while ( v17 < v34 )
{
v35 = v16;
v18 = *(_BYTE **)(*v16 + 4 * v17);
(*(void (__fastcall **)(_BYTE *))(*(_DWORD *)v18 + 688))(v18);
(*(void (__fastcall **)(_BYTE *))(*(_DWORD *)v18 + 644))(v18);
v19 = (const cocos2d::CCPoint *)(*(int (__fastcall **)(_BYTE *))(*(_DWORD *)v18 + 96))(v18);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v36, v19);
(*(void (__fastcall **)(float *, _BYTE *))(*(_DWORD *)v18 + 680))(v37, v18);
v16 = v35;
if ( v36[0] != v37[0] || v36[1] != v37[1] )
{
(*(void (__fastcall **)(_BYTE *, float *))(*(_DWORD *)v18 + 92))(v18, v37);
v16 = v35;
}
v18[732] = 1;
++v17;
v18[733] = 1;
v18[708] = 1;
}
}
++v15;
}
++v12;
}
LevelEditorLayer::resetToggledGroups((LevelEditorLayer *)this);
LevelEditorLayer::resetMovingObjects((LevelEditorLayer *)this, v20, v21, v22);
LevelEditorLayer::updateAnimateOnTriggerObjects((int)this, 1);
GJEffectManager::reset(*(this + 381));
v23 = (FMODAudioEngine *)GJBaseGameLayer::resetGroupCounters((GJBaseGameLayer *)this, 0);
v24 = FMODAudioEngine::sharedEngine(v23);
v25 = (FMODAudioEngine *)FMODAudioEngine::resumeAllAudio(v24);
v26 = (FMODAudioEngine *)FMODAudioEngine::sharedEngine(v25);
v27 = FMODAudioEngine::stopAllMusic(v26, 1);
v28 = (FMOD::ChannelControl **)FMODAudioEngine::sharedEngine((FMODAudioEngine *)v27);
FMODAudioEngine::stopAllEffects(v28);
if ( *((_BYTE *)this + 11703) )
LevelEditorLayer::timeObjectChanged((int)this);
result = *(this + 2964);
if ( result )
result = (EditorUI *)EditorUI::updateSlider(result);
*((_BYTE *)this + 10829) = 0;
return result;
}