//
// LevelEditorLayer::rebuildDeathOverlay from 0x46a2d0 to 0x46a4a6 (470 bytes)
//
// 6 xrefs:
// > LevelEditorLayer::toggleLocalDeaths @ 0x46a4ca
// > LevelEditorLayer::toggleGlobalDeaths @ 0x46a4e2
// > LevelEditorLayer::init @ 0x476674
// > DeathStatsPopup::onClearLocal @ 0x76f130
// > DeathStatsPopup::onClearFetched @ 0x76f186
// > DeathStatsPopup::showResult @ 0x76feb0
//
// 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:59 +0000
//
DeathMarkerLayer *__fastcall LevelEditorLayer::rebuildDeathOverlay(LevelEditorLayer *this)
{
int v2; // r0
int v3; // r0
int v4; // r0
int v5; // r0
int v6; // r5
unsigned int v7; // r10
DeathMarkerLayer *v8; // r0
DeathMarkerLayer *result; // r0
char *v10; // [sp+2Ch] [bp-30h] BYREF
int v11; // [sp+30h] [bp-2Ch]
int v12; // [sp+34h] [bp-28h]
char *v13; // [sp+38h] [bp-24h] BYREF
_DWORD *v14; // [sp+3Ch] [bp-20h]
_DWORD *v15; // [sp+40h] [bp-1Ch]
_BYTE v16[16]; // [sp+44h] [bp-18h] BYREF
v2 = *((_DWORD *)this + 353);
if ( v2 )
{
(*(void (__fastcall **)(int))(*(_DWORD *)v2 + 260))(v2);
*((_DWORD *)this + 353) = 0;
}
v3 = *((_DWORD *)this + 354);
if ( v3 )
{
(*(void (__fastcall **)(int))(*(_DWORD *)v3 + 260))(v3);
*((_DWORD *)this + 354) = 0;
}
sub_45E7D8((cocos2d::CCDirector *)v16, *((_DWORD *)this + 609));
if ( LevelEditorLayer::s_showGlobalDeaths )
{
v4 = *((_DWORD *)this + 352);
if ( v4 )
{
v13 = nullptr;
v14 = nullptr;
v15 = nullptr;
*((_BYTE *)this + 1425) = GJGameLevel::dtParseGlobalBlob(v4, v4 + 1316, &v13);
*((_DWORD *)this + 354) = GJBaseGameLayer::addDeathMarkerLayer(
this,
*((_DWORD *)this + 609),
1,
&v13,
0,
v16,
0x80000000,
0x80000000,
0,
0,
0,
0);
std::__vector_base::~__vector_base(&v13);
}
}
if ( LevelEditorLayer::s_showLocalDeaths )
{
v5 = *((_DWORD *)this + 352);
if ( v5 )
{
v10 = nullptr;
v11 = 0;
v12 = 0;
v13 = nullptr;
v14 = nullptr;
v15 = nullptr;
GJGameLevel::scoreStringToVector(v5, v5 + 1288, &v10);
v6 = 8;
v7 = 0;
while ( 1 )
{
v7 += 4;
if ( v7 > (v11 - (int)v10) >> 2 )
break;
if ( v14 == v15 )
{
std::vector::__push_back_slow_path((int)&v13, &v10[v6 - 8]);
}
else
{
if ( v14 )
*v14 = *(_DWORD *)&v10[v6 - 8];
++v14;
}
if ( v14 == v15 )
{
std::vector::__push_back_slow_path((int)&v13, &v10[v6 - 4]);
}
else
{
if ( v14 )
*v14 = *(_DWORD *)&v10[v6 - 4];
++v14;
}
if ( v14 == v15 )
{
std::vector::__push_back_slow_path((int)&v13, &v10[v6]);
}
else
{
if ( v14 )
*v14 = *(_DWORD *)&v10[v6];
++v14;
}
v6 += 16;
}
*((_DWORD *)this + 353) = GJBaseGameLayer::addDeathMarkerLayer(
this,
*((_DWORD *)this + 609),
0,
&v13,
0,
v16,
0x80000000,
0x80000000,
0,
0,
0,
0);
std::__vector_base::~__vector_base(&v13);
std::__vector_base::~__vector_base(&v10);
}
}
v8 = *((DeathMarkerLayer **)this + 353);
if ( v8 )
DeathMarkerLayer::setLabelsVisible(v8, LevelEditorLayer::s_showDeathLabels);
result = *((DeathMarkerLayer **)this + 354);
if ( result )
return (DeathMarkerLayer *)DeathMarkerLayer::setLabelsVisible(result, LevelEditorLayer::s_showDeathLabels);
return result;
}