//
// LevelEditorLayer::removeAllObjectsOfType from 0x7909ac to 0x790b38 (396 bytes)
//
// 3 xrefs:
// > EditorUI::onDeleteStartPos @ 0x7c1dc4
// > EditorUI::onDeleteSelectedType @ 0x7c88e0
// > ??> @ 0xa21a8
//
// 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
//
cocos2d::CCArray *__fastcall LevelEditorLayer::removeAllObjectsOfType(cocos2d::CCArray *this, int a2)
{
__int64 v2; // x22
cocos2d::CCArray *v4; // x23
__int64 v5; // x2
__int64 v6; // x3
unsigned __int64 v7; // x24
_QWORD *v8; // x1
__int64 v9; // x0
__int64 v10; // x27
__int64 v11; // x21
_QWORD *v12; // x25
int v13; // w20
__int64 v14; // x19
__int64 v15; // x20
cocos2d::CCObject *v16; // x1
unsigned int v17; // w19
UndoObject *v18; // x0
GameObject *v19; // x0
bool v20; // cf
unsigned int v21; // w1
if ( a2 != 749 )
{
v2 = (__int64)this;
v4 = (cocos2d::CCArray *)cocos2d::CCArray::create(this);
v5 = *(_QWORD *)(v2 + 13368);
v6 = *(_QWORD *)(v2 + 13376);
if ( v5 != v6 && (v6 - v5) >> 3 )
{
v7 = 0;
do
{
v8 = *(_QWORD **)(v5 + 8 * v7);
if ( v8 )
{
v9 = (__int64)(v8[1] - *v8) >> 3;
if ( (int)v9 > 0 )
{
v10 = 0;
v11 = 4 * ((unsigned int)(v9 - 1) + 1LL);
do
{
v12 = *(_QWORD **)(**(_QWORD **)(v5 + 8 * v7) + 2 * v10);
if ( v12 )
{
v13 = *(_DWORD *)(**(_QWORD **)(*(_QWORD *)(v2 + 13536) + 8 * v7) + v10);
if ( v13 > 0 )
{
v14 = 0;
v15 = 8 * ((unsigned int)(v13 - 1) + 1LL);
do
{
while ( 1 )
{
v16 = *(cocos2d::CCObject **)(*v12 + v14);
v14 += 8;
if ( a2 == *((_DWORD *)v16 + 257) )
break;
if ( v14 == v15 )
goto LABEL_14;
}
cocos2d::CCArray::addObject(v4, v16);
}
while ( v14 != v15 );
LABEL_14:
v5 = *(_QWORD *)(v2 + 13368);
}
}
v10 += 4;
}
while ( v10 != v11 );
v6 = *(_QWORD *)(v2 + 13376);
}
}
++v7;
}
while ( v7 < (v6 - v5) >> 3 );
}
v17 = 0;
v18 = (UndoObject *)UndoObject::createWithArray(v4, 4);
LevelEditorLayer::addToUndoList((cocos2d::CCArray **)v2, v18, 0);
while ( 1 )
{
v20 = v17 >= (unsigned int)cocos2d::CCArray::count(v4);
v21 = v17;
this = v4;
++v17;
if ( v20 )
break;
v19 = (GameObject *)cocos2d::CCArray::objectAtIndex(v4, v21);
LevelEditorLayer::removeObject(v2, v19, 1);
}
}
return this;
}