//
// cocos2d::CCMenu::ccTouchBegan from 0x18005aed0 to 0x18005b029 (345 bytes)
//
// 3 xrefs:
// > ??> @ 0x1800fd558
// > ??> @ 0x18014cf68
// > ??> @ 0x1801bcd18
//
// 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:21:48 +0000
//
char __fastcall cocos2d::CCMenu::ccTouchBegan(
cocos2d::CCMenu *this,
struct cocos2d::CCTouch *a2,
struct cocos2d::CCEvent *a3)
{
cocos2d::CCMenu *v3; // rsi
__int64 v6; // rbx
__int64 Location; // rbp
__int64 v8; // rbx
__int64 v9; // rax
struct cocos2d::CCMenuItem *v10; // rcx
char v12; // [rsp+50h] [rbp+8h] BYREF
v3 = (cocos2d::CCMenu *)((char *)this - 320);
if ( !*((_DWORD *)this + 29) && *((_BYTE *)this - 34) && *((_BYTE *)this + 112) )
{
v6 = *((_QWORD *)this - 13);
if ( v6 )
{
while ( (*(unsigned __int8 (__fastcall **)(__int64, struct cocos2d::CCTouch *, struct cocos2d::CCEvent *))(*(_QWORD *)v6 + 344LL))(
v6,
a2,
a3) )
{
v6 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v6 + 504LL))(v6);
if ( !v6 )
goto LABEL_7;
}
}
else
{
LABEL_7:
Location = cocos2d::CCTouch::getLocation(a2, &v12);
if ( v3 && (v8 = (*(__int64 (__fastcall **)(cocos2d::CCMenu *))(*(_QWORD *)v3 + 504LL))(v3)) != 0 )
{
while ( 1 )
{
v9 = _RTDynamicCast(
v8,
0,
&cocos2d::CCNode `RTTI Type Descriptor',
&cocos2d::CCTouchClipper `RTTI Type Descriptor',
0);
if ( v9 )
{
if ( !(*(unsigned __int8 (__fastcall **)(__int64, __int64))(*(_QWORD *)v9 + 8LL))(v9, Location) )
break;
}
v8 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v8 + 504LL))(v8);
if ( !v8 )
goto LABEL_12;
}
}
else
{
LABEL_12:
v10 = cocos2d::CCMenu::itemForTouch(v3, a2, 0);
if ( !v10 )
v10 = cocos2d::CCMenu::itemForTouch(v3, a2, 1);
*((_QWORD *)this + 15) = v10;
if ( v10 )
{
*((_DWORD *)this + 29) = 1;
(*(void (__fastcall **)(struct cocos2d::CCMenuItem *))(*(_QWORD *)v10 + 896LL))(v10);
return 1;
}
}
}
}
return 0;
}