//
// GJTransformControl::ccTouchMoved from 0x14012c6b0 to 0x14012cc04 (1364 bytes)
//
// 4 xrefs:
// > ??> @ 0x140552c68
// > ??> @ 0x140670ba0
// > ??> @ 0x140670bfc
// > ??> @ 0x1406c9c24
//
// 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)
{
__int16 a_low; // ax
cocos2d::CCNode *v6; // rcx
struct cocos2d::CCPoint v7; // rax
struct cocos2d::CCObject *v8; // r14
int v9; // eax
struct cocos2d::CCObject *v10; // rdi
cocos2d::CCObject_vtbl *v11; // rbx
__int64 v12; // rax
DS_Dictionary *v13; // rax
float v14; // xmm6_4
float v15; // xmm1_4
float ty; // xmm0_4
void (__fastcall ***v17)(_QWORD); // rcx
struct cocos2d::CCObject *v18; // rax
float v19; // xmm6_4
struct cocos2d::CCObject *v20; // rdi
cocos2d::CCObject_vtbl *v21; // rbx
float *v22; // rax
DS_Dictionary *v23; // rax
float v24; // xmm6_4
float v25; // xmm1_4
float a; // xmm0_4
__int64 v27; // rcx
struct cocos2d::CCObject *v28; // rdi
cocos2d::CCObject_vtbl *v29; // rbx
DS_Dictionary *v30; // rax
float v31; // xmm8_4
float v32; // xmm6_4
float b; // xmm7_4
float v34; // xmm7_4
float v35; // xmm8_4
float v36; // xmm2_4
float c; // xmm0_4
bool v38; // zf
float v39; // xmm1_4
float v40; // xmm3_4
float v41; // xmm6_4
struct cocos2d::CCObject *v42; // rax
struct cocos2d::CCObject *v43; // rdi
float v44; // xmm0_4
float v45; // xmm6_4
cocos2d::CCObject_vtbl *v46; // rbx
__int64 v47; // rax
DS_Dictionary *v48; // rax
struct cocos2d::CCObject *v49; // rax
struct cocos2d::CCObject *v50; // rdi
float v51; // xmm0_4
float v52; // xmm6_4
cocos2d::CCObject_vtbl *v53; // rbx
float *v54; // rax
DS_Dictionary *v55; // rax
float v56; // xmm1_4
__int64 v57; // rcx
__int64 v58; // rcx
float v59; // [rsp+70h] [rbp+8h] BYREF
float v60; // [rsp+74h] [rbp+Ch]
cocos2d::CCPoint v61; // [rsp+78h] [rbp+10h] BYREF
cocos2d::CCTouch::getLocation(a2);
a_low = LOWORD(a1->m_sAdditionalTransform.a);
if ( a_low == 12 || a_low == 1 )
v6 = (GJTransformControl *)((char *)a1 - 320);
else
v6 = *(cocos2d::CCNode **)&a1->m_fSkewY;
v7 = cocos2d::CCNode::convertToNodeSpace(v6, &v61);
((void (__fastcall *)(_QWORD, _QWORD))cocos2d::CCPoint::operator=)(&v59, v7);
if ( LODWORD(a1->m_obContentSize.height) == a2->m_nId )
{
v8 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)&a1->m_sInverse.ty, 0);
v9 = SLOWORD(a1->m_sAdditionalTransform.a);
switch ( LOWORD(a1->m_sAdditionalTransform.a) )
{
case 1:
cocos2d::CCPoint::operator+(&v59, &v61);
v8->__vftable[2].encodeWithCoder(v8, (DS_Dictionary *)&v61);
break;
case 2:
case 3:
v10 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)&a1->m_sInverse.ty, v9 - 1);
v11 = v10->__vftable;
v12 = ((__int64 (__fastcall *)(struct cocos2d::CCObject *))v10->__vftable[2].getTag)(v10);
cocos2d::CCPoint::CCPoint(&v61, v59 + a1->m_sAdditionalTransform.d, *(float *)(v12 + 4));
v11[2].encodeWithCoder(v10, v13);
v14 = *(float *)((__int64 (__fastcall *)(struct cocos2d::CCObject *))v8->__vftable[2].getTag)(v8);
v15 = *(float *)((__int64 (__fastcall *)(struct cocos2d::CCObject *))v10->__vftable[2].getTag)(v10) - v14;
if ( LOWORD(a1->m_sAdditionalTransform.a) == 3 )
ty = a1->m_sAdditionalTransform.ty;
else
ty = a1->m_sTransform.b;
v17 = *(void (__fastcall ****)(_QWORD))&a1->m_sAdditionalTransform.b;
*(float *)&a1->m_pChildren = v15 / (float)(ty - v14);
(**v17)(v17);
break;
case 4:
case 5:
v18 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)&a1->m_sInverse.ty, v9 - 1);
v19 = a1->m_sAdditionalTransform.tx + v60;
v20 = v18;
v21 = v18->__vftable;
v22 = (float *)((__int64 (__fastcall *)(struct cocos2d::CCObject *))v18->__vftable[2].getTag)(v18);
cocos2d::CCPoint::CCPoint(&v61, *v22, v19);
v21[2].encodeWithCoder(v20, v23);
v24 = *(float *)(((__int64 (__fastcall *)(struct cocos2d::CCObject *))v8->__vftable[2].getTag)(v8) + 4);
v25 = *(float *)(((__int64 (__fastcall *)(struct cocos2d::CCObject *))v20->__vftable[2].getTag)(v20) + 4) - v24;
if ( LOWORD(a1->m_sAdditionalTransform.a) == 4 )
a = a1->m_sTransform.a;
else
a = a1->m_sTransform.c;
v27 = *(_QWORD *)&a1->m_sAdditionalTransform.b;
*((float *)&a1->m_pChildren + 1) = v25 / (float)(a - v24);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v27 + 8LL))(v27);
break;
case 6:
case 7:
case 8:
case 9:
v28 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)&a1->m_sInverse.ty, v9 - 1);
v29 = v28->__vftable;
cocos2d::CCPoint::CCPoint(&v61, v59 + a1->m_sAdditionalTransform.d, v60 + a1->m_sAdditionalTransform.tx);
v29[2].encodeWithCoder(v28, v30);
v31 = *(float *)((__int64 (__fastcall *)(struct cocos2d::CCObject *))v8->__vftable[2].getTag)(v8);
v32 = *(float *)((__int64 (__fastcall *)(struct cocos2d::CCObject *))v28->__vftable[2].getTag)(v28) - v31;
if ( ((LOWORD(a1->m_sAdditionalTransform.a) - 7) & 0xFFFD) != 0 )
b = a1->m_sTransform.b;
else
b = a1->m_sAdditionalTransform.ty;
v34 = b - v31;
v35 = *(float *)(((__int64 (__fastcall *)(struct cocos2d::CCObject *))v8->__vftable[2].getTag)(v8) + 4);
v36 = *(float *)(((__int64 (__fastcall *)(struct cocos2d::CCObject *))v28->__vftable[2].getTag)(v28) + 4) - v35;
if ( (unsigned __int16)(LOWORD(a1->m_sAdditionalTransform.a) - 6) <= 1u )
c = a1->m_sTransform.a;
else
c = a1->m_sTransform.c;
v38 = LOBYTE(a1->m_pParent) == 0;
v39 = *(float *)&a1->m_pChildren;
v40 = *((float *)&a1->m_pChildren + 1);
v41 = v32 / v34;
*(float *)&a1->m_pChildren = v41;
*((float *)&a1->m_pChildren + 1) = v36 / (float)(c - v35);
if ( !v38 )
*((float *)&a1->m_pChildren + 1) = v41 / (float)(v39 / v40);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&a1->m_sAdditionalTransform.b + 16LL))(*(_QWORD *)&a1->m_sAdditionalTransform.b);
break;
case 0xA:
v42 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)&a1->m_sInverse.ty, v9 - 1);
v43 = v42;
v44 = v59 + a1->m_sAdditionalTransform.d;
v45 = -100.0;
if ( v44 >= -100.0 )
v45 = fminf(100.0, v44);
v46 = v42->__vftable;
v47 = ((__int64 (__fastcall *)(struct cocos2d::CCObject *))v42->__vftable[2].getTag)(v42);
cocos2d::CCPoint::CCPoint(&v61, v45, *(float *)(v47 + 4));
v46[2].encodeWithCoder(v43, v48);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&a1->m_sAdditionalTransform.b + 64LL))(*(_QWORD *)&a1->m_sAdditionalTransform.b);
break;
case 0xB:
v49 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)&a1->m_sInverse.ty, v9 - 1);
v50 = v49;
v51 = v60 + a1->m_sAdditionalTransform.tx;
v52 = -100.0;
if ( v51 >= -100.0 )
v52 = fminf(100.0, v51);
v53 = v49->__vftable;
v54 = (float *)((__int64 (__fastcall *)(struct cocos2d::CCObject *))v49->__vftable[2].getTag)(v49);
cocos2d::CCPoint::CCPoint(&v61, *v54, v52);
v53[2].encodeWithCoder(v50, v55);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&a1->m_sAdditionalTransform.b + 72LL))(*(_QWORD *)&a1->m_sAdditionalTransform.b);
break;
case 0xC:
v56 = (float)((float)((float)-(float)(atan2f(
v60 + a1->m_sAdditionalTransform.tx,
v59 + a1->m_sAdditionalTransform.d)
* 57.29578)
* 100.0)
/ 100.0)
- *((float *)&a1->m_pUserData + 1);
if ( v56 != *(float *)&a1->m_pUserData )
{
v57 = *(_QWORD *)&a1->m_obAnchorPointInPoints.y;
*(float *)&a1->m_pUserData = v56;
(*(void (__fastcall **)(__int64))(*(_QWORD *)v57 + 336LL))(v57);
v58 = *(_QWORD *)&a1->m_sAdditionalTransform.b;
if ( v58 )
(*(void (__fastcall **)(__int64))(*(_QWORD *)v58 + 40LL))(v58);
}
break;
default:
break;
}
GJTransformControl::updateButtons((GJTransformControl *)((char *)a1 - 320), 0, 0);
}
}