//
// GJBaseGameLayer::groupStickyObjects from 0x473150 to 0x4731f0 (160 bytes)
//
// 2 xrefs:
// > EditorUI::onGroupSticky @ 0x39cfa6
// > GJBaseGameLayer::assignNewStickyGroups @ 0x473272
//
// 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::groupStickyObjects(GJBaseGameLayer *a1, cocos2d::CCArray *a2)
{
cocos2d::CCArray *v4; // r0
unsigned int v5; // r6
unsigned int v6; // r1
int v7; // r4
cocos2d::CCArray *v8; // r8
int v9; // r0
int v10; // r3
unsigned int i; // r6
cocos2d::CCObject *v12; // r0
cocos2d::CCObject_vtbl *v13; // r3
v4 = (cocos2d::CCArray *)cocos2d::CCArray::count(a2);
v5 = 0;
v7 = 0;
v8 = (cocos2d::CCArray *)cocos2d::CCArray::createWithCapacity(v4, v6);
while ( v5 < cocos2d::CCArray::count(a2) )
{
v9 = cocos2d::CCArray::objectAtIndex(a2, v5);
v10 = *(_DWORD *)(v9 + 732);
if ( v7 )
{
if ( v10 > 0 && v10 != v7 )
{
GJBaseGameLayer::ungroupStickyObjects(a1, a2);
goto LABEL_9;
}
}
else
{
v7 = *(_DWORD *)(v9 + 732);
}
++v5;
}
if ( v7 )
goto LABEL_10;
LABEL_9:
v7 = a1->m_lastUsedLinkedID + 1;
a1->m_lastUsedLinkedID = v7;
LABEL_10:
for ( i = 0; i < cocos2d::CCArray::count(a2); ++i )
{
v12 = (cocos2d::CCObject *)cocos2d::CCArray::objectAtIndex(a2, i);
v13 = v12[17].__vftable;
if ( v13 != (cocos2d::CCObject_vtbl *)((char *)&stru_2DC.st_shndx + 1)
&& v13 != (cocos2d::CCObject_vtbl *)((char *)&stru_2EC.st_name + 1) )
{
v12[14].m_uID = v7;
cocos2d::CCArray::addObject(v8, v12);
}
}
cocos2d::CCDictionary::setObject(a1->m_linkedGroupDict, v8, v7);
}