//
// GJBaseGameLayer::removeObjectFromSection from 0x473340 to 0x47349c (348 bytes)
//
// 10 xrefs:
// > PlayLayer::removeCheckpoint @ 0x314988
// > LevelEditorLayer::removePlayerCollisionBlock @ 0x36876a
// > LevelEditorLayer::removePlayerCollisionBlock @ 0x36877a
// > LevelEditorLayer::removeObject @ 0x36ac2c
// > LevelEditorLayer::handleAction @ 0x37172e
// > LevelEditorLayer::handleAction @ 0x37178a
// > GJBaseGameLayer::reorderObjectSection @ 0x4734a2
// > GJBaseGameLayer::updateExtendedCollision @ 0x473c78
// > GJBaseGameLayer::addUIObject @ 0x4823be
// > SetupObjectOptionsPopup::onDisableObject @ 0x508ae8
//
// 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::removeObjectFromSection(GJBaseGameLayer *a1, GameObject *a2)
{
int m_outerSectionIndex; // r3
int m_middleSectionIndex; // r2
int m_someOtherIndex; // r7
int *m_start; // r6
std::vector *v6; // r4
GameObject **v7; // r5
int v8; // r3
int m_innerSectionIndex; // r6
int v10; // r2
int v11; // r5
GameObject **v12; // r4
int v13; // r3
std::vector **v14; // r4
int v15; // r2
int *v16; // r0
int *v17; // r4
int v18; // r5
int v19; // r3
int v20; // r3
int v21; // r2
GJBaseGameLayer_vtbl *v22; // r3
int v23; // r3
int v24; // r2
int *v25; // r7
std::vector *v26; // r4
GameObject **v27; // r5
int v28; // r3
unsigned int v29; // r2
std::uintptr_t *m_bitptr; // r1
m_outerSectionIndex = a2->m_outerSectionIndex;
if ( m_outerSectionIndex >= 0 )
{
m_middleSectionIndex = a2->m_middleSectionIndex;
m_someOtherIndex = a2->m_someOtherIndex;
m_start = a1->m_sectionSizes.m_start[m_outerSectionIndex]->m_start;
v6 = a1->m_sections.m_start[m_outerSectionIndex]->m_start[m_middleSectionIndex];
v7 = v6->m_start;
v8 = m_start[m_middleSectionIndex] - 1;
m_start[m_middleSectionIndex] = v8;
v7[m_someOtherIndex] = v7[v8];
v6->m_start[a2->m_someOtherIndex]->m_someOtherIndex = a2->m_someOtherIndex;
if ( a2->m_objectID == 1816 )
{
m_innerSectionIndex = a2->m_innerSectionIndex;
if ( !a2->m_hasExtendedCollision )
{
v13 = a2->m_outerSectionIndex;
v14 = a1->m_collisionBlockSections.m_start;
v15 = a2->m_middleSectionIndex;
v16 = a1->m_collisionBlockSectionSizes.m_start[v13]->m_start;
v17 = (int *)v14[v13]->m_start[v15];
v18 = *v17;
v19 = v16[v15] - 1;
v16[v15] = v19;
*(_DWORD *)(v18 + 4 * m_innerSectionIndex) = *(_DWORD *)(v18 + 4 * v19);
v20 = a2->m_innerSectionIndex;
v21 = *v17;
LABEL_10:
*(_DWORD *)(*(_DWORD *)(v21 + 4 * v20) + 524) = v20;
return;
}
v10 = 11488;
v11 = 11500;
v12 = a1->m_calcCollisionBlockObjects.m_start;
LABEL_9:
v22 = (GJBaseGameLayer_vtbl *)(*(char **)((char *)&a1->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable
+ v11)
- 1);
*(GJBaseGameLayer_vtbl **)((char *)&a1->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable
+ v11) = v22;
v12[m_innerSectionIndex] = v12[(_DWORD)v22];
v20 = a2->m_innerSectionIndex;
v21 = *(int *)((char *)&a1->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable
+ v10);
goto LABEL_10;
}
if ( a2->m_objectType == Decoration )
return;
m_innerSectionIndex = a2->m_innerSectionIndex;
if ( a2->m_hasExtendedCollision )
{
v10 = 11472;
v11 = 11484;
v12 = a1->m_calcNonEffectObjects.m_start;
goto LABEL_9;
}
v23 = a2->m_outerSectionIndex;
v24 = a2->m_middleSectionIndex;
v25 = a1->m_nonEffectObjectsSizes.m_start[v23]->m_start;
v26 = a1->m_nonEffectObjects.m_start[v23]->m_start[v24];
v27 = v26->m_start;
v28 = v25[v24] - 1;
v25[v24] = v28;
v27[m_innerSectionIndex] = v27[v28];
v26->m_start[a2->m_innerSectionIndex]->m_innerSectionIndex = a2->m_innerSectionIndex;
v29 = a2->m_middleSectionIndex;
m_bitptr = a1->m_nonEffectObjectsFlags.m_start[a2->m_outerSectionIndex]->m_start.m_bitptr;
m_bitptr[v29 >> 5] |= 1 << (v29 & 0x1F);
}
}