//
// EditorUI::getGroupCenter from 0x1003ecf98 to 0x1003ed19c (516 bytes)
//
// 11 xrefs:
// > KeyframeGameObject::updateShadowObjects @ 0x10038b1d0
// > EditorUI::repositionObjectsToCenter @ 0x1003eae28
// > EditorUI::onCreateObject @ 0x1003eb77c
// > EditorUI::rotateObjects @ 0x1003ed1f4
// > EditorUI::activateRotationControl @ 0x1003ee404
// > EditorUI::copyObjectsDetailed @ 0x1003ee948
// > EditorUI::activateScaleControl @ 0x1003ef1d8
// > EditorUI::scaleObjects @ 0x1003efa44
// > EditorUI::activateTransformControl @ 0x1003efe34
// > EditorUI::transformObjects @ 0x1003f0220
// > EditorUI::alignObjects @ 0x1003f7a54
//
// 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
//
cocos2d::CCPoint __fastcall EditorUI::getGroupCenter(EditorUI *a1, cocos2d::CCArray *a2, bool a3)
{
__int64 *v3; // x8
__int64 *v6; // x19
GameObject *v7; // x20
__int64 *v8; // x0
__n128 v11; // q0
__n128 v12; // q1
GameObject *v13; // x22
unsigned int v14; // w23
float v15; // s11
float v16; // s12
float v17; // s13
float v18; // s14
GameObject *v19; // x24
float v20; // s8
float v21; // s9
float v22; // s10
float v23; // s0
GameObject *v26; // x10
_QWORD v27[2]; // [xsp+0h] [xbp-80h] BYREF
cocos2d::CCPoint result; // 0:s0.4,4:s1.4
v6 = v3;
if ( (unsigned int)sub_10024A36C((__int64)a2) == 1 )
{
v7 = (GameObject *)sub_10024A388((__int64)a2, 0);
GameObject::updateStartPos(v7);
v8 = (__int64 *)((__int64 (__fastcall *)(GameObject *))v7->getPosition)(v7);
result.x = sub_1000229B8(v6, v8);
return result;
}
if ( (unsigned int)sub_10024A36C((__int64)a2) )
{
v13 = nullptr;
v14 = 0;
v15 = 1000000.0;
v16 = -1000000.0;
v17 = -1000000.0;
v18 = 1000000.0;
do
{
v19 = (GameObject *)sub_10024A388((__int64)a2, v14);
GameObject::updateStartPos(v19);
((void (__fastcall *)(_QWORD *__return_ptr, GameObject *, float, float))v19->getObjectRect_0)(v27, v19, 1.0, 1.0);
v20 = sub_100022C30((float *)v27);
v21 = sub_100022C40((__int64)v27);
v22 = sub_100022C48((__int64)v27);
v23 = sub_100022C58((__int64)v27);
if ( v20 > v16 )
v16 = v20;
if ( v21 < v15 || v15 == 0.0 )
v15 = v21;
if ( v22 > v17 )
v17 = v22;
if ( v23 < v18 || v18 == 0.0 )
v18 = v23;
if ( v13 )
v26 = v13;
else
v26 = v19;
if ( v19->m_hasGroupParent )
{
a3 |= v13 != nullptr;
v13 = v26;
}
++v14;
}
while ( v14 < (unsigned int)sub_10024A36C((__int64)a2) );
if ( v13 != nullptr && !a3 )
{
((void (__fastcall *)(GameObject *))v13->getRealPosition)(v13);
return result;
}
}
else
{
v15 = 1000000.0;
v16 = -1000000.0;
v17 = -1000000.0;
v18 = 1000000.0;
}
v11.n128_f32[0] = v15 + (float)((float)(v16 - v15) * 0.5);
v12.n128_f32[0] = v18 + (float)((float)(v17 - v18) * 0.5);
sub_100022980(v11, v12, v6);
return result;
}