//
// EditorUI::scaleObjects from 0x1402007d0 to 0x140200c11 (1089 bytes)
//
// 6 xrefs:
// > EditorUI::scaleXChanged @ 0x1402030cf
// > EditorUI::scaleYChanged @ 0x1402031cf
// > EditorUI::scaleXYChanged @ 0x140203284
// > ??> @ 0x1408a3cac
// > ??> @ 0x1408a3cbc
// > ??> @ 0x14091adc8
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:28:13 +0000
//
int __fastcall EditorUI::scaleObjects(
__int64 a1,
cocos2d::CCArray *a2,
float a3,
float a4,
cocos2d::CCPoint *a5,
int a6,
char a7)
{
unsigned int v9; // edi
struct cocos2d::CCObject *v10; // rbx
float v11; // xmm7_4
float v12; // xmm6_4
__int64 v13; // rbp
int result; // eax
float v15; // xmm1_4
float v16; // xmm1_4
__int64 v17; // rcx
__int64 GroupCenter; // rax
unsigned int v19; // ebp
_QWORD *v20; // rdi
struct cocos2d::CCObject *v21; // rbx
__int64 v22; // rax
float v23; // xmm7_4
float v24; // xmm6_4
__int64 v25; // rax
float v26; // xmm0_4
__int64 v27; // rax
float v28; // xmm1_4
float v29; // xmm0_4
__int64 v30; // rax
float v31; // xmm1_4
__int64 v32; // rax
unsigned __int8 v33[8]; // [rsp+20h] [rbp-F8h] BYREF
float v34; // [rsp+28h] [rbp-F0h] BYREF
float v35; // [rsp+2Ch] [rbp-ECh]
_BYTE v36[8]; // [rsp+30h] [rbp-E8h] BYREF
_BYTE v37[16]; // [rsp+38h] [rbp-E0h] BYREF
_BYTE v38[24]; // [rsp+48h] [rbp-D0h] BYREF
v9 = 0;
if ( cocos2d::CCArray::count(a2) )
{
while ( 1 )
{
v10 = cocos2d::CCArray::objectAtIndex(a2, v9);
*(_DWORD *)v33 = *((_DWORD *)v10 + 231);
v11 = 0.5;
v12 = 2.0;
v13 = *(_QWORD *)sub_1401A8A10((_QWORD *)(a1 + 464), (__int64)v37, v33);
if ( *(_BYTE *)(a1 + 739) )
break;
if ( (unsigned __int8)GameObject::isTrigger(v10) )
goto LABEL_5;
LABEL_6:
if ( a6 == 2 )
goto LABEL_11;
result = (int)roundf((float)(a3 * *(float *)(v13 + 28)) * 100.0);
v15 = (float)result / 100.0;
if ( v11 > v15 || v15 > v12 || (float)(v15 * *((float *)v10 + 330)) == *((float *)v10 + 290) )
return result;
if ( a6 != 1 )
{
LABEL_11:
result = (int)roundf((float)(a4 * *(float *)(v13 + 32)) * 100.0);
v16 = (float)result / 100.0;
if ( v11 > v16 || v16 > v12 || (float)(v16 * *((float *)v10 + 331)) == *((float *)v10 + 291) )
return result;
}
if ( ++v9 >= cocos2d::CCArray::count(a2) )
goto LABEL_15;
}
v11 = 0.25;
LABEL_5:
v12 = 4.0;
goto LABEL_6;
}
LABEL_15:
if ( cocos2d::CCPoint::equals(a5, (const struct cocos2d::CCPoint *)&unk_14090A7A8) )
{
GroupCenter = EditorUI::getGroupCenter(v17, v37, a2, 0);
cocos2d::CCPoint::operator=(a5, GroupCenter);
}
v19 = 0;
result = cocos2d::CCArray::count(a2);
if ( result )
{
v20 = (_QWORD *)(a1 + 464);
do
{
v21 = cocos2d::CCArray::objectAtIndex(a2, v19);
*(_DWORD *)v33 = *((_DWORD *)v21 + 231);
v22 = sub_1401A8A10(v20, (__int64)v38, v33);
v23 = (float)(*(float *)(*(_QWORD *)v22 + 28LL) * *((float *)v21 + 330)) * a3;
v24 = (float)(*(float *)(*(_QWORD *)v22 + 32LL) * *((float *)v21 + 331)) * a4;
v25 = (*(__int64 (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v21 + 200LL))(v21);
cocos2d::CCPoint::operator-(v25, &v34, a5);
if ( a6 != 2 )
v34 = v34 * (float)(v23 / *((float *)v21 + 290));
if ( a6 != 1 )
v35 = v35 * (float)(v24 / *((float *)v21 + 291));
cocos2d::CCPoint::operator+(a5, v36, &v34);
if ( a6 != 2 )
{
v26 = roundf(v23 * 1000.0);
*((_DWORD *)v21 + 16) = 0;
v27 = *(_QWORD *)v21;
v28 = (float)(int)v26 / 1000.0;
*((float *)v21 + 290) = v28;
*((float *)v21 + 249) = v28;
(*(void (__fastcall **)(struct cocos2d::CCObject *))(v27 + 1288))(v21);
*((_BYTE *)v21 + 848) = 1;
*((_BYTE *)v21 + 872) = 1;
}
if ( a6 != 1 )
{
v29 = roundf(v24 * 1000.0);
*((_DWORD *)v21 + 17) = 0;
v30 = *(_QWORD *)v21;
v31 = (float)(int)v29 / 1000.0;
*((float *)v21 + 291) = v31;
*((float *)v21 + 250) = v31;
(*(void (__fastcall **)(struct cocos2d::CCObject *))(v30 + 1296))(v21);
*((_BYTE *)v21 + 848) = 1;
*((_BYTE *)v21 + 872) = 1;
}
if ( !a7 )
{
v32 = (*(__int64 (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v21 + 200LL))(v21);
cocos2d::CCPoint::operator-(v36, v37, v32);
EditorUI::moveObject(a1, (__int64)v21, (__int64)v37);
}
++v19;
result = cocos2d::CCArray::count(a2);
v20 = (_QWORD *)(a1 + 464);
}
while ( v19 < result );
}
return result;
}