//
// LevelEditorLayer::removeAllObjects from 0x665928 to 0x665a08 (224 bytes)
//
// 2 xrefs:
// > EditorUI::onDeleteAll @ 0x6be31c
// > ??> @ 0x2df30
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void LevelEditorLayer::removeAllObjects(LevelEditorLayer *a1)
{
float *v1; // x22
EditorUI *m_editorUI; // x0
cocos2d::CCArray *v4; // x0
unsigned int v5; // w1
cocos2d::CCArray *v6; // x20
cocos2d::ccArray *data; // x1
GameObject **arr; // x20
__int64 v9; // x0
char *v10; // x21
GameObject *v11; // x1
float v12; // s0
v1 = &a1->m_varianceValues.__elems_[1975];
m_editorUI = a1->m_editorUI;
*((_BYTE *)v1 + 2680) = 1;
if ( m_editorUI )
EditorUI::deselectAll(m_editorUI);
v4 = (cocos2d::CCArray *)cocos2d::CCArray::count(a1->m_objects);
v6 = (cocos2d::CCArray *)cocos2d::CCArray::createWithCapacity(v4, v5);
cocos2d::CCArray::addObjectsFromArray(v6, a1->m_objects);
if ( v6 )
{
data = v6->data;
if ( data->num )
{
arr = (GameObject **)data->arr;
v9 = 8LL * data->num - 8;
v10 = (char *)arr + v9;
if ( arr <= (GameObject **)((char *)arr + v9) )
{
do
{
v11 = *arr;
if ( !*arr )
break;
++arr;
LevelEditorLayer::removeObject(a1, v11, 1);
}
while ( v10 >= (char *)arr );
}
}
}
cocos2d::CCArray::removeAllObjects(a1->m_redoObjects);
cocos2d::CCArray::removeAllObjects(a1->m_undoObjects);
a1->m_objectCount.value = 0;
v12 = (float)((float)rand() * 4.6566e-10) * 1000.0;
a1->m_objectCount.seed = (int)v12;
a1->m_objectCount.random = (int)v12;
*((_BYTE *)v1 + 2680) = 0;
*((_BYTE *)v1 + 2826) = 1;
}