//
// GJBaseGameLayer::calculateColorGroups from 0x5a677c to 0x5a6852 (214 bytes)
//
// 1 xrefs:
// > LevelEditorLayer::getLevelString @ 0x472608
//
// 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:53:21 +0000
//
int __fastcall GJBaseGameLayer::calculateColorGroups(cocos2d::CCArray **this)
{
unsigned int v2; // r4
__int64 v3; // r0
int v4; // r9
int *i; // r4
int v6; // r10
cocos2d::CCObject *Group; // r11
unsigned int j; // r5
int v9; // r0
int v11; // [sp+4h] [bp-Ch] BYREF
_BYTE v12[8]; // [sp+8h] [bp-8h] BYREF
int *v13; // [sp+10h] [bp+0h] BYREF
_DWORD v14[2]; // [sp+14h] [bp+4h] BYREF
v2 = 0;
v14[0] = 0;
v14[1] = 0;
v13 = v14;
while ( v2 < cocos2d::CCArray::count(*(this + 522)) )
{
LODWORD(v3) = cocos2d::CCArray::objectAtIndex(*(this + 522), v2);
v4 = v3;
GameObject::resetColorGroups(v3);
if ( (unsigned int)(*(_DWORD *)(v4 + 892) - 1006) <= 1 )
{
v11 = *(_DWORD *)(v4 + 1284);
std::__tree::__emplace_unique_key_args((int)v12, &v13, &v11, &v11);
}
++v2;
}
GJBaseGameLayer::addRemapTargets((int)this, &v13);
for ( i = v13; i != v14; i = std::__tree_next *>(i) )
{
v6 = i[4];
Group = GJBaseGameLayer::getGroup((GJBaseGameLayer *)this, v6);
for ( j = 0; j < cocos2d::CCArray::count(Group); ++j )
{
v9 = cocos2d::CCArray::objectAtIndex(Group, j);
GameObject::addToColorGroup(v9, v6);
}
}
return std::__tree::~__tree((int)&v13);
}