//
// GJBaseGameLayer::loadLevelSettings from 0x5962e8 to 0x5963ce (230 bytes)
//
// 5 xrefs:
// > PlayLayer::prepareCreateObjectsFromSetup @ 0x4069ee
// > LevelEditorLayer::onPlaytest @ 0x46823e
// > LevelEditorLayer::levelSettingsUpdated @ 0x469fc2
// > LevelEditorLayer::createObjectsFromSetup @ 0x475928
// > LevelEditorLayer::init @ 0x4763bc
//
// 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:53:09 +0000
//
int __fastcall GJBaseGameLayer::loadLevelSettings(GJBaseGameLayer *this)
{
char v2; // r1
int v3; // r3
int result; // r0
int v5; // s15
int v6; // r3
_DWORD *v7; // r2
GameObject **v8; // r6
GameObject **v9; // r5
GameObject *v10; // r1
GameObject *v11; // t1
v2 = *(_BYTE *)(*((_DWORD *)this + 521) + 281);
*((_BYTE *)this + 10614) = v2;
PlayerObject::togglePlatformerMode(*((_DWORD *)this + 519), v2);
PlayerObject::togglePlatformerMode(*((_DWORD *)this + 520), *((_BYTE *)this + 10614));
if ( *((_BYTE *)this + 10614) )
*(_DWORD *)(*((_DWORD *)this + 352) + 724) = 5;
*(_BYTE *)(*((_DWORD *)this + 519) + 2380) = *(_BYTE *)(*((_DWORD *)this + 521) + 372) ^ 1;
*(_BYTE *)(*((_DWORD *)this + 520) + 2380) = *(_BYTE *)(*((_DWORD *)this + 521) + 372) ^ 1;
*(_BYTE *)(*((_DWORD *)this + 519) + 2064) = *(_BYTE *)(*((_DWORD *)this + 521) + 381) ^ 1;
*(_BYTE *)(*((_DWORD *)this + 520) + 2064) = *(_BYTE *)(*((_DWORD *)this + 521) + 381) ^ 1;
v3 = *((_DWORD *)this + 352);
if ( *(int *)(v3 + 1000) <= 0 )
*(_DWORD *)(v3 + 1000) = *(_DWORD *)(*((_DWORD *)this + 521) + 352);
result = LevelSettingsObject::shouldUseYSection(*((LevelSettingsObject **)this + 521));
v5 = 1008981770;
if ( !result )
v5 = 0;
*((_DWORD *)this + 2857) = v5;
v6 = *((_DWORD *)this + 522);
if ( v6 )
{
v7 = *(_DWORD **)(v6 + 52);
if ( *v7 )
{
v8 = (GameObject **)v7[3];
v9 = &v8[*v7] + 0x3FFFFFFF;
while ( v8 <= v9 )
{
v11 = *v8++;
v10 = v11;
if ( !v11 )
break;
result = GJBaseGameLayer::applyLevelSettings((int)this, v10);
}
}
}
return result;
}