//
// LevelEditorLayer::postUpdate from 0x1404008c0 to 0x140400c0d (845 bytes)
//
// 4 xrefs:
// > ??> @ 0x14078b1d8
// > ??> @ 0x1408c6a1c
// > ??> @ 0x1408c6a48
// > ??> @ 0x1409259e8
//
// 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:31:54 +0000
//
void __fastcall LevelEditorLayer::postUpdate(__int64 a1, float a2)
{
char *ColorSprite; // rax
__int16 v4; // cx
char v5; // dl
__int64 v6; // rcx
__int64 v7; // rcx
__int64 v8; // rcx
const struct cocos2d::CCPoint *v9; // rax
const struct cocos2d::CCPoint *v10; // rax
cocos2d::CCPoint *v11; // rcx
float *v12; // r14
__int64 *v13; // r15
_BYTE *v14; // rbp
__int64 *v15; // rdi
__int64 v16; // rbx
__int64 v17; // rax
__int64 v18; // rdx
__int64 v19; // rcx
__int64 v20; // rcx
const struct cocos2d::CCPoint *v21; // rax
const struct cocos2d::CCPoint *v22; // rax
cocos2d::CCPoint *v23; // rcx
_BYTE *v24; // rdi
char v25; // bl
const struct cocos2d::CCPoint *v26; // rax
const struct cocos2d::CCPoint *v27; // rax
const struct cocos2d::CCPoint *v28; // rbp
_QWORD *v29; // rdx
__int64 v30; // rbx
float v31[4]; // [rsp+20h] [rbp-48h] BYREF
__int16 v32; // [rsp+70h] [rbp+8h] BYREF
char v33; // [rsp+72h] [rbp+Ah]
if ( !*(_BYTE *)(a1 + 1058) )
*(_BYTE *)(a1 + 14900) = 1;
GJEffectManager::processColors(*(_QWORD *)(a1 + 2408));
ColorSprite = GJEffectManager::getColorSprite(*(_QWORD *)(a1 + 2408), 1005);
if ( ColorSprite )
{
v4 = *(_WORD *)(ColorSprite + 327);
v5 = ColorSprite[329];
}
else
{
v4 = -1;
v5 = -1;
}
v32 = v4;
v6 = *(_QWORD *)(a1 + 2408);
v33 = v5;
GJEffectManager::calculateLightBGColor(v6, (__int64)&v32);
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 1072LL))(a1);
if ( *(_QWORD *)(a1 + 2176) || *(_QWORD *)(a1 + 2184) )
{
GJBaseGameLayer::syncDeathMarkerFlip(a1);
sub_1403F59C0((cocos2d::CCRect *)v31, *(_QWORD *)(a1 + 4296));
v7 = *(_QWORD *)(a1 + 2176);
if ( v7 )
DeathMarkerLayer::updateVisibility(v7, v31);
v8 = *(_QWORD *)(a1 + 2184);
if ( v8 )
DeathMarkerLayer::updateVisibility(v8, v31);
}
if ( *(_BYTE *)(a1 + 14953) )
GJBaseGameLayer::updateLevelColors((_QWORD *)a1);
if ( *(_BYTE *)(a1 + 12648) )
{
v9 = (const struct cocos2d::CCPoint *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 3512) + 200LL))(*(_QWORD *)(a1 + 3512));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v32, v9);
v11 = *(cocos2d::CCPoint **)(a1 + 15128);
if ( v11 == *(cocos2d::CCPoint **)(a1 + 15136) )
{
sub_1403C0830(
(const struct cocos2d::CCPoint **)(a1 + 15120),
*(const struct cocos2d::CCPoint **)(a1 + 15128),
v10);
}
else
{
cocos2d::CCPoint::CCPoint(v11, v10);
*(_QWORD *)(a1 + 15128) += 8LL;
}
}
v12 = (float *)(a1 + 14896);
v13 = (__int64 *)(a1 + 3512);
v14 = *(_BYTE **)(a1 + 3512);
*(float *)(a1 + 14896) = a2 + *(float *)(a1 + 14896);
if ( !v14[2444] )
{
if ( !*(_BYTE *)(a1 + 1058) )
goto LABEL_24;
v14 = *(_BYTE **)(a1 + 3520);
if ( !v14[2444] )
goto LABEL_24;
v12 = (float *)(a1 + 14896);
v13 = (__int64 *)(a1 + 3512);
}
PlayerObject::playerDestroyed(v14, 0);
v15 = *(__int64 **)(a1 + 14888);
v16 = *v15;
v17 = (*(__int64 (__fastcall **)(_BYTE *))(*(_QWORD *)v14 + 200LL))(v14);
(*(void (__fastcall **)(__int64 *, __int64))(v16 + 184))(v15, v17);
LOBYTE(v18) = 1;
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 14888) + 336LL))(*(_QWORD *)(a1 + 14888), v18);
LevelEditorLayer::onStopPlaytest(a1);
v19 = *(_QWORD *)(a1 + 14904);
if ( v19 )
EditorUI::playtestStopped(v19);
LABEL_24:
if ( *(_DWORD *)(a1 + 2204) == 1 && *v12 >= 0.033333335 )
{
v20 = *v13;
*v12 = 0.0;
v21 = (const struct cocos2d::CCPoint *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v20 + 200LL))(v20);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v32, v21);
v23 = *(cocos2d::CCPoint **)(a1 + 15080);
if ( v23 == *(cocos2d::CCPoint **)(a1 + 15088) )
{
sub_1403C0830(
(const struct cocos2d::CCPoint **)(a1 + 15072),
*(const struct cocos2d::CCPoint **)(a1 + 15080),
v22);
}
else
{
cocos2d::CCPoint::CCPoint(v23, v22);
*(_QWORD *)(a1 + 15080) += 8LL;
}
if ( *(_BYTE *)(a1 + 1058) )
{
v24 = (_BYTE *)(a1 + 14900);
v25 = *(_BYTE *)(a1 + 14900);
v26 = (const struct cocos2d::CCPoint *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 3520) + 200LL))(*(_QWORD *)(a1 + 3520));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v32, v26);
v28 = v27;
if ( !v25 )
{
if ( *(_QWORD *)(a1 + 15096) != *(_QWORD *)(a1 + 15104) )
goto LABEL_36;
v24 = (_BYTE *)(a1 + 14900);
}
v29 = *(_QWORD **)(a1 + 15104);
if ( v29 == *(_QWORD **)(a1 + 15112) )
{
sub_140417450(a1 + 15096);
}
else
{
*v29 = 0;
v29[1] = 0;
v29[2] = 0;
*(_QWORD *)(a1 + 15104) += 24LL;
}
LABEL_36:
v30 = *(_QWORD *)(a1 + 15104);
if ( *(_QWORD *)(v30 - 16) == *(_QWORD *)(v30 - 8) )
{
sub_1403C0830((const struct cocos2d::CCPoint **)(v30 - 24), *(const struct cocos2d::CCPoint **)(v30 - 16), v28);
}
else
{
cocos2d::CCPoint::CCPoint(*(cocos2d::CCPoint **)(v30 - 16), v28);
*(_QWORD *)(v30 - 16) += 8LL;
}
*v24 = 0;
}
}
}