//
// SetupObjectOptionsPopup::onDisableObject from 0x1403ffe70 to 0x1403fff85 (277 bytes)
//
// 2 xrefs:
// > SetupObjectOptionsPopup::init @ 0x1403feca7
// > ??> @ 0x1406d86fc
//
// 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
//
// Hidden C++ exception states: #wind=1
void SetupObjectOptionsPopup::onDisableObject(SetupObjectOptionsPopup *a1, cocos2d::CCObject *a2)
{
GameObject *m_gameObject; // rcx
struct cocos2d::CCArray *m_gameObjects; // rbp
__int64 v5; // rdi
GJBaseGameLayer *v6; // rdi
unsigned int i; // esi
GameObject *v8; // rax
GameObject *v9; // rbx
void *v10; // [rsp+40h] [rbp+8h]
a1->m_noTouch = !a1->m_noTouch;
m_gameObject = a1->m_gameObject;
if ( m_gameObject )
m_gameObjects = cocos2d::CCArray::createWithObject(m_gameObject);
else
m_gameObjects = a1->m_gameObjects;
v5 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v10 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v10);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v5 = qword_1406C2ED8;
}
v6 = *(GJBaseGameLayer **)(v5 + 528);
for ( i = 0; i < cocos2d::CCArray::count(m_gameObjects); ++i )
{
v8 = (GameObject *)cocos2d::CCArray::objectAtIndex(m_gameObjects, i);
v9 = v8;
if ( v6 )
GJBaseGameLayer::removeObjectFromSection(v6, v8);
v9->m_isNoTouch = a1->m_noTouch;
v9->setType(v9, v9->m_savedObjectType);
v9->saveActiveColors(v9);
if ( v6 )
v6->addToSection(v6, v9);
}
}