//
// LevelEditorLayer::removeSpecial from 0x66547c to 0x665894 (1048 bytes)
//
// 7 xrefs:
// > LevelEditorLayer::removeObject @ 0x6658e8
// > LevelEditorLayer::handleAction @ 0x672684
// > LevelEditorLayer::handleAction @ 0x672728
// > LevelEditorLayer::refreshSpecial @ 0x672a7c
// > EditorUI::createNewKeyframeAnim @ 0x6bf178
// > EditorUI::onCreateObject @ 0x6c0184
// > ??> @ 0x694c8
//
// 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::removeSpecial(LevelEditorLayer *a1, GameObject *a2)
{
float v2; // s0
float v3; // s1
int m_objectID; // w0
bool v7; // cc
float *v8; // x22
GameObjectClassType m_classType; // w2
int v10; // w0
GameObject *v11; // x23
float v12; // s8
_BOOL4 m_removingAll; // w0
int v14; // w22
int v15; // w0
int v16; // w23
int v17; // w0
EffectGameObject *m_playbackObject; // x0
__int64 v19; // [xsp+48h] [xbp+48h] BYREF
__int64 v20; // [xsp+50h] [xbp+50h] BYREF
if ( a2->m_isStartPos )
{
m_objectID = a2->m_objectID;
v7 = m_objectID <= 1329;
if ( m_objectID != 1329 )
goto LABEL_3;
LABEL_37:
v8 = &a1->m_varianceValues.__elems_[1975];
v16 = a1->m_coinCount.random - a1->m_coinCount.seed - 1;
a1->m_coinCount.value = v16;
v17 = rand();
v3 = 1000.0;
v2 = (float)((float)v17 * 4.6566e-10) * 1000.0;
a1->m_coinCount.seed = (int)v2;
a1->m_coinCount.random = v16 + (int)v2;
goto LABEL_7;
}
v14 = a1->m_objectCount.random - a1->m_objectCount.seed - 1;
a1->m_objectCount.value = v14;
v15 = rand();
v3 = 1000.0;
v2 = (float)((float)v15 * 4.6566e-10) * 1000.0;
a1->m_objectCount.seed = (int)v2;
a1->m_objectCount.random = v14 + (int)v2;
m_objectID = a2->m_objectID;
v7 = m_objectID <= 1329;
if ( m_objectID == 1329 )
goto LABEL_37;
LABEL_3:
if ( v7 )
{
if ( m_objectID != 747 || (v11 = *(GameObject **)&a2[1].m_sQuad.bl.vertices.y) == nullptr )
{
LABEL_35:
v8 = &a1->m_varianceValues.__elems_[1975];
goto LABEL_7;
}
v8 = &a1->m_varianceValues.__elems_[1975];
cocos2d::CCObject::retain(*(cocos2d::CCObject **)&a2[1].m_sQuad.bl.vertices.y);
((void (__fastcall *)(__int64 *__return_ptr, GameObject *))v11->getStartPos)(&v19, v11);
v12 = *((float *)&v19 + 1);
((void (__fastcall *)(__int64 *__return_ptr, GameObject *))a2->getStartPos)(&v20, a2);
m_removingAll = a1->m_removingAll;
a2[1].m_sQuad.bl.texCoords.u = v12 - *((float *)&v20 + 1);
if ( !m_removingAll )
LevelEditorLayer::removeObject(a1, v11, 1);
*(_QWORD *)&a2[1].m_sQuad.bl.vertices.y = 0;
cocos2d::CCObject::release(v11);
LABEL_7:
if ( !a2->m_dontIgnoreDuration )
goto LABEL_8;
goto LABEL_22;
}
if ( m_objectID != 2065 )
{
if ( m_objectID == 3032 )
{
v8 = &a1->m_varianceValues.__elems_[1975];
GJBaseGameLayer::removeKeyframe(a1, (KeyframeGameObject *)a2);
cocos2d::CCArray::removeObject(a1->m_keyframeObjects, a2, 1);
goto LABEL_7;
}
goto LABEL_35;
}
v8 = &a1->m_varianceValues.__elems_[1975];
cocos2d::CCArray::removeObject(a1->m_particleObjects, a2, 1);
if ( !a2->m_dontIgnoreDuration )
{
LABEL_8:
if ( !a2->m_isTrigger )
goto LABEL_9;
LABEL_23:
DrawGridLayer::removeFromEffects(a1->m_drawGridLayer, (EffectGameObject *)a2);
m_classType = a2->m_classType;
if ( m_classType != Effect )
goto LABEL_10;
goto LABEL_24;
}
LABEL_22:
cocos2d::CCPoint::operator=(&a2[1].m_obOffsetPosition.y, v2, v3);
if ( a2->m_isTrigger )
goto LABEL_23;
LABEL_9:
m_classType = a2->m_classType;
if ( m_classType != Effect )
goto LABEL_10;
LABEL_24:
LevelEditorLayer::tryUpdateSpeedObject(a1, (EffectGameObject *)a2, m_classType);
LABEL_10:
v10 = a2->m_objectID;
if ( v10 == 1814 )
goto LABEL_55;
if ( v10 > 1814 )
{
if ( v10 == 2067 )
goto LABEL_55;
if ( v10 <= 2067 )
{
if ( v10 != 1912 )
{
if ( v10 == 2016 )
{
cocos2d::CCArray::removeObject(a1->m_cameraGuideTriggers, a2, 1);
goto LABEL_41;
}
goto LABEL_49;
}
}
else
{
if ( v10 == 3016 )
goto LABEL_55;
if ( v10 == 3642 )
{
DrawGridLayer::removeAudioLineObject(a1->m_drawGridLayer, (AudioLineGuideGameObject *)a2);
goto LABEL_41;
}
if ( v10 != 2068 )
goto LABEL_49;
}
goto LABEL_51;
}
if ( v10 == 1007 )
{
cocos2d::CCArray::removeObject(a1->m_alphaTriggers, a2, 1);
goto LABEL_41;
}
if ( v10 <= 1007 )
{
if ( v10 != 901 )
{
if ( v10 == 1006 )
{
cocos2d::CCArray::removeObject(a1->m_pulseTriggers, a2, 1);
if ( a2->m_isSpawnOrderTrigger )
goto LABEL_17;
goto LABEL_42;
}
goto LABEL_49;
}
LABEL_55:
cocos2d::CCArray::removeObject(a1->m_moveTriggers, a2, 1);
goto LABEL_41;
}
if ( v10 == 1268 )
{
LABEL_51:
cocos2d::CCArray::removeObject(a1->m_spawnTriggers, a2, 1);
goto LABEL_41;
}
if ( v10 >= 1268 && (unsigned int)(v10 - 1346) <= 1 )
goto LABEL_55;
LABEL_49:
if ( GameObject::isColorTrigger(a2) )
cocos2d::CCArray::removeObject(a1->m_colorTriggers, a2, 1);
LABEL_41:
if ( a2->m_isSpawnOrderTrigger )
{
LABEL_17:
cocos2d::CCArray::removeObject(a1->m_spawnOrderObjects, a2, 1);
*((_BYTE *)v8 + 2112) = 1;
if ( a2->m_activateTriggerInEditor )
goto LABEL_43;
goto LABEL_18;
}
LABEL_42:
if ( a2->m_activateTriggerInEditor )
{
LABEL_43:
cocos2d::CCArray::removeObject(a1->m_playtestTriggers, a2, 1);
if ( !a2->m_dontIgnoreDuration )
goto LABEL_44;
goto LABEL_20;
}
LABEL_18:
if ( a2->isSpecialSpawnObject(a2) )
goto LABEL_43;
if ( a2->m_dontIgnoreDuration )
LABEL_20:
cocos2d::CCArray::removeObject(a1->m_durationObjects, a2, 1);
LABEL_44:
m_playbackObject = a1->m_playbackObject;
if ( m_playbackObject && m_playbackObject->m_uniqueID == a2->m_uniqueID )
a1->m_playbackObject = nullptr;
cocos2d::CCArray::removeObject(a1->m_objects, a2, 1);
GJBaseGameLayer::removeFromGroupParents(a1, a2);
GJBaseGameLayer::removeFromGroups(a1, a2);
GJBaseGameLayer::removeFromStickyGroup(a1, a2);
*((_BYTE *)v8 + 2826) = 1;
}