//
// cocos2d::CCTouchHandler::handlerWithDelegate from 0x1800b3d20 to 0x1800b3e0e (238 bytes)
//
// 2 xrefs:
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b87c0
//
// 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
//
struct cocos2d::CCTouchHandler *__fastcall cocos2d::CCTouchHandler::handlerWithDelegate(
struct cocos2d::CCTouchDelegate *a1,
int a2)
{
cocos2d::CCTouchHandler *v4; // rbx
bool (__fastcall *initWithDelegate)(cocos2d::CCTouchHandler *__hidden, struct cocos2d::CCTouchDelegate *, int); // r9
cocos2d::CCObject *v6; // rax
v4 = (cocos2d::CCTouchHandler *)operator new(0x48u);
if ( v4 )
{
*(_OWORD *)&v4->__vftable = 0;
*(_OWORD *)&v4->m_nTag = 0;
*(_OWORD *)&v4->m_uIndexInArray = 0;
*(_OWORD *)&v4->m_uOrderOfArrival = 0;
*(_QWORD *)&v4->m_nPriority = 0;
cocos2d::CCObject::CCObject(v4);
v4->__vftable = (cocos2d::CCTouchHandler_vtbl *)&cocos2d::CCTouchHandler::`vftable';
}
else
{
v4 = nullptr;
}
if ( !v4 )
return v4;
initWithDelegate = (bool (__fastcall *)(cocos2d::CCTouchHandler *__hidden, struct cocos2d::CCTouchDelegate *, int))v4->initWithDelegate;
if ( initWithDelegate == cocos2d::CCTouchHandler::initWithDelegate )
{
v4->m_pDelegate = a1;
v6 = (cocos2d::CCObject *)_RTDynamicCast(
a1,
0,
&cocos2d::CCTouchDelegate `RTTI Type Descriptor',
&cocos2d::CCObject `RTTI Type Descriptor',
0);
cocos2d::CCObject::retain(v6);
v4->m_nPriority = a2;
v4->m_nEnabledSelectors = 0;
LABEL_8:
cocos2d::CCObject::autorelease(v4);
return v4;
}
if ( initWithDelegate(v4, a1, a2) )
goto LABEL_8;
cocos2d::CCObject::release(v4);
return nullptr;
}