//
// GJTransformControl::ccTouchMoved from 0xbd24bc to 0xbd2d5c (2208 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'GJTransformControl::ccTouchMoved @ 0xbd2d7c
// > ??> @ 0xd9ca8
// > ??> @ 0x14e2808
//
// This function is hookable on this platform (idp: arm, 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 13:03:38 +0000
//
__int64 __fastcall GJTransformControl::ccTouchMoved(__int64 a1, cocos2d::CCTouch *a2)
{
__int64 v3; // x22
int v5; // w0
cocos2d::CCNode *v6; // x0
__int64 v8; // x21
int v9; // w1
__int64 v10; // x0
__int64 v11; // x21
float v12; // s8
void (__fastcall *v13)(__int64, __int64 *); // x22
float *v14; // x0
__int64 v15; // x0
__int64 v16; // x21
float v17; // s8
void (__fastcall *v18)(__int64, __int64 *); // x22
__int64 v19; // x0
__int64 v20; // x22
void (__fastcall *v21)(__int64, __int64 *); // x24
float v22; // s10
float v23; // s9
float v24; // s8
float v25; // s8
float v26; // s11
long double v27; // q0
long double v28; // q1
float v29; // s0
float v30; // s0
__int64 v31; // x0
__int64 v32; // x22
void (__fastcall *v33)(__int64, __int64 *); // x24
float *v34; // x0
float v35; // s8
float v36; // s1
float v37; // s0
float v38; // s0
__int64 v39; // x0
__int64 v40; // x22
void (__fastcall *v41)(__int64, __int64 *); // x24
__int64 v42; // x0
float v43; // s8
float v44; // s1
float v45; // s0
float v46; // s0
void (__fastcall ***v47)(_QWORD); // x0
GameManager *v48; // x0
GameManager *v49; // x0
float v50; // s0
float v51; // s1
float v52; // s0
float v53; // s8
__int64 v54; // x1
__int64 v55; // x0
float v56; // s1
float v57; // s2
float v58; // s0
const cocos2d::CCPoint *v59; // x0
const cocos2d::CCPoint *v60; // x0
void (__fastcall *v61)(__int64, __int64 *); // x24
__int64 v62; // x0
const cocos2d::CCPoint *v63; // x0
void (__fastcall *v64)(__int64, __int64 *); // x24
float *v65; // x0
int v66; // w25
EditorSFXManager *v67; // x0
EditorSFXManager *v68; // x0
GameManager *v69; // x0
cocos2d::CCNode *v70; // x25
__int64 v71; // x25
float v72; // [xsp+70h] [xbp+70h]
float v73; // [xsp+70h] [xbp+70h]
__int64 v74; // [xsp+88h] [xbp+88h] BYREF
__int64 v75; // [xsp+90h] [xbp+90h] BYREF
__int64 v76; // [xsp+98h] [xbp+98h] BYREF
__int64 v77; // [xsp+A0h] [xbp+A0h] BYREF
v3 = a1 + 560;
if ( ControlMenuTouch::tracking((ControlMenuTouch *)(a1 + 560)) )
{
ControlMenuTouch::moved(v3);
return _stack_chk_guard;
}
cocos2d::CCTouch::getLocation(&v74, a2);
v5 = *(__int16 *)(a1 + 436);
if ( v5 == 1 || v5 == 12 )
v6 = (cocos2d::CCNode *)a1;
else
v6 = *(cocos2d::CCNode **)(a1 + 408);
cocos2d::CCNode::convertToNodeSpace(&v77, v6, (const cocos2d::CCPoint *)&v74);
cocos2d::CCPoint::operator=(&v74, &v77);
if ( *(_DWORD *)(a1 + 432) == *((_DWORD *)a2 + 14) )
{
v8 = GJTransformControl::spriteByTag((cocos2d::CCArray **)a1, 1);
v9 = *(__int16 *)(a1 + 436);
switch ( *(_WORD *)(a1 + 436) )
{
case 1:
v48 = (GameManager *)cocos2d::CCPoint::operator+(&v75, &v74);
v49 = (GameManager *)GameManager::sharedState(v48);
if ( (unsigned __int8)GameManager::getGameVariable(v49, "0242") )
goto LABEL_47;
v66 = *(_DWORD *)(a1 + 632);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v77, (const cocos2d::CCPoint *)&v75);
GJTransformControl::snapToNearestVertex(a1, (const cocos2d::CCPoint *)&v77, (cocos2d::CCPoint *)&v76);
cocos2d::CCPoint::operator=(&v75, &v76);
if ( !*(_BYTE *)(a1 + 602) )
goto LABEL_70;
v67 = (EditorSFXManager *)*(unsigned int *)(a1 + 632);
if ( !(_DWORD)v67 )
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v77, (const cocos2d::CCPoint *)&v75);
GJTransformControl::snapToGrid(a1, (const cocos2d::CCPoint *)&v77, 1u, &v76);
cocos2d::CCPoint::operator=(&v75, &v76);
LABEL_70:
v67 = (EditorSFXManager *)*(unsigned int *)(a1 + 632);
}
if ( (_DWORD)v67 && v66 != (_DWORD)v67 )
{
v68 = (EditorSFXManager *)EditorSFXManager::sharedState(v67);
v69 = (GameManager *)EditorSFXManager::playAction(v68, 275);
v70 = *(cocos2d::CCNode **)(*(_QWORD *)(GameManager::sharedState(v69) + 552) + 3920LL);
cocos2d::CCNode::convertToWorldSpace(&v77, (cocos2d::CCNode *)a1, (const cocos2d::CCPoint *)&v75);
cocos2d::CCNode::convertToNodeSpace(&v76, v70, (const cocos2d::CCPoint *)&v77);
v71 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 440) + 120LL))(*(_QWORD *)(a1 + 440));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v77, (const cocos2d::CCPoint *)&v76);
EditorUI::playCircleAnim(v71, (__int64)&v77, 60.0, 0.4);
}
LABEL_47:
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v8 + 184LL))(v8, &v75);
goto LABEL_10;
case 2:
case 3:
v40 = GJTransformControl::spriteByTag((cocos2d::CCArray **)a1, v9);
v41 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v40 + 184LL);
v72 = *(float *)&v74 + *(float *)(a1 + 448);
v42 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v40 + 192LL))(v40);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v77, v72, *(float *)(v42 + 4));
v41(v40, &v77);
if ( *(_BYTE *)(a1 + 602) )
{
v60 = (const cocos2d::CCPoint *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v40 + 192LL))(v40);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v77, v60);
GJTransformControl::snapToGrid(a1, (const cocos2d::CCPoint *)&v77, 0, &v76);
v61 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v40 + 184LL);
v73 = *(float *)&v76;
v62 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v40 + 192LL))(v40);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v77, v73, *(float *)(v62 + 4));
v61(v40, &v77);
}
v43 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v8 + 192LL))(v8);
v44 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v40 + 192LL))(v40);
if ( *(_WORD *)(a1 + 436) == 3 )
v45 = *(float *)(a1 + 456);
else
v45 = *(float *)(a1 + 464);
v46 = v45 - v43;
if ( fabsf(v46) > 0.01 )
{
v47 = *(void (__fastcall ****)(_QWORD))(a1 + 440);
*(float *)(a1 + 592) = (float)(v44 - v43) / v46;
(**v47)(v47);
}
goto LABEL_10;
case 4:
case 5:
v32 = GJTransformControl::spriteByTag((cocos2d::CCArray **)a1, v9);
v33 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v32 + 184LL);
v34 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v32 + 192LL))(v32);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v77, *v34, *((float *)&v74 + 1) + *(float *)(a1 + 452));
v33(v32, &v77);
if ( *(_BYTE *)(a1 + 602) )
{
v63 = (const cocos2d::CCPoint *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v32 + 192LL))(v32);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v77, v63);
GJTransformControl::snapToGrid(a1, (const cocos2d::CCPoint *)&v77, 0, &v76);
v64 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v32 + 184LL);
v65 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v32 + 192LL))(v32);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v77, *v65, *((float *)&v76 + 1));
v64(v32, &v77);
}
v35 = *(float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v8 + 192LL))(v8) + 4);
v36 = *(float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v32 + 192LL))(v32) + 4);
if ( *(_WORD *)(a1 + 436) == 4 )
v37 = *(float *)(a1 + 460);
else
v37 = *(float *)(a1 + 468);
v38 = v37 - v35;
if ( fabsf(v38) > 0.01 )
{
v39 = *(_QWORD *)(a1 + 440);
*(float *)(a1 + 596) = (float)(v36 - v35) / v38;
(*(void (__fastcall **)(__int64))(*(_QWORD *)v39 + 8LL))(v39);
}
goto LABEL_10;
case 6:
case 7:
case 8:
case 9:
v20 = GJTransformControl::spriteByTag((cocos2d::CCArray **)a1, v9);
v21 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v20 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v77,
*(float *)&v74 + *(float *)(a1 + 448),
*((float *)&v74 + 1) + *(float *)(a1 + 452));
v21(v20, &v77);
if ( *(_BYTE *)(a1 + 602) )
{
v59 = (const cocos2d::CCPoint *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v20 + 192LL))(v20);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v77, v59);
GJTransformControl::snapToGrid(a1, (const cocos2d::CCPoint *)&v77, 0, &v76);
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v20 + 184LL))(v20, &v76);
}
v22 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v8 + 192LL))(v8);
v23 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v20 + 192LL))(v20);
if ( ((*(_WORD *)(a1 + 436) - 7) & 0xFFFD) != 0 )
v24 = *(float *)(a1 + 464);
else
v24 = *(float *)(a1 + 456);
v25 = v24 - v22;
v26 = *(float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v8 + 192LL))(v8) + 4);
LODWORD(v28) = *(_DWORD *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v20 + 192LL))(v20) + 4);
if ( (unsigned __int16)(*(_WORD *)(a1 + 436) - 6) <= 1u )
v29 = *(float *)(a1 + 460);
else
v29 = *(float *)(a1 + 468);
v30 = v29 - v26;
if ( fabsf(v25) > 0.01 )
*(float *)(a1 + 592) = (float)(v23 - v22) / v25;
if ( fabsf(v30) > 0.01 )
*(float *)(a1 + 596) = (float)(*(float *)&v28 - v26) / v30;
if ( *(_BYTE *)(a1 + 600) )
{
v56 = *(float *)(a1 + 488);
if ( v56 != 0.0 )
{
v57 = *(float *)(a1 + 492);
if ( v57 != 0.0 )
{
LODWORD(v27) = *(_DWORD *)(a1 + 592);
*(float *)&v28 = (float)(v57 * *(float *)&v27) / v56;
*(_DWORD *)(a1 + 596) = LODWORD(v28);
goto LABEL_33;
}
}
}
else
{
v31 = cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)*(unsigned __int8 *)(a1 + 600));
if ( !*(_BYTE *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v31 + 192LL))(v31) + 128) )
{
LODWORD(v27) = *(_DWORD *)(a1 + 592);
LODWORD(v28) = *(_DWORD *)(a1 + 596);
LABEL_33:
(*(void (__fastcall **)(_QWORD, long double, long double))(**(_QWORD **)(a1 + 440) + 16LL))(
*(_QWORD *)(a1 + 440),
v27,
v28);
LABEL_10:
GJTransformControl::updateButtons((GJTransformControl *)a1, 0, 0);
return _stack_chk_guard;
}
}
LODWORD(v27) = *(_DWORD *)(a1 + 592);
if ( fabsf(*(float *)&v27) < fabsf(*(float *)(a1 + 596)) )
LODWORD(v27) = *(_DWORD *)(a1 + 596);
LODWORD(v28) = LODWORD(v27);
*(_DWORD *)(a1 + 592) = LODWORD(v27);
*(_DWORD *)(a1 + 596) = LODWORD(v27);
goto LABEL_33;
case 0xA:
v15 = GJTransformControl::spriteByTag((cocos2d::CCArray **)a1, 10);
v16 = v15;
v17 = *(float *)&v74 + *(float *)(a1 + 448);
if ( v17 < -100.0 )
{
v17 = -100.0;
}
else if ( v17 > 100.0 )
{
v17 = 100.0;
}
v18 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v15 + 184LL);
v19 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v15 + 192LL))(v15);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v77, v17, *(float *)(v19 + 4));
v18(v16, &v77);
(*(void (__fastcall **)(_QWORD, float))(**(_QWORD **)(a1 + 440) + 64LL))(*(_QWORD *)(a1 + 440), v17 * 0.45);
goto LABEL_10;
case 0xB:
v10 = GJTransformControl::spriteByTag((cocos2d::CCArray **)a1, 11);
v11 = v10;
v12 = *((float *)&v74 + 1) + *(float *)(a1 + 452);
if ( v12 < -100.0 )
{
v12 = -100.0;
}
else if ( v12 > 100.0 )
{
v12 = 100.0;
}
v13 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v10 + 184LL);
v14 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v10 + 192LL))(v10);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v77, *v14, v12);
v13(v11, &v77);
(*(void (__fastcall **)(_QWORD, float))(**(_QWORD **)(a1 + 440) + 72LL))(*(_QWORD *)(a1 + 440), v12 * 0.45);
goto LABEL_10;
case 0xC:
v50 = atan2f(*((float *)&v74 + 1) + *(float *)(a1 + 452), *(float *)&v74 + *(float *)(a1 + 448));
v51 = *(float *)(a1 + 612);
v52 = (float)-(float)(v50 * 57.296) * 100.0;
v53 = (float)(v52 / 100.0) - v51;
if ( *(_BYTE *)(a1 + 602) )
{
v58 = GJTransformControl::snapAngleTo45((GJTransformControl *)a1, (float)(v52 / 100.0) - v51);
if ( vabds_f32(v58, v53) < 4.0 )
v53 = v58;
}
if ( *(float *)(a1 + 608) != v53 )
{
v54 = *(_QWORD *)(a1 + 416);
*(float *)(a1 + 608) = v53;
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v54 + 360LL))(v54, v53);
v55 = *(_QWORD *)(a1 + 440);
if ( v55 )
{
if ( !*(_BYTE *)(a1 + 603) )
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v55 + 40LL))(v55, *(float *)(a1 + 608));
}
}
goto LABEL_10;
default:
goto LABEL_10;
}
}
return _stack_chk_guard;
}