//
// GJScaleControl::ccTouchMoved from 0x386edc to 0x387152 (630 bytes)
//
// 1 xrefs:
// > `non-virtual thunk to'GJScaleControl::ccTouchMoved @ 0x387164
//
// 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 GJScaleControl::ccTouchMoved(GJScaleControl *a1, cocos2d::CCTouch *a2, cocos2d::CCEvent *a3)
{
Slider *m_sliderY; // r5
float Value; // r7
float v8; // r0
float v9; // r0
float v10; // s16
float v11; // r0
float m_valueX; // s15
float m_valueY; // s14
float v14; // s17
_BOOL4 v15; // r3
int m_scaleButtonType; // r6
float v17; // s14
float v18; // s14
GJScaleControlDelegate *m_delegate; // r0
GJScaleControlDelegate_vtbl *v20; // r2
float v21; // s18
Slider *m_sliderXY; // r5
GJScaleControl *v23; // r0
float v24; // r1
Slider *m_sliderX; // r5
float v26; // r0
float v27; // r1
if ( a1->m_touchID != a2->m_nId )
return;
if ( a1->m_scaleButtonType )
{
if ( a1->m_scaleButtonType == Y )
m_sliderY = a1->m_sliderY;
else
m_sliderY = a1->m_sliderXY;
}
else
{
m_sliderY = a1->m_sliderX;
}
Value = Slider::getValue(m_sliderY);
m_sliderY->ccTouchMoved(m_sliderY, a2, a3);
v8 = Slider::getValue(m_sliderY);
v9 = GJScaleControl::scaleFromValue(a1, v8);
v10 = v9;
if ( a1->m_scale1Lock && v9 > 0.97 && v9 < 1.03 )
{
v11 = GJScaleControl::valueFromScale(a1, 1.0);
v10 = 1.0;
Slider::setValue(m_sliderY, v11);
}
if ( a1->m_scaleButtonType == XY )
{
m_valueX = a1->m_valueX;
m_valueY = a1->m_valueY;
if ( m_valueX == m_valueY )
{
v14 = v10;
}
else if ( m_valueX <= m_valueY )
{
v14 = v10;
v10 = (float)lroundf() / 100.0;
}
else
{
v14 = (float)lroundf() / 100.0;
}
v15 = v10 == a1->m_changedValueX || v14 == a1->m_changedValueY;
}
else
{
v14 = v10;
v15 = 0;
}
m_scaleButtonType = (unsigned __int16)a1->m_scaleButtonType;
if ( (__int16)m_scaleButtonType == 2 )
{
v17 = v10 < v14 ? v14 : v10;
if ( v17 > a1->m_upperBound || (v10 > v14 ? (v18 = v14) : (v18 = v10), v18 < a1->m_lowerBound || v15) )
{
Slider::setValue(m_sliderY, Value);
return;
}
}
m_delegate = a1->m_delegate;
a1->m_changedValueX = v10;
a1->m_changedValueY = v14;
if ( m_delegate )
{
v20 = m_delegate->__vftable;
if ( m_scaleButtonType )
{
if ( (__int16)m_scaleButtonType == 1 )
v20->scaleYChanged(m_delegate, COERCE_FLOAT(LODWORD(v14)), a1->m_scaleLocked);
else
v20->scaleXYChanged(m_delegate, COERCE_FLOAT(LODWORD(v10)), COERCE_FLOAT(LODWORD(v14)), a1->m_scaleLocked);
}
else
{
v20->scaleXChanged(m_delegate, COERCE_FLOAT(LODWORD(v10)), a1->m_scaleLocked);
}
}
if ( a1->m_scaleButtonType )
{
if ( a1->m_scaleButtonType == Y )
{
v21 = a1->m_valueX;
if ( v21 < v14 )
v21 = v14;
goto LABEL_50;
}
if ( v10 < v14 )
v21 = v14;
else
v21 = v10;
}
else
{
v21 = a1->m_valueY;
if ( v10 >= v21 )
v21 = v10;
}
GJScaleControl::updateLabelX(a1, v10);
LABEL_50:
if ( a1->m_scaleButtonType )
GJScaleControl::updateLabelY(a1, v14);
GJScaleControl::updateLabelXY(a1, v21);
if ( a1->m_scaleButtonType == XY )
{
m_sliderX = a1->m_sliderX;
v26 = GJScaleControl::valueFromScale(a1, v10);
Slider::setValue(m_sliderX, v26);
v24 = v14;
m_sliderXY = a1->m_sliderY;
v23 = a1;
}
else
{
m_sliderXY = a1->m_sliderXY;
v23 = a1;
v24 = v21;
}
v27 = GJScaleControl::valueFromScale(v23, v24);
Slider::setValue(m_sliderXY, v27);
}