//
// GJTransformControl::ccTouchMoved from 0x39f8a4 to 0x39fc84 (992 bytes)
//
// 1 xrefs:
// > `non-virtual thunk to'GJTransformControl::ccTouchMoved @ 0x39fc9c
//
// 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 GJTransformControl::ccTouchMoved(GJTransformControl *a1, cocos2d::CCTouch *a2, cocos2d::CCEvent *a3)
{
int m_transformButtonType; // r3
GJTransformControl *m_mainNodeParent; // r1
int v7; // r2
bool v8; // r3
cocos2d::CCSprite *v9; // r0
int v10; // r1
cocos2d::CCSprite *v11; // r6
void (__fastcall *setPosition)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9
cocos2d::CCSprite *v13; // r0
float v14; // s16
cocos2d::CCSprite *v15; // r8
void (__fastcall *v16)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9
int v17; // r0
float x; // s16
float *v19; // r0
float v20; // s15
void (*transformScaleXChanged)(void); // r3
cocos2d::CCSprite *v22; // r8
void (__fastcall *v23)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9
float *v24; // r0
float y; // s16
int v26; // r0
float v27; // s15
cocos2d::CCSprite *v28; // r8
void (__fastcall *v29)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9
float v30; // s17
float *v31; // r0
int v32; // r3
float v33; // s16
float v34; // s15
float v35; // s17
float v36; // s18
int v37; // r0
float v38; // s15
float m_scaleX; // s14
_BOOL4 m_warpLocked; // r3
float m_scaleY; // s11
float v42; // s13
float v43; // s12
cocos2d::CCSprite *v44; // r0
float v45; // s16
cocos2d::CCSprite *v46; // r6
void (__fastcall *v47)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r8
int v48; // r0
cocos2d::CCSprite *v49; // r0
float v50; // s16
cocos2d::CCSprite *v51; // r6
void (__fastcall *v52)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r8
float *v53; // r0
float v54; // s15
cocos2d::CCNode *m_mainNode; // r0
GJTransformControlDelegate *m_delegate; // r0
cocos2d::CCPoint v57; // [sp+4h] [bp-18h] BYREF
cocos2d::CCPoint v58; // [sp+Ch] [bp-10h] BYREF
cocos2d::CCTouch::getLocation(&v57, a2);
m_transformButtonType = a1->m_transformButtonType;
if ( m_transformButtonType == 12 || m_transformButtonType == 1 )
m_mainNodeParent = a1;
else
m_mainNodeParent = (GJTransformControl *)a1->m_mainNodeParent;
cocos2d::CCNode::convertToNodeSpace(&v58, m_mainNodeParent, &v57);
cocos2d::CCPoint::operator=((PlayerObject *)&v57, COERCE_FLOAT(&v58), v7, v8);
if ( a1->m_touchID == a2->m_nId )
{
v9 = GJTransformControl::spriteByTag(a1, 1);
v10 = a1->m_transformButtonType;
v11 = v9;
switch ( a1->m_transformButtonType )
{
case 1:
setPosition = v9->setPosition;
cocos2d::CCPoint::operator+(&v58, &v57, &a1->m_cursorDifference);
setPosition(v11, &v58);
goto LABEL_42;
case 2:
case 3:
v13 = GJTransformControl::spriteByTag(a1, v10);
v14 = v57.x + a1->m_cursorDifference.x;
v15 = v13;
v16 = v13->setPosition;
v17 = (int)v13->getPosition(v13);
cocos2d::CCPoint::CCPoint(&v58, v14, *(float *)(v17 + 4));
v16(v15, &v58);
x = v11->getPosition(v11)->x;
v19 = (float *)v15->getPosition(v15);
if ( a1->m_transformButtonType == 3 )
v20 = a1->m_topRight.x;
else
v20 = a1->m_bottomLeft.x;
transformScaleXChanged = (void (*)(void))a1->m_delegate->transformScaleXChanged;
a1->m_scaleX = (float)(*v19 - x) / (float)(v20 - x);
goto LABEL_41;
case 4:
case 5:
v22 = GJTransformControl::spriteByTag(a1, v10);
v23 = v22->setPosition;
v24 = (float *)v22->getPosition(v22);
cocos2d::CCPoint::CCPoint(&v58, *v24, v57.y + a1->m_cursorDifference.y);
v23(v22, &v58);
y = v11->getPosition(v11)->y;
v26 = (int)v22->getPosition(v22);
if ( a1->m_transformButtonType == 4 )
v27 = a1->m_topRight.y;
else
v27 = a1->m_bottomLeft.y;
transformScaleXChanged = (void (*)(void))a1->m_delegate->transformScaleYChanged;
a1->m_scaleY = (float)(*(float *)(v26 + 4) - y) / (float)(v27 - y);
goto LABEL_41;
case 6:
case 7:
case 8:
case 9:
v28 = GJTransformControl::spriteByTag(a1, v10);
v29 = v28->setPosition;
cocos2d::CCPoint::CCPoint(&v58, v57.x + a1->m_cursorDifference.x, v57.y + a1->m_cursorDifference.y);
v29(v28, &v58);
v30 = v11->getPosition(v11)->x;
v31 = (float *)v28->getPosition(v28);
v32 = a1->m_transformButtonType;
v33 = *v31 - v30;
if ( v32 == 7 || v32 == 9 )
v34 = a1->m_topRight.x;
else
v34 = a1->m_bottomLeft.x;
v36 = v11->getPosition(v11)->y;
v37 = (int)v28->getPosition(v28);
v35 = v34 - v30;
v38 = v33 / v35;
m_scaleX = a1->m_scaleX;
m_warpLocked = a1->m_warpLocked;
m_scaleY = a1->m_scaleY;
if ( (unsigned __int16)(a1->m_transformButtonType - 6) > 1u )
v42 = a1->m_bottomLeft.y;
else
v42 = a1->m_topRight.y;
v43 = *(float *)(v37 + 4);
a1->m_scaleX = v38;
a1->m_scaleY = (float)(v43 - v36) / (float)(v42 - v36);
if ( m_warpLocked )
a1->m_scaleY = v38 / (float)(m_scaleX / m_scaleY);
((void (__fastcall *)(GJTransformControlDelegate *, _DWORD, _DWORD))a1->m_delegate->transformScaleXYChanged)(
a1->m_delegate,
v33 / v35,
LODWORD(a1->m_scaleY));
goto LABEL_42;
case 0xA:
v44 = GJTransformControl::spriteByTag(a1, 10);
v45 = v57.x + a1->m_cursorDifference.x;
v46 = v44;
if ( v45 < -100.0 )
{
v45 = -100.0;
}
else if ( v45 > 100.0 )
{
v45 = 100.0;
}
v47 = v44->setPosition;
v48 = (int)v44->getPosition(v44);
cocos2d::CCPoint::CCPoint(&v58, v45, *(float *)(v48 + 4));
v47(v46, &v58);
transformScaleXChanged = (void (*)(void))a1->m_delegate->transformSkewXChanged;
goto LABEL_41;
case 0xB:
v49 = GJTransformControl::spriteByTag(a1, 11);
v50 = v57.y + a1->m_cursorDifference.y;
v51 = v49;
if ( v50 < -100.0 )
{
v50 = -100.0;
}
else if ( v50 > 100.0 )
{
v50 = 100.0;
}
v52 = v49->setPosition;
v53 = (float *)v49->getPosition(v49);
cocos2d::CCPoint::CCPoint(&v58, *v53, v50);
v52(v51, &v58);
transformScaleXChanged = (void (*)(void))a1->m_delegate->transformSkewYChanged;
goto LABEL_41;
case 0xC:
v54 = (float)((float)((float)-(float)(57.296
* atan2f(v57.y + a1->m_cursorDifference.y, v57.x + a1->m_cursorDifference.x))
* 100.0)
/ 100.0)
- a1->m_rotation;
if ( v54 == a1->m_rotationY )
goto LABEL_42;
m_mainNode = a1->m_mainNode;
a1->m_rotationY = v54;
m_mainNode->setRotation(m_mainNode, COERCE_FLOAT(LODWORD(v54)));
m_delegate = a1->m_delegate;
if ( !m_delegate )
goto LABEL_42;
transformScaleXChanged = (void (*)(void))m_delegate->transformRotationChanged;
LABEL_41:
transformScaleXChanged();
LABEL_42:
GJTransformControl::updateButtons(a1, 0, 0);
break;
default:
goto LABEL_42;
}
}
}