//
// SetupObjectOptionsPopup::onExtendedCollision from 0x140400770 to 0x14040089a (298 bytes)
//
// 2 xrefs:
// > SetupObjectOptionsPopup::init @ 0x1403ff0e0
// > ??> @ 0x1406d87b0
//
// 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::onExtendedCollision(SetupObjectOptionsPopup *a1, cocos2d::CCObject *a2)
{
__int64 v3; // r14
GJBaseGameLayer *v4; // r14
bool v5; // si
GameObject *m_gameObject; // rbx
GameObject *v7; // rax
GameObject *v8; // rsi
bool m_extendedCollision; // bp
void *v10; // [rsp+50h] [rbp+18h]
v3 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v10 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v10);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v3 = qword_1406C2ED8;
}
v4 = *(GJBaseGameLayer **)(v3 + 528);
if ( v4 )
{
v5 = !a1->m_extendedCollision;
a1->m_extendedCollision = v5;
m_gameObject = a1->m_gameObject;
if ( m_gameObject )
{
if ( m_gameObject->m_hasExtendedCollision != v5 )
{
GJBaseGameLayer::removeObjectFromSection(v4, a1->m_gameObject);
m_gameObject->m_hasExtendedCollision = v5;
v4->addToSection(v4, m_gameObject);
}
}
else if ( cocos2d::CCArray::count(a1->m_gameObjects) )
{
do
{
v7 = (GameObject *)cocos2d::CCArray::objectAtIndex(a1->m_gameObjects, (unsigned int)m_gameObject);
v8 = v7;
m_extendedCollision = a1->m_extendedCollision;
if ( v7->m_hasExtendedCollision != m_extendedCollision )
{
GJBaseGameLayer::removeObjectFromSection(v4, v7);
v8->m_hasExtendedCollision = m_extendedCollision;
v4->addToSection(v4, v8);
}
LODWORD(m_gameObject) = (_DWORD)m_gameObject + 1;
}
while ( (unsigned int)m_gameObject < cocos2d::CCArray::count(a1->m_gameObjects) );
}
}
}