//
// SetGroupIDLayer::addGroupID from 0x9769b8 to 0x976a98 (224 bytes)
//
// 2 xrefs:
// > SetGroupIDLayer::onAddGroup @ 0x976a9c
// > ??> @ 0x87cc0
//
// 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 SetGroupIDLayer::addGroupID(SetGroupIDLayer *a1, int a2)
{
GameObject *m_targetObject; // x0
unsigned int v5; // w19
bool v6; // cf
unsigned int v7; // w1
__int64 v8; // x21
GameManager *v9; // x0
GameManager *v10; // x0
m_targetObject = a1->m_targetObject;
a1->m_addedGroup = 1;
if ( m_targetObject )
{
if ( ((unsigned int (__fastcall *)(GameObject *))m_targetObject->addToGroup)(m_targetObject) == 1 )
{
v10 = GameManager::sharedState();
v10->m_levelEditorLayer->addToGroup(v10->m_levelEditorLayer, a1->m_targetObject, a2, 0);
}
}
else
{
v5 = 0;
while ( 1 )
{
v6 = v5 >= (unsigned int)cocos2d::CCArray::count(a1->m_targetObjects);
v7 = v5++;
if ( v6 )
break;
v8 = cocos2d::CCArray::objectAtIndex(a1->m_targetObjects, v7);
if ( (*(unsigned int (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v8 + 1584LL))(v8, (unsigned int)a2) == 1 )
{
v9 = GameManager::sharedState();
v9->m_levelEditorLayer->addToGroup(v9->m_levelEditorLayer, (GameObject *)v8, a2, 0);
}
}
}
SetGroupIDLayer::updateGroupIDButtons(a1);
}