//
// EditorUI::ccTouchBegan from 0x100609d80 to 0x10060a291 (1297 bytes)
//
// 2 xrefs:
// > sub_10060A2A0 @ 0x10060a2ac
// > ??> @ 0x100ab4fa0
//
// 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 12:34:32 +0000
//
char __fastcall EditorUI::ccTouchBegan(__int64 a1, __int64 a2, __int64 a3)
{
__int64 v5; // rax
char v6; // al
__int64 v7; // rcx
int v8; // edx
_DWORD *v10; // rdi
__int64 v11; // rax
__int64 v12; // rax
__int64 v13; // rax
__int64 v14; // rax
char v15; // al
__int64 v16; // rax
__int64 v17; // rax
_OWORD *v18; // r14
__int64 v19; // rax
__int64 v20; // r14
__int64 v21; // rax
__int64 v22; // rax
unsigned __int64 v23; // [rsp+0h] [rbp-40h] BYREF
timeb v24; // [rsp+8h] [rbp-38h] BYREF
if ( *(_DWORD *)(a1 + 696) == -1
&& (*(unsigned __int8 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 760) + 352LL))(*(_QWORD *)(a1 + 760))
&& (*(unsigned __int8 (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 760) + 896LL))(
*(_QWORD *)(a1 + 760),
a2,
a3) )
{
*(_DWORD *)(a1 + 696) = *(_DWORD *)(a2 + 56);
return 1;
}
if ( *(_DWORD *)(a1 + 700) == -1
&& (*(unsigned __int8 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 784) + 352LL))(*(_QWORD *)(a1 + 784))
&& (*(unsigned __int8 (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 784) + 896LL))(
*(_QWORD *)(a1 + 784),
a2,
a3) )
{
*(_DWORD *)(a1 + 700) = *(_DWORD *)(a2 + 56);
return 1;
}
if ( *(_DWORD *)(a1 + 712) == -1
&& (*(unsigned __int8 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 792) + 352LL))(*(_QWORD *)(a1 + 792))
&& (*(unsigned __int8 (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 792) + 896LL))(
*(_QWORD *)(a1 + 792),
a2,
a3) )
{
*(_DWORD *)(a1 + 712) = *(_DWORD *)(a2 + 56);
return 1;
}
if ( *(_DWORD *)(a1 + 704) == -1 || *(_DWORD *)(a1 + 716) != -1 || *(_BYTE *)(a1 + 748) )
{
cocos2d::CCTouch::getLocationInView((__int64)&v23, a2);
v5 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::convertToGL((float *)&v24, v5, &v23);
sub_100278300(&v23, &v24);
cocos2d::CCNode::convertToWorldSpace((double *)&v24.time, a1, (unsigned int *)&v23);
sub_100278300(&v23, &v24);
sub_100278300((_QWORD *)(a1 + 1448), &v23);
v6 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 992) + 352LL))(*(_QWORD *)(a1 + 992));
v7 = *(_QWORD *)(a1 + 1440);
v8 = *(_DWORD *)(v7 + 1972);
if ( *(float *)(a1 + 856) > *(float *)(a1 + 1452) )
{
if ( v6 & 1 | (v8 != 1) )
return 0;
LABEL_20:
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(v7 + 13288) + 896LL))(
*(_QWORD *)(v7 + 13288),
a2,
a3);
return 1;
}
if ( v8 == 1 )
goto LABEL_20;
if ( *(_DWORD *)(a1 + 704) == -1 )
{
v10 = *(_DWORD **)(a1 + 680);
if ( v10 )
{
cocos2d::CCObject::release(v10);
*(_QWORD *)(a1 + 680) = 0;
}
if ( !*(_BYTE *)(a1 + 688) )
{
v11 = cocos2d::CCDirector::sharedDirector();
if ( !*(_BYTE *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v11 + 192LL))(v11) + 128) )
{
if ( *(_BYTE *)(a1 + 864)
|| (v12 = cocos2d::CCDirector::sharedDirector(),
*(_BYTE *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v12 + 192LL))(v12) + 129))
|| (v13 = cocos2d::CCDirector::sharedDirector(),
*(_BYTE *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v13 + 192LL))(v13) + 131) == 1) )
{
if ( *(_DWORD *)(a1 + 1436) == 3 )
EditorUI::startFreeMoveTouch(a1);
}
}
}
if ( !*(_BYTE *)(a1 + 688) )
{
if ( *(_BYTE *)(a1 + 860)
|| (v14 = cocos2d::CCDirector::sharedDirector(),
*(_BYTE *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v14 + 192LL))(v14) + 128) == 1) )
{
if ( *(_DWORD *)(a1 + 1436) == 3 )
{
*(_BYTE *)(a1 + 861) = 1;
sub_100278300((_QWORD *)(a1 + 1456), (_QWORD *)(a1 + 1448));
}
}
}
v15 = 1;
if ( !*(_BYTE *)(a1 + 860) )
{
v16 = cocos2d::CCDirector::sharedDirector();
v15 = *(_BYTE *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v16 + 192LL))(v16) + 128);
}
*(_BYTE *)(a1 + 862) = v15;
*(_BYTE *)(a1 + 863) = 0;
*(_DWORD *)(a1 + 704) = *(_DWORD *)(a2 + 56);
*(_BYTE *)(a1 + 708) = 0;
sub_100278300((_QWORD *)(a1 + 720), (_QWORD *)(a1 + 1448));
cocos2d::CCNode::stopActionByTag(a1, 123);
if ( !*(_BYTE *)(a1 + 862) )
{
v17 = GameManager::sharedState();
if ( (unsigned __int8)GameManager::getGameVariable(v17, "0057") )
{
v18 = cocos2d::CCDelayTime::create((__m128)0x3E99999Au);
v19 = cocos2d::CCCallFunc::create(a1, EditorUI::triggerSwipeMode, 0);
v20 = sub_10039EB60((__int64)v18, v19, 0);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v20 + 72LL))(v20, 123);
cocos2d::CCNode::runAction(a1, v20);
}
}
ftime(&v24);
*(double *)(a1 + 1560) = (double)v24.millitm / 1000.0 + (double)SLODWORD(v24.time);
*(_BYTE *)(a1 + 1568) = 0;
cocos2d::CCNode::stopActionByTag(a1, 128);
*(_BYTE *)(a1 + 750) = 0;
return 1;
}
}
else
{
v21 = GameManager::sharedState();
if ( !(unsigned __int8)GameManager::getGameVariable(v21, "0245")
&& (*(_BYTE *)(a1 + 750) || !*(_BYTE *)(a1 + 865) && !*(_BYTE *)(a1 + 861) && !*(_BYTE *)(a1 + 862)) )
{
*(_DWORD *)(a1 + 716) = *(_DWORD *)(a2 + 56);
cocos2d::CCTouch::getLocationInView((__int64)&v23, a2);
v22 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::convertToGL((float *)&v24, v22, &v23);
sub_100278300(&v23, &v24);
cocos2d::CCNode::convertToWorldSpace((double *)&v24.time, a1, (unsigned int *)&v23);
sub_100278300(&v23, &v24);
sub_100278300((_QWORD *)(a1 + 728), &v23);
*(float *)(a1 + 736) = cocos2d::ccpDistance((unsigned __int64 *)(a1 + 720), (unsigned __int64 *)(a1 + 728));
*(float *)(a1 + 740) = GameToolbox::touchUnitsForMM(a1 + 720, 5.0);
*(float *)(a1 + 744) = (*(float (__fastcall **)(_QWORD))(**(_QWORD **)(*(_QWORD *)(a1 + 1440) + 3920LL) + 168LL))(*(_QWORD *)(*(_QWORD *)(a1 + 1440) + 3920LL));
*(_WORD *)(a1 + 748) = 1;
cocos2d::CCNode::stopActionByTag(a1, 123);
cocos2d::CCNode::stopActionByTag(a1, 128);
*(_BYTE *)(a1 + 750) = 0;
*(_WORD *)(a1 + 861) = 0;
return 1;
}
}
return 0;
}