//
// LevelEditorLayer::removeAllObjects from 0x7908c4 to 0x7909a4 (224 bytes)
//
// 2 xrefs:
// > EditorUI::onDeleteAll @ 0x7c1ca4
// > ??> @ 0x451f0
//
// This function is hookable on this platform (idp: arm, 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 12:53:29 +0000
//
__int64 __fastcall LevelEditorLayer::removeAllObjects(LevelEditorLayer *this)
{
char *v1; // x22
EditorUI *v3; // x0
cocos2d::CCArray *v4; // x0
unsigned int v5; // w1
cocos2d::CCArray *v6; // x20
unsigned int *v7; // x1
GameObject **v8; // x20
__int64 v9; // x0
char *v10; // x21
GameObject *v11; // x1
float v12; // s0
v1 = (char *)this + 12288;
*((_BYTE *)this + 14808) = 1;
v3 = *((EditorUI **)this + 1781);
if ( v3 )
EditorUI::deselectAll(v3);
v4 = (cocos2d::CCArray *)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 410));
v6 = (cocos2d::CCArray *)cocos2d::CCArray::createWithCapacity(v4, v5);
cocos2d::CCArray::addObjectsFromArray(v6, *((cocos2d::CCArray **)this + 410));
if ( v6 )
{
v7 = *((unsigned int **)v6 + 7);
if ( *v7 )
{
v8 = *((GameObject ***)v7 + 2);
v9 = 8LL * *v7 - 8;
v10 = (char *)v8 + v9;
if ( v8 <= (GameObject **)((char *)v8 + v9) )
{
do
{
v11 = *v8;
if ( !*v8 )
break;
++v8;
LevelEditorLayer::removeObject((__int64)this, v11, 1);
}
while ( v10 >= (char *)v8 );
}
}
}
cocos2d::CCArray::removeAllObjects(*((cocos2d::CCArray **)this + 1783));
cocos2d::CCArray::removeAllObjects(*((cocos2d::CCArray **)this + 1782));
*((_DWORD *)this + 3570) = 0;
v12 = (float)((float)rand() * 4.6566e-10) * 1000.0;
*((_DWORD *)this + 3569) = (int)v12;
*((_DWORD *)this + 3568) = (int)v12;
v1[2520] = 0;
v1[2650] = 1;
return 1;
}