//
// UILayer::togglePlatformerMode from 0x140670fd0 to 0x14067109f (207 bytes)
//
// 5 xrefs:
// > GJBaseGameLayer::toggleDualMode @ 0x14031de72
// > LevelEditorLayer::onPlaytest @ 0x1403fe933
// > PlayLayer::setupHasCompleted @ 0x140504da3
// > UILayer::init @ 0x140670844
// > ??> @ 0x1409322c4
//
// 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:35:54 +0000
//
// Hidden C++ exception states: #wind=3
unsigned int __fastcall UILayer::togglePlatformerMode(__int64 a1, char a2)
{
__int64 v3; // rcx
unsigned int v4; // edi
unsigned int result; // eax
struct cocos2d::CCObject *v6; // rax
void *v7; // [rsp+30h] [rbp+8h]
*(_BYTE *)(a1 + 596) = a2;
if ( a2 )
UILayer::resolveLevelControls(a1);
UILayer::applyLevelBindings(a1);
if ( *(_BYTE *)(a1 + 596) )
{
v3 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v7 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v7);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v3 = qword_14090BFD0;
}
GameManager::getGameVariable(v3, "0024");
}
v4 = 0;
result = cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 616));
if ( result )
{
do
{
v6 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 616), v4);
(*(void (__fastcall **)(struct cocos2d::CCObject *, _QWORD))(*(_QWORD *)v6 + 336LL))(v6, 0);
++v4;
result = cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 616));
}
while ( v4 < result );
}
return result;
}