//
// GJBaseGameLayer::updateObjectSection from 0x8614c8 to 0x8615fc (308 bytes)
//
// 4 xrefs:
// > LevelEditorLayer::updateObjectSection @ 0x65b4f0
// > ??> @ 0x59b98
// > ??> @ 0x1148a48
// > ??> @ 0x1190738
//
// 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 GJBaseGameLayer::updateObjectSection(GJBaseGameLayer *a1, GameObject *a2)
{
int m_outerSectionIndex; // w3
double m_positionX; // d0
int v4; // w19
double m_positionY; // d0
int v6; // w2
int v9; // w0
int m_middleSectionIndex; // w0
m_outerSectionIndex = a2->m_outerSectionIndex;
if ( m_outerSectionIndex < 0 )
return;
m_positionX = a2->m_positionX;
if ( m_positionX <= 0.0 )
{
v4 = 0;
LABEL_5:
m_positionY = a2->m_positionY;
if ( m_positionY > 0.0 )
goto LABEL_6;
goto LABEL_14;
}
if ( m_positionX < 10000000.0 )
{
v4 = (int)(m_positionX * a1->m_sectionXFactor);
goto LABEL_5;
}
v4 = (int)(float)(a1->m_sectionXFactor * 10000000.0);
m_positionY = a2->m_positionY;
if ( m_positionY > 0.0 )
{
LABEL_6:
if ( m_positionY < 10000000.0 )
v6 = (int)(m_positionY * a1->m_sectionYFactor);
else
v6 = (int)(float)(a1->m_sectionYFactor * 10000000.0);
if ( v4 != m_outerSectionIndex )
goto LABEL_9;
LABEL_15:
if ( v6 == a2->m_middleSectionIndex )
return;
goto LABEL_9;
}
LABEL_14:
v6 = 0;
if ( v4 == m_outerSectionIndex )
goto LABEL_15;
LABEL_9:
GJBaseGameLayer::reorderObjectSection(a1, a2);
if ( a2->m_isActivated )
{
v9 = a2->m_outerSectionIndex;
if ( v9 > a1->m_rightSectionIndex
|| v9 < a1->m_leftSectionIndex
|| (m_middleSectionIndex = a2->m_middleSectionIndex, m_middleSectionIndex > a1->m_topSectionIndex)
|| m_middleSectionIndex < a1->m_bottomSectionIndex )
{
cocos2d::CCDictionary::setObject(a1->m_objectsToDeactivate, a2, (unsigned int)a2->m_uniqueID);
a2->m_unk3ee = 1;
}
}
}