//
// GJTransformControl::applyFreeRotation from 0x1401a8090 to 0x1401a82a3 (531 bytes)
//
// 5 xrefs:
// > GJTransformControl::ccTouchEnded @ 0x1401a7dff
// > GJTransformControl::applyRotation @ 0x1401a8037
// > ??> @ 0x1408a0dac
// > ??> @ 0x1408a0dbc
// > ??> @ 0x140919c4c
//
// This function is hookable on this platform (idp: pc, 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 11:27:51 +0000
//
double __fastcall GJTransformControl::applyFreeRotation(__int64 a1, float a2)
{
cocos2d::CCArray *v3; // rcx
__int64 v4; // rdi
__int64 TransformState; // rax
__int64 v6; // rcx
__int64 v7; // rsi
__int64 v8; // rbx
int v9; // eax
int v10; // r9d
__int64 v11; // rcx
struct cocos2d::CCObject *v12; // rax
__int64 v13; // rax
struct cocos2d::CCObject *v14; // rax
__int64 v15; // rax
double result; // xmm0_8
char v17; // [rsp+90h] [rbp+8h] BYREF
if ( *(_QWORD *)(a1 + 440) )
{
v3 = *(cocos2d::CCArray **)(a1 + 424);
if ( v3 )
{
if ( cocos2d::CCArray::count(v3) )
{
v4 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 440) + 120LL))(*(_QWORD *)(a1 + 440));
TransformState = EditorUI::getTransformState(v4);
v6 = *(_QWORD *)(a1 + 416);
*(_DWORD *)(a1 + 608) = 0;
v7 = TransformState;
(*(void (__fastcall **)(__int64))(*(_QWORD *)v6 + 352LL))(v6);
*(_DWORD *)v7 = 1065353216;
*(_QWORD *)(v7 + 4) = 1065353216;
*(_QWORD *)(v7 + 12) = 0;
*(_DWORD *)(v7 + 20) = 0;
*(_QWORD *)(v7 + 32) = 0;
*(_QWORD *)(v7 + 40) = 0;
*(_DWORD *)(v7 + 64) = 1065353216;
*(_DWORD *)(v7 + 68) = 1065353216;
GJTransformControl::loadValues(a1, nullptr, *(cocos2d::CCArray **)(a1 + 424), v4 + 464);
v8 = *(_QWORD *)(a1 + 424);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v17, (const struct cocos2d::CCPoint *)(v4 + 816));
EditorUI::transformObjects(v4, v8, v9, v10, 1065353216, -a2, -a2, 0, 0);
EditorUI::resetObjectEditorValues(v4, *(_QWORD *)(a1 + 424));
*(float *)(v7 + 8) = a2;
*(float *)(v7 + 12) = a2;
v11 = *(_QWORD *)(a1 + 416);
*(float *)(a1 + 608) = a2;
(*(void (__fastcall **)(__int64))(*(_QWORD *)v11 + 352LL))(v11);
GJTransformControl::updateButtons(a1, 0, 0);
v12 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 512), 6u);
v13 = (*(__int64 (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v12 + 200LL))(v12);
cocos2d::CCPoint::operator=(a1 + 456, v13);
v14 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 512), 7u);
v15 = (*(__int64 (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v14 + 200LL))(v14);
return cocos2d::CCPoint::operator=(a1 + 464, v15);
}
}
}
return result;
}