//
// GameObject::addToColorGroup from 0x356588 to 0x3565d0 (72 bytes)
//
// 2 xrefs:
// > PlayLayer::optimizeColorGroups @ 0x3163e4
// > GJBaseGameLayer::calculateColorGroups @ 0x488c2c
//
// 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 GameObject::addToColorGroup(GameObject *a1, int a2)
{
int m_colorGroupCount; // r1
int i; // r3
std::array *m_colorGroups; // r2
if ( a1->m_colorGroupCount <= 9 && (unsigned int)(a2 - 1) <= 0x270E )
{
GameObject::createColorGroupContainer(a1, 10);
m_colorGroupCount = a1->m_colorGroupCount;
for ( i = 0; ; ++i )
{
m_colorGroups = a1->m_colorGroups;
if ( i >= m_colorGroupCount )
break;
if ( m_colorGroups->__elems_[i] == a2 )
return;
}
m_colorGroups->__elems_[m_colorGroupCount] = a2;
++a1->m_colorGroupCount;
}
}