//
// EditorUI::scaleObjects from 0x1003ef8b4 to 0x1003efbfc (840 bytes)
//
// 3 xrefs:
// > EditorUI::scaleXChanged @ 0x1003ef898
// > EditorUI::scaleYChanged @ 0x1003efc88
// > EditorUI::scaleXYChanged @ 0x1003efd58
//
// 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
//
// local variable allocation has failed, the output may be wrong!
void __fastcall EditorUI::scaleObjects(
EditorUI *a1,
cocos2d::CCArray *a2,
float a3,
float a4,
cocos2d::CCPoint a5,
ObjectScaleType a6,
bool a7)
{
char v7; // w4
char v8; // w19
int v9; // w20
float32x2_t *v10; // x21
unsigned int i; // w24
GameObject *v16; // x26
__int64 v17; // x27
float v18; // s1
float v19; // s0
float v20; // s2
bool v21; // cc
float v22; // s2
bool v23; // cc
_BOOL8 v24; // x0
unsigned int j; // w24
GameObject *v26; // x26
__int64 v27; // x0
float m_pixelScaleX; // s11
float v29; // s12
float v30; // s10
float32x2_t *v31; // x0
float v32; // s11
float32x2_t *v33; // x0
float32x2_t v34; // [xsp+8h] [xbp-98h] BYREF
float32x2_t v35; // [xsp+10h] [xbp-90h] BYREF
float32x2_t *v36; // [xsp+18h] [xbp-88h] BYREF
cocos2d::CCPoint v37; // 0:s0.4,4:s1.4
v8 = v7;
v9 = a7;
v10 = (float32x2_t *)a6;
if ( (unsigned int)sub_10024A36C((__int64)a2) )
{
for ( i = 0; i < (unsigned int)sub_10024A36C((__int64)a2); ++i )
{
v16 = (GameObject *)sub_10024A388((__int64)a2, i);
v35.i32[0] = v16->m_uniqueID;
v36 = &v35;
v17 = sub_1003FC990(&a1->m_objectEditorStates, &v35, &unk_100647441, &v36, &v34);
v18 = 0.25;
v19 = 4.0;
if ( !a1->m_increaseScale )
{
if ( GameObject::isTrigger(v16) )
v19 = 4.0;
else
v19 = 2.0;
v18 = 0.5;
}
if ( v9 == 2 )
goto LABEL_16;
v20 = (float)(int)roundf((float)(*(float *)(v17 + 28) * a3) * 100.0) / 100.0;
v21 = v20 >= v18 && v20 <= v19;
if ( !v21 || (float)(v20 * v16->m_pixelScaleX) == v16->m_scaleX )
return;
if ( v9 != 1 )
{
LABEL_16:
v22 = (float)(int)roundf((float)(*(float *)(v17 + 32) * a4) * 100.0) / 100.0;
v23 = v22 >= v18 && v22 <= v19;
if ( !v23 || (float)(v22 * v16->m_pixelScaleY) == v16->m_scaleY )
return;
}
}
}
v24 = sub_100022A5C((float *)v10, (float *)&dword_10086E8B0);
if ( v24 )
{
EditorUI::getGroupCenter((EditorUI *)v24, a2, 0);
sub_1000229D0(v10, (double *)&v36);
}
if ( (unsigned int)sub_10024A36C((__int64)a2) )
{
for ( j = 0; j < (unsigned int)sub_10024A36C((__int64)a2); ++j )
{
v26 = (GameObject *)sub_10024A388((__int64)a2, j);
v35.i32[0] = v26->m_uniqueID;
v36 = &v35;
v27 = sub_1003FC990(&a1->m_objectEditorStates, &v35, &unk_100647441, &v36, &v34);
m_pixelScaleX = v26->m_pixelScaleX;
v29 = *(float *)(v27 + 28);
v30 = (float)(*(float *)(v27 + 32) * v26->m_pixelScaleY) * a4;
v31 = (float32x2_t *)((__int64 (__fastcall *)(GameObject *))v26->getPosition)(v26);
sub_1000229F0(v31, v10, (float32x2_t *)&v36);
if ( v9 == 2 )
{
*((float *)&v36 + 1) = *((float *)&v36 + 1) * (float)(v30 / v26->m_scaleY);
sub_1000229DC(v10, (float32x2_t *)&v36, &v35);
}
else
{
v32 = (float)(v29 * m_pixelScaleX) * a3;
*(float *)&v36 = *(float *)&v36 * (float)(v32 / v26->m_scaleX);
if ( v9 == 1 )
{
sub_1000229DC(v10, (float32x2_t *)&v36, &v35);
GameObject::updateCustomScaleX(v26, v32);
if ( (v8 & 1) != 0 )
continue;
LABEL_34:
v33 = (float32x2_t *)((__int64 (__fastcall *)(GameObject *))v26->getPosition)(v26);
v37.x = sub_1000229F0(&v35, v33, &v34).f32[0];
EditorUI::moveObject(a1, v26, v37);
continue;
}
*((float *)&v36 + 1) = *((float *)&v36 + 1) * (float)(v30 / v26->m_scaleY);
sub_1000229DC(v10, (float32x2_t *)&v36, &v35);
GameObject::updateCustomScaleX(v26, v32);
}
GameObject::updateCustomScaleY(v26, v30);
if ( (v8 & 1) == 0 )
goto LABEL_34;
}
}
}