//
// LevelEditorLayer::removeObject from 0x1403f21b0 to 0x1403f22ee (318 bytes)
//
// 4 xrefs:
// > EditorUI::onDelete @ 0x1401b0382
// > LevelEditorLayer::removeSpecial @ 0x1403f5430
// > LevelEditorLayer::breakApartTextObject @ 0x1403fdf80
// > ??> @ 0x140925418
//
// 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:48 +0000
//
// Hidden C++ exception states: #wind=2
void __fastcall LevelEditorLayer::removeObject(__int64 a1, __int64 a2, char a3)
{
__int64 v3; // rsi
cocos2d::CCObject *v5; // r14
cocos2d::CCObject *v6; // rax
unsigned int v7; // ebx
if ( a2 )
{
v3 = a2;
if ( !a3 )
{
++*(_DWORD *)(a1 + 15416);
cocos2d::CCArray::removeAllObjects(*(cocos2d::CCArray **)(a1 + 14920));
v5 = (cocos2d::CCObject *)operator new(0xA0u);
cocos2d::CCObject::CCObject(v5);
*(_QWORD *)v5 = &UndoObject::`vftable';
*((_QWORD *)v5 + 7) = 0;
*((_DWORD *)v5 + 16) = 0;
*((_QWORD *)v5 + 9) = 0;
*((_WORD *)v5 + 40) = 0;
GJTransformState::GJTransformState((__int64)v5 + 84);
v6 = (cocos2d::CCObject *)GameObjectCopy::create(v3);
*((_QWORD *)v5 + 7) = v6;
cocos2d::CCObject::retain(v6);
*((_DWORD *)v5 + 16) = 1;
cocos2d::CCObject::autorelease(v5);
cocos2d::CCArray::removeAllObjects(*(cocos2d::CCArray **)(a1 + 14920));
v7 = 1000;
if ( !*(_BYTE *)(a1 + 14663) )
v7 = 200;
if ( cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 14912)) >= v7 )
cocos2d::CCArray::removeObjectAtIndex(*(cocos2d::CCArray **)(a1 + 14912), 0, 1);
cocos2d::CCArray::addObject(*(cocos2d::CCArray **)(a1 + 14912), v5);
}
LOBYTE(a2) = 1;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v3 + 1160LL))(v3, a2);
GJBaseGameLayer::removeObjectFromSection(a1, v3);
LevelEditorLayer::removeSpecial(a1, v3);
*(_BYTE *)(a1 + 15666) = 1;
}
}