//
// EditorUI::scaleObjects from 0x10003f6d0 to 0x10003fcb7 (1511 bytes)
//
// 6 xrefs:
// > EditorUI::scaleXChanged @ 0x10003f6ba
// > sub_10003FCC0 @ 0x10003fd51
// > EditorUI::scaleYChanged @ 0x10003fdea
// > sub_10003FE00 @ 0x10003fe91
// > EditorUI::scaleXYChanged @ 0x10003ff52
// > sub_10003FF70 @ 0x100040020
//
// 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; // r8
cocos2d::CCArray *v8; // r15
unsigned int v9; // ebx
GameObject *v10; // r15
__int64 v11; // r12
float v12; // xmm0_4
__m128 v13; // xmm2
__m128 v14; // xmm3
__int64 v15; // r14
unsigned int v16; // r13d
GameObject *v17; // rbx
__int64 v18; // rax
__int64 v19; // rax
__int64 v20; // r12
__int64 v21; // xmm1_8
cocos2d::CCPoint v22; // xmm0_8
__int64 v23; // rax
GameObject *v24; // r15
__int64 v25; // r12
float v26; // xmm0_4
__m128 v27; // xmm2
__m128 v28; // xmm3
__m128 v29; // xmm2
__m128 v30; // xmm3
GameObject *v31; // r15
__int64 v32; // r12
float v33; // xmm0_4
__m128 v34; // xmm2
__m128 v35; // xmm3
float v36; // xmm2_4
std::unordered_map *p_m_objectEditorStates; // [rsp+8h] [rbp-88h]
char v38; // [rsp+14h] [rbp-7Ch]
_BYTE v39[8]; // [rsp+18h] [rbp-78h] BYREF
__int64 v40; // [rsp+20h] [rbp-70h]
int v41; // [rsp+2Ch] [rbp-64h]
cocos2d::CCArray *v42; // [rsp+30h] [rbp-60h]
EditorUI *v43; // [rsp+38h] [rbp-58h]
int m_uniqueID; // [rsp+40h] [rbp-50h] BYREF
float v45; // [rsp+48h] [rbp-48h]
float v46; // [rsp+4Ch] [rbp-44h]
std::unordered_map *v47; // [rsp+50h] [rbp-40h]
float v48; // [rsp+5Ch] [rbp-34h]
_QWORD v49[6]; // [rsp+60h] [rbp-30h] BYREF
v38 = v7;
v41 = a7;
v40 = a6;
v45 = a4;
v46 = a3;
v8 = a2;
v43 = a1;
v42 = a2;
if ( !(unsigned int)sub_100720070(a2) )
{
LABEL_12:
v15 = v40;
if ( (unsigned __int8)sub_10028CDB0(v40) )
{
EditorUI::getGroupCenter((EditorUI *)v49, (cocos2d::CCArray *)&qword_10099EC08, (bool)v8);
sub_10028CC90(v15, v49);
}
if ( !(unsigned int)sub_100720070(v8) )
return;
p_m_objectEditorStates = &v43->m_objectEditorStates;
v16 = 0;
while ( 1 )
{
v17 = (GameObject *)sub_1007200C0(v42, v16);
m_uniqueID = v17->m_uniqueID;
v49[0] = &m_uniqueID;
v18 = sub_100056050(p_m_objectEditorStates, &m_uniqueID, &unk_10081561F, v49, v39);
v48 = *(float *)(v18 + 28) * v17->m_pixelScaleX;
*(float *)&v47 = *(float *)(v18 + 32) * v17->m_pixelScaleY;
v19 = ((__int64 (__fastcall *)(GameObject *, float, double, double))v17->getPosition)(
v17,
*(float *)&v47,
*(double *)&a4,
*(double *)&a5);
v20 = v40;
sub_10028CD00(v49, v19, v40);
v21 = (unsigned int)v47;
a4 = *(float *)&v47 * v45;
if ( v41 == 2 )
{
*((float *)v49 + 1) = (float)(a4 / v17->m_scaleY) * *((float *)v49 + 1);
*(float *)&v47 = *(float *)&v47 * v45;
sub_10028CCE0(&m_uniqueID, v20);
}
else
{
v48 = v48 * v46;
*(float *)v49 = (float)(v48 / v17->m_scaleX) * *(float *)v49;
if ( v41 == 1 )
{
sub_10028CCE0(&m_uniqueID, v40);
v22 = (cocos2d::CCPoint)LODWORD(v48);
GameObject::updateCustomScaleX(v17, v48);
if ( !v38 )
goto LABEL_24;
goto LABEL_16;
}
*((float *)v49 + 1) = (float)(a4 / v17->m_scaleY) * *((float *)v49 + 1);
*(float *)&v47 = *(float *)&v47 * v45;
sub_10028CCE0(&m_uniqueID, v40);
GameObject::updateCustomScaleX(v17, v48);
}
v22 = (cocos2d::CCPoint)(unsigned int)v47;
GameObject::updateCustomScaleY(v17, *(float *)&v47);
if ( !v38 )
{
LABEL_24:
v23 = ((__int64 (__fastcall *)(GameObject *, double, double))v17->getPosition)(
v17,
*(double *)&v22,
*(double *)&a4);
sub_10028CD00(v39, &m_uniqueID, v23);
EditorUI::moveObject(v43, v17, v22);
}
LABEL_16:
if ( ++v16 >= (unsigned int)sub_100720070(v42) )
return;
}
}
v47 = &v43->m_objectEditorStates;
v9 = 0;
if ( v41 == 2 )
{
while ( 1 )
{
v24 = (GameObject *)sub_1007200C0(v8, v9);
m_uniqueID = v24->m_uniqueID;
v49[0] = &m_uniqueID;
v25 = sub_100056050(v47, &m_uniqueID, &unk_10081561F, v49, v39);
v26 = 4.0;
*(_QWORD *)&a4 = 1048576000;
if ( !v43->m_increaseScale )
{
v26 = 4.0;
if ( !GameObject::isTrigger(v24) )
v26 = 2.0;
*(_QWORD *)&a4 = 1056964608;
}
v27 = (__m128)*(unsigned int *)(v25 + 32);
v27.f32[0] = (float)(v27.f32[0] * v45) * 100.0;
v28 = _mm_or_ps(_mm_and_ps(v27, (__m128)xmmword_1008150B0), (__m128)xmmword_1008150C0);
v28.f32[0] = v28.f32[0] + v27.f32[0];
a5 = (cocos2d::CCPoint)_mm_cvtepi32_ps(_mm_cvttps_epi32(_mm_round_ss((__m128)0LL, v28, 11))).u64[0];
a5.x = a5.x / 100.0;
if ( a4 > a5.x )
break;
if ( a5.x > v26 )
break;
a5.x = a5.x * v24->m_pixelScaleY;
if ( a5.x == v24->m_scaleY )
break;
++v9;
v8 = v42;
if ( v9 >= (unsigned int)sub_100720070(v42) )
goto LABEL_12;
}
}
else if ( v41 == 1 )
{
while ( 1 )
{
v10 = (GameObject *)sub_1007200C0(v8, v9);
m_uniqueID = v10->m_uniqueID;
v49[0] = &m_uniqueID;
v11 = sub_100056050(v47, &m_uniqueID, &unk_10081561F, v49, v39);
v12 = 4.0;
*(_QWORD *)&a4 = 1048576000;
if ( !v43->m_increaseScale )
{
v12 = 4.0;
if ( !GameObject::isTrigger(v10) )
v12 = 2.0;
*(_QWORD *)&a4 = 1056964608;
}
v13 = (__m128)*(unsigned int *)(v11 + 28);
v13.f32[0] = (float)(v13.f32[0] * v46) * 100.0;
v14 = _mm_or_ps(_mm_and_ps(v13, (__m128)xmmword_1008150B0), (__m128)xmmword_1008150C0);
v14.f32[0] = v14.f32[0] + v13.f32[0];
a5 = (cocos2d::CCPoint)_mm_cvtepi32_ps(_mm_cvttps_epi32(_mm_round_ss((__m128)0LL, v14, 11))).u64[0];
a5.x = a5.x / 100.0;
if ( a4 > a5.x )
break;
if ( a5.x > v12 )
break;
a5.x = a5.x * v10->m_pixelScaleX;
if ( a5.x == v10->m_scaleX )
break;
++v9;
v8 = v42;
if ( v9 >= (unsigned int)sub_100720070(v42) )
goto LABEL_12;
}
}
else
{
while ( 1 )
{
v31 = (GameObject *)sub_1007200C0(v8, v9);
m_uniqueID = v31->m_uniqueID;
v49[0] = &m_uniqueID;
v32 = sub_100056050(v47, &m_uniqueID, &unk_10081561F, v49, v39);
v33 = 4.0;
*(_QWORD *)&a4 = 1048576000;
if ( !v43->m_increaseScale )
{
v33 = 4.0;
if ( !GameObject::isTrigger(v31) )
v33 = 2.0;
*(_QWORD *)&a4 = 1056964608;
}
v34 = (__m128)*(unsigned int *)(v32 + 28);
v34.f32[0] = (float)(v34.f32[0] * v46) * 100.0;
v35 = _mm_or_ps(_mm_and_ps(v34, (__m128)xmmword_1008150B0), (__m128)xmmword_1008150C0);
v35.f32[0] = v35.f32[0] + v34.f32[0];
v36 = _mm_cvtepi32_ps(_mm_cvttps_epi32(_mm_round_ss((__m128)0LL, v35, 11))).f32[0] / 100.0;
if ( a4 > v36 )
break;
if ( v36 > v33 )
break;
if ( (float)(v36 * v31->m_pixelScaleX) == v31->m_scaleX )
break;
v29 = (__m128)*(unsigned int *)(v32 + 32);
v29.f32[0] = (float)(v29.f32[0] * v45) * 100.0;
v30 = _mm_or_ps(_mm_and_ps(v29, (__m128)xmmword_1008150B0), (__m128)xmmword_1008150C0);
v30.f32[0] = v30.f32[0] + v29.f32[0];
a5 = (cocos2d::CCPoint)_mm_cvtepi32_ps(_mm_cvttps_epi32(_mm_round_ss((__m128)0LL, v30, 11))).u64[0];
a5.x = a5.x / 100.0;
if ( a4 > a5.x )
break;
if ( a5.x > v33 )
break;
a5.x = a5.x * v31->m_pixelScaleY;
if ( a5.x == v31->m_scaleY )
break;
++v9;
v8 = v42;
if ( v9 >= (unsigned int)sub_100720070(v42) )
goto LABEL_12;
}
}
}