//
// GJBaseGameLayer::calculateColorGroups from 0x488ba0 to 0x488c70 (208 bytes)
//
// 1 xrefs:
// > LevelEditorLayer::getLevelString @ 0x37497a
//
// 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::calculateColorGroups(GJBaseGameLayer *a1)
{
unsigned int v2; // r4
int v3; // r8
int v4; // r8
cocos2d::CCArray *Group; // r11
unsigned int i; // r4
GameObject *v7; // r0
int v8; // [sp+0h] [bp-2Ch] BYREF
_DWORD v9[2]; // [sp+4h] [bp-28h] BYREF
std::set v10; // [sp+Ch] [bp-20h] BYREF
v2 = 0;
std::_Rb_tree,std::less,std::allocator>::_Rb_tree_impl,true>::_Rb_tree_impl(&v10);
while ( v2 < cocos2d::CCArray::count(a1->m_objects) )
{
v3 = cocos2d::CCArray::objectAtIndex(a1->m_objects, v2);
GameObject::resetColorGroups((GameObject *)v3);
if ( (unsigned int)(*(_DWORD *)(v3 + 884) - 1006) <= 1 )
{
v8 = *(_DWORD *)(v3 + 1276);
std::set::insert((int)v9, &v10, &v8);
}
++v2;
}
GJBaseGameLayer::addRemapTargets(a1, &v10);
v9[0] = v10._M_t._M_impl._M_header._M_left;
while ( (std::_Rb_tree_node_base *)v9[0] != &v10._M_t._M_impl._M_header )
{
v4 = *(_DWORD *)(v9[0] + 16);
Group = GJBaseGameLayer::getGroup(a1, v4);
for ( i = 0; i < cocos2d::CCArray::count(Group); ++i )
{
v7 = (GameObject *)cocos2d::CCArray::objectAtIndex(Group, i);
GameObject::addToColorGroup(v7, v4);
}
std::_Rb_tree_const_iterator::operator++(v9);
}
std::_Rb_tree,std::less,std::allocator>::~_Rb_tree((int)&v10);
}