//
// GJTransformControl::ccTouchEnded from 0x100054020 to 0x100054202 (482 bytes)
//
// 2 xrefs:
// > sub_100054210 @ 0x10005421c
// > ??> @ 0x1008b0c98
//
// 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 __fastcall GJTransformControl::ccTouchEnded(GJTransformControl *a1, cocos2d::CCTouch *a2, cocos2d::CCEvent *a3)
{
int m_transformButtonType; // eax
GJTransformControlDelegate *m_delegate; // r14
__int64 v6; // rax
__int64 v7; // rax
__int64 v8; // rax
double v9; // xmm0_8
__int64 v10; // rax
double v11; // xmm0_8
cocos2d::CCArray *v12; // r14
cocos2d::CCPoint v13; // xmm0_8
GJTransformControlDelegate *v14; // rdi
_BYTE v15[8]; // [rsp+8h] [rbp-48h] BYREF
_BYTE v16[8]; // [rsp+10h] [rbp-40h] BYREF
char v17; // [rsp+18h] [rbp-38h] BYREF
_BYTE v18[8]; // [rsp+20h] [rbp-30h] BYREF
_BYTE v19[40]; // [rsp+28h] [rbp-28h] BYREF
double v20; // 0:xmm0_8.8
sub_10028CC30(v18);
if ( a1->m_touchID == a2->m_nId )
{
m_transformButtonType = (unsigned __int16)a1->m_transformButtonType;
if ( a1->m_transformButtonType )
{
if ( m_transformButtonType == 1 )
{
a1->m_touchID = -1;
m_delegate = a1->m_delegate;
if ( m_delegate )
{
v6 = sub_1007200C0(a1->m_warpSprites, 0);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v6 + 192LL))(v6);
*(cocos2d::CCPoint *)&v20 = cocos2d::CCNode::convertToWorldSpace(
(cocos2d::CCNode *)v19,
(const cocos2d::CCPoint *)a1);
((void (__fastcall *)(GJTransformControlDelegate *, _BYTE *, double))m_delegate->anchorPointMoved)(
m_delegate,
v19,
v20);
v7 = sub_1007200C0(a1->m_warpSprites, 0);
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v7 + 184LL))(v7, &qword_10099EC08);
v8 = sub_1007200C0(a1->m_objects, 0);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v8 + 192LL))(v8);
v9 = sub_10028CC90();
GJTransformControl::updateButtons(a1, 0, 1);
a1->m_transformButtonType = 0;
GJTransformControl::updateButtons(a1, 0, 0);
v10 = sub_1007200C0(a1->m_objects, 0);
(*(void (__fastcall **)(__int64, double))(*(_QWORD *)v10 + 192LL))(v10, v9);
v11 = sub_10028CC60(v19);
sub_10028CD00(v15, v18, v19);
v12 = (cocos2d::CCArray *)((__int64 (__fastcall *)(GJTransformControlDelegate *, double))a1->m_delegate->getUI)(
a1->m_delegate,
v11);
*(double *)&v13 = sub_10028CC60(v16);
EditorUI::checkDiffAfterTransformAnchor((EditorUI *)&v17, v13, v12);
GJTransformControl::updateButtons(a1, 0, 1);
LABEL_11:
GJTransformControl::updateButtons(a1, 0, 0);
return;
}
}
else
{
a1->m_touchID = -1;
v14 = a1->m_delegate;
if ( v14 )
{
((void (__fastcall *)(GJTransformControlDelegate *))v14->transformChangeEnded)(v14);
LOWORD(m_transformButtonType) = a1->m_transformButtonType;
}
if ( (m_transformButtonType & 0xFFFE) == 0xA )
GJTransformControl::updateButtons(a1, 0, 1);
}
}
a1->m_transformButtonType = 0;
goto LABEL_11;
}
}