//
// LevelEditorLayer::recreateGroups from 0x467f96 to 0x4680ce (312 bytes)
//
// 3 xrefs:
// > LevelEditorLayer::onResumePlaytest @ 0x46817c
// > LevelEditorLayer::onPlaytest @ 0x4683ba
// > EditorUI::dynamicGroupUpdate @ 0x48df0c
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:48:58 +0000
//
unsigned int __fastcall LevelEditorLayer::recreateGroups(cocos2d::CCArray **this)
{
int v2; // r5
cocos2d::CCArray *v3; // r0
cocos2d::CCArray *v4; // r0
cocos2d::CCArray *v5; // r0
int v6; // r3
unsigned int v7; // r6
cocos2d::CCArray *AllObjects; // r8
int v9; // r3
int v10; // r5
int v11; // r2
int v12; // r5
int v13; // r3
unsigned int result; // r0
signed int i; // r7
int GroupID; // r0
GJBaseGameLayer::resetMoveOptimizedValue((GJBaseGameLayer *)this);
v2 = 0;
std::__hash_table>,std::__unordered_map_hasher>,std::hash,true>,std::__unordered_map_equal>,std::equal_to,true>,std::allocator>>>::clear((int)(this + 619));
std::__hash_table>,std::__unordered_map_hasher>,std::hash,true>,std::__unordered_map_equal>,std::equal_to,true>,std::allocator>>>::clear((int)(this + 624));
cocos2d::CCArray::removeAllObjects(*(this + 523));
cocos2d::CCArray::addObject(*(this + 523), *(this + 2654));
cocos2d::CCArray::addObject(*(this + 523), *(this + 2655));
do
{
v3 = *(cocos2d::CCArray **)((char *)*(this + 571) + v2);
if ( v3 )
cocos2d::CCArray::removeAllObjects(v3);
v4 = *(cocos2d::CCArray **)((char *)*(this + 574) + v2);
if ( v4 )
cocos2d::CCArray::removeAllObjects(v4);
v5 = *(cocos2d::CCArray **)((char *)*(this + 577) + v2);
if ( v5 )
cocos2d::CCArray::removeAllObjects(v5);
v2 += 4;
}
while ( v2 != 40000 );
v6 = (int)*(this + 2981);
if ( v6 )
{
v9 = *(_DWORD *)(v6 + 52);
if ( v9 )
v10 = *(_DWORD *)(v9 + 272);
else
v10 = 0;
while ( v9 )
{
cocos2d::CCArray::removeAllObjects(*(cocos2d::CCArray **)(v9 + 260));
if ( v10 )
v11 = *(_DWORD *)(v10 + 272);
else
v11 = 0;
v9 = v10;
v10 = v11;
}
}
v7 = 0;
AllObjects = (cocos2d::CCArray *)LevelEditorLayer::getAllObjects((LevelEditorLayer *)this);
while ( 1 )
{
result = cocos2d::CCArray::count(AllObjects);
if ( v7 >= result )
break;
v12 = cocos2d::CCArray::objectAtIndex(AllObjects, v7);
if ( *(__int16 *)(v12 + 1020) > 0 )
{
for ( i = 0; i < *(__int16 *)(v12 + 1020); ++i )
{
GroupID = GameObject::getGroupID((GameObject *)v12, i);
(*((void (__fastcall **)(cocos2d::CCArray **, int, int, int))*this + 169))(this, v12, GroupID, 1);
}
}
v13 = *(_DWORD *)(v12 + 892);
if ( v13 == 1615 )
{
GJBaseGameLayer::addObjectCounter((GJBaseGameLayer *)this, (LabelGameObject *)v12);
}
else if ( v13 == 1816 && *(_BYTE *)(v12 + 1497) )
{
cocos2d::CCArray::addObject(*(this + 523), (cocos2d::CCObject *)v12);
}
++v7;
}
if ( *((_BYTE *)*(this + 521) + 374) )
return GJBaseGameLayer::sortAllGroupsX((GJBaseGameLayer *)this);
return result;
}