//
// EditorUI::ccTouchBegan from 0x1401bff50 to 0x1401c0500 (1456 bytes)
//
// 2 xrefs:
// > ??> @ 0x1407511c0
// > ??> @ 0x14091a69c
//
// 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:28:02 +0000
//
// Hidden C++ exception states: #wind=2
char __fastcall EditorUI::ccTouchBegan(__int64 a1, __int64 a2, __int64 a3)
{
__int64 v6; // rcx
__int64 v7; // rcx
__int64 v8; // rax
__int64 v9; // rax
__int64 v10; // rax
const struct cocos2d::CCPoint *v11; // r8
__int64 v12; // rdx
__int64 v13; // rcx
__int64 v14; // r8
__int64 v15; // r9
cocos2d::CCEGLViewProtocol *v16; // rax
__int64 v17; // rcx
__int64 v18; // rax
__int64 v19; // rax
__int64 v20; // rax
char v21; // al
__int64 v22; // rax
cocos2d::CCObject *v24; // rcx
__int64 v25; // rcx
__int64 v26; // rax
__int64 v27; // rax
bool v28; // al
__int64 v29; // rcx
__int64 v30; // rbx
struct cocos2d::CCFiniteTimeAction *v31; // rax
struct cocos2d::CCAction *v32; // rbx
void *v33; // [rsp+20h] [rbp-38h] BYREF
struct __timeb64 Time; // [rsp+28h] [rbp-30h] BYREF
if ( *(_DWORD *)(a1 + 424) != -1
|| !(*(unsigned __int8 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 488) + 344LL))(*(_QWORD *)(a1 + 488))
|| !(*(unsigned __int8 (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)(*(_QWORD *)(a1 + 488) + 320LL) + 8LL))(
*(_QWORD *)(a1 + 488) + 320LL,
a2,
a3) )
{
if ( *(_DWORD *)(a1 + 428) == -1
&& (*(unsigned __int8 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 512) + 344LL))(*(_QWORD *)(a1 + 512))
&& (*(unsigned __int8 (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)(*(_QWORD *)(a1 + 512) + 320LL) + 8LL))(
*(_QWORD *)(a1 + 512) + 320LL,
a2,
a3) )
{
*(_DWORD *)(a1 + 428) = *(_DWORD *)(a2 + 56);
return 1;
}
if ( *(_DWORD *)(a1 + 440) == -1
&& (*(unsigned __int8 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 520) + 344LL))(*(_QWORD *)(a1 + 520))
&& (*(unsigned __int8 (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)(*(_QWORD *)(a1 + 520) + 320LL) + 8LL))(
*(_QWORD *)(a1 + 520) + 320LL,
a2,
a3) )
{
*(_DWORD *)(a1 + 440) = *(_DWORD *)(a2 + 56);
return 1;
}
if ( *(_DWORD *)(a1 + 432) != -1 && *(_DWORD *)(a1 + 444) == -1 && !*(_BYTE *)(a1 + 476) )
{
v6 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v33 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v33);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v6 = qword_14090BFD0;
}
if ( !(unsigned __int8)GameManager::getGameVariable(v6, "0245")
&& (*(_BYTE *)(a1 + 478) || !*(_BYTE *)(a1 + 593) && !*(_BYTE *)(a1 + 589) && !*(_BYTE *)(a1 + 590)) )
{
*(_DWORD *)(a1 + 444) = *(_DWORD *)(a2 + 56);
cocos2d::CCTouch::getLocationInView(a2, &v33);
v8 = cocos2d::CCDirector::sharedDirector(v7);
v9 = cocos2d::CCDirector::convertToGL(v8, &Time, &v33);
cocos2d::CCPoint::operator=(&v33, v9);
cocos2d::CCNode::convertToWorldSpace(a1 - 320, &Time, &v33);
cocos2d::CCPoint::operator=(&v33, v10);
cocos2d::CCPoint::operator=(a1 + 456, &v33);
*(float *)(a1 + 464) = cocos2d::ccpDistance(
(cocos2d *)(a1 + 448),
(const struct cocos2d::CCPoint *)(a1 + 456),
v11);
v16 = (cocos2d::CCEGLViewProtocol *)cocos2d::CCEGLView::sharedOpenGLView(v13, v12, v14, v15);
cocos2d::CCEGLViewProtocol::getScaleY(v16);
*(_DWORD *)(a1 + 468) = 1103364096;
*(float *)(a1 + 472) = (*(float (__fastcall **)(_QWORD))(**(_QWORD **)(*(_QWORD *)(a1 + 1192) + 4296LL) + 168LL))(*(_QWORD *)(*(_QWORD *)(a1 + 1192) + 4296LL));
*(_WORD *)(a1 + 476) = 1;
cocos2d::CCNode::stopActionByTag((cocos2d::CCNode *)(a1 - 320), 123);
cocos2d::CCNode::stopActionByTag((cocos2d::CCNode *)(a1 - 320), 128);
*(_WORD *)(a1 + 589) = 0;
LABEL_51:
*(_BYTE *)(a1 + 478) = 0;
return 1;
}
return 0;
}
cocos2d::CCTouch::getLocationInView(a2, &v33);
v18 = cocos2d::CCDirector::sharedDirector(v17);
v19 = cocos2d::CCDirector::convertToGL(v18, &Time, &v33);
cocos2d::CCPoint::operator=(&v33, v19);
cocos2d::CCNode::convertToWorldSpace(a1 - 320, &Time, &v33);
cocos2d::CCPoint::operator=(&v33, v20);
cocos2d::CCPoint::operator=(a1 + 1200, &v33);
v21 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 720) + 344LL))(*(_QWORD *)(a1 + 720));
if ( *(float *)(a1 + 584) <= *(float *)(a1 + 1204) )
{
v22 = *(_QWORD *)(a1 + 1192);
if ( *(_DWORD *)(v22 + 2204) != 1 )
{
if ( *(_DWORD *)(a1 + 432) == -1 )
{
v24 = *(cocos2d::CCObject **)(a1 + 408);
if ( v24 )
{
cocos2d::CCObject::release(v24);
*(_QWORD *)(a1 + 408) = 0;
}
if ( EditorUI::isFreeMoveTouch(a1 - 320) )
EditorUI::startFreeMoveTouch(a1 - 320);
if ( !*(_BYTE *)(a1 + 416) )
{
if ( *(_BYTE *)(a1 + 588)
|| (v26 = cocos2d::CCDirector::sharedDirector(v25),
*(_BYTE *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v26 + 176LL))(v26) + 152)) )
{
if ( *(_DWORD *)(a1 + 1188) == 3 )
{
*(_BYTE *)(a1 + 589) = 1;
cocos2d::CCPoint::operator=(a1 + 1208, a1 + 1200);
}
}
}
v28 = true;
if ( !*(_BYTE *)(a1 + 588) )
{
v27 = cocos2d::CCDirector::sharedDirector(v25);
if ( !*(_BYTE *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v27 + 176LL))(v27) + 152) )
v28 = false;
}
*(_BYTE *)(a1 + 590) = v28;
*(_BYTE *)(a1 + 591) = 0;
*(_DWORD *)(a1 + 432) = *(_DWORD *)(a2 + 56);
*(_BYTE *)(a1 + 436) = 0;
cocos2d::CCPoint::operator=(a1 + 448, a1 + 1200);
cocos2d::CCNode::stopActionByTag((cocos2d::CCNode *)(a1 - 320), 123);
if ( !*(_BYTE *)(a1 + 590) )
{
v29 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
Time.time = (__time64_t)operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(Time.time);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v29 = qword_14090BFD0;
}
if ( (unsigned __int8)GameManager::getGameVariable(v29, "0057") )
{
v30 = cocos2d::CCCallFunc::create(a1 - 320, EditorUI::triggerSwipeMode);
v31 = cocos2d::CCDelayTime::create(0.30000001);
v32 = cocos2d::CCSequence::create(v31, v30, 0);
(*(void (__fastcall **)(struct cocos2d::CCAction *, __int64))(*(_QWORD *)v32 + 64LL))(v32, 123);
cocos2d::CCNode::runAction((cocos2d::CCNode *)(a1 - 320), v32);
}
}
ftime64(&Time);
*(double *)(a1 + 1312) = (double)Time.millitm / 1000.0 + (double)SLODWORD(Time.time);
*(_BYTE *)(a1 + 1320) = 0;
cocos2d::CCNode::stopActionByTag((cocos2d::CCNode *)(a1 - 320), 128);
goto LABEL_51;
}
return 0;
}
}
else
{
if ( *(_DWORD *)(*(_QWORD *)(a1 + 1192) + 2204LL) != 1 || v21 )
return 0;
v22 = *(_QWORD *)(a1 + 1192);
}
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)(*(_QWORD *)(v22 + 13888) + 320LL) + 8LL))(
*(_QWORD *)(v22 + 13888) + 320LL,
a2,
a3);
return 1;
}
*(_DWORD *)(a1 + 424) = *(_DWORD *)(a2 + 56);
return 1;
}