//
// GJScaleControl::loadValues from 0x1003ef3e8 to 0x1003ef7e8 (1024 bytes)
//
// 1 xrefs:
// > EditorUI::updateScaleControl @ 0x1003ef3e4
//
// 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 __fastcall GJScaleControl::loadValues(
GJScaleControl *a1,
GameObject *a2,
cocos2d::CCArray *a3,
std::unordered_map *a4)
{
__int128 v8; // q0
unsigned int v9; // w22
float32x2_t *v10; // x24
__int64 v11; // x0
float32x2_t v12; // d0
__int128 v13; // q2
__int128 v14; // q3
float v15; // s1
float v17; // s8
float v18; // s9
Slider *m_sliderY; // x0
float m_lowerBound; // s0
float v21; // s0
unsigned int v27; // w22
GameObject *v28; // x24
__int64 v29; // x25
float v30; // s9
int m_senderTag; // w8
_BOOL8 v32; // x20
_BOOL8 v33; // x21
__int64 v34; // x22
__int64 v35; // x20
float32x2_t *v36; // x19
__n128 v37; // q1
__n128 v38; // q0
double v39; // d0
__int128 v40; // [xsp+0h] [xbp-A0h]
__int128 v41; // [xsp+10h] [xbp-90h]
float32x2_t v42; // [xsp+10h] [xbp-90h]
float v43; // [xsp+10h] [xbp-90h]
float32x2_t v44; // [xsp+2Ch] [xbp-74h] BYREF
char v45; // [xsp+37h] [xbp-69h] BYREF
float32x2_t *v46; // [xsp+38h] [xbp-68h] BYREF
a1->m_scale1Lock = 1;
if ( a3 && (unsigned int)sub_10024A36C((__int64)a3) )
{
if ( (unsigned int)sub_10024A36C((__int64)a3) )
{
v9 = 0;
LODWORD(v8) = -1.0;
v41 = v8;
LODWORD(v8) = -1.0;
v40 = v8;
do
{
v10 = (float32x2_t *)sub_10024A388((__int64)a3, v9);
v44.i32[0] = v10[114].i32[1];
v46 = &v44;
v11 = sub_1003FC990(a4, &v44, &unk_100647441, &v46, &v45);
v12 = vdiv_f32(v10[144], v10[164]);
v14 = v40;
v13 = v41;
if ( *(float *)&v41 == v12.f32[0] )
v15 = *(float *)&v41;
else
v15 = -2.0;
if ( *(float *)&v41 == -1.0 )
*(float *)&v13 = v12.f32[0];
else
*(float *)&v13 = v15;
v41 = v13;
if ( *(float *)&v40 == -1.0 )
{
LODWORD(v14) = v12.i32[1];
}
else if ( *(float *)&v40 != v12.f32[1] )
{
LODWORD(v14) = -2.0;
}
v40 = v14;
*(float32x2_t *)(v11 + 28) = v12;
++v9;
}
while ( v9 < (unsigned int)sub_10024A36C((__int64)a3) );
_D2 = (float32x2_t)__PAIR64__(v40, v41);
}
else
{
__asm { FMOV V2.2S, #-1.0 }
}
__asm { FMOV V1.2S, #1.0 }
v42 = (float32x2_t)vbsl_s8((int8x8_t)vceq_f32(_D2, (float32x2_t)0xC0000000C0000000LL), _D1, (int8x8_t)_D2);
if ( (unsigned int)sub_10024A36C((__int64)a3) )
{
v27 = 0;
do
{
v28 = (GameObject *)sub_10024A388((__int64)a3, v27);
v44.i32[0] = v28->m_uniqueID;
v46 = &v44;
v29 = sub_1003FC990(a4, &v44, &unk_100647441, &v46, &v45);
GameObjectEditorState::loadValues((GameObjectEditorState *)(v29 + 20), v28);
*(float32x2_t *)(v29 + 28) = vdiv_f32(*(float32x2_t *)(v29 + 28), v42);
++v27;
}
while ( v27 < (unsigned int)sub_10024A36C((__int64)a3) );
}
v18 = 1.0;
Slider::setValue(
a1->m_sliderX,
fmaxf(fminf((float)(v42.f32[0] - a1->m_lowerBound) / (float)(a1->m_upperBound - a1->m_lowerBound), 1.0), 0.0));
m_sliderY = a1->m_sliderY;
m_lowerBound = a1->m_lowerBound;
v17 = v42.f32[1];
}
else
{
if ( !a2 )
{
v17 = -1.0;
v21 = -1.0;
goto LABEL_26;
}
v42.f32[0] = a2->m_scaleX / a2->m_pixelScaleX;
v17 = a2->m_scaleY / a2->m_pixelScaleY;
v18 = 1.0;
Slider::setValue(
a1->m_sliderX,
fmaxf(fminf((float)(v42.f32[0] - a1->m_lowerBound) / (float)(a1->m_upperBound - a1->m_lowerBound), 1.0), 0.0));
m_sliderY = a1->m_sliderY;
m_lowerBound = a1->m_lowerBound;
}
Slider::setValue(
m_sliderY,
fmaxf(fminf((float)(v17 - m_lowerBound) / (float)(a1->m_upperBound - m_lowerBound), v18), 0.0));
v21 = v42.f32[0];
LABEL_26:
v43 = v21;
if ( v21 >= v17 )
v30 = v21;
else
v30 = v17;
Slider::setValue(
a1->m_sliderXY,
fmaxf(fminf((float)(v30 - a1->m_lowerBound) / (float)(a1->m_upperBound - a1->m_lowerBound), 1.0), 0.0));
GJScaleControl::updateLabelX(a1, v43);
GJScaleControl::updateLabelY(a1, v17);
GJScaleControl::updateLabelXY(a1, v30);
a1->m_valueX = v43;
a1->m_valueY = v17;
m_senderTag = a1->m_senderTag;
v32 = m_senderTag == 30;
v33 = m_senderTag != 30;
if ( m_senderTag == 30 )
v34 = 416;
else
v34 = 424;
((void (__fastcall *)(Slider *, _BOOL8))a1->m_sliderXY->setVisible)(a1->m_sliderXY, v33);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _BOOL8))a1->m_scaleLabel->setVisible)(a1->m_scaleLabel, v33);
((void (__fastcall *)(Slider *, _BOOL8))a1->m_sliderX->setVisible)(a1->m_sliderX, v32);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _BOOL8))a1->m_scaleXLabel->setVisible)(a1->m_scaleXLabel, v32);
((void (__fastcall *)(Slider *, _BOOL8))a1->m_sliderY->setVisible)(a1->m_sliderY, v32);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _BOOL8))a1->m_scaleYLabel->setVisible)(a1->m_scaleYLabel, v32);
v35 = ((__int64 (__fastcall *)(CCMenuItemSpriteExtra *))a1->m_scaleLockButton->getParent)(a1->m_scaleLockButton);
v36 = (float32x2_t *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)((char *)&a1->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable
+ v34)
+ 192LL))(*(GJScaleControl_vtbl **)((char *)&a1->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable
+ v34));
v37.n128_u32[0] = 1114636288;
v38.n128_u32[0] = 0;
sub_100022980(v38, v37, &v44);
*(float32x2_t *)&v39 = sub_1000229DC(v36, &v44, (float32x2_t *)&v46);
(*(void (__fastcall **)(__int64, float32x2_t **, double))(*(_QWORD *)v35 + 184LL))(v35, &v46, v39);
}