//
// cocos2d::CCLayer::registerWithTouchDispatcher from 0x180050910 to 0x18005098e (126 bytes)
//
// 7 xrefs:
// > ??> @ 0x1800ed258
// > ??> @ 0x1800ed718
// > ??> @ 0x1800edc50
// > ??> @ 0x1800ee1b8
// > ??> @ 0x1800ee790
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b2034
//
// 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 cocos2d::CCLayer::registerWithTouchDispatcher(cocos2d::CCLayer *this)
{
struct cocos2d::CCDirector *v2; // rax
cocos2d::CCTouchDispatcher *v3; // rax
cocos2d::CCTouchScriptHandlerEntry *m_pScriptTouchHandlerEntry; // r8
struct cocos2d::CCTouchDelegate *v5; // rdx
char m_bSwallowsTouches; // r9
int m_nPriority; // r8d
v2 = cocos2d::CCDirector::sharedDirector();
v3 = (cocos2d::CCTouchDispatcher *)((__int64 (__fastcall *)(struct cocos2d::CCDirector *))v2->getTouchDispatcher)(v2);
m_pScriptTouchHandlerEntry = this->m_pScriptTouchHandlerEntry;
v5 = &this->cocos2d::CCTouchDelegate;
if ( m_pScriptTouchHandlerEntry )
{
if ( !m_pScriptTouchHandlerEntry->m_bIsMultiTouches )
{
m_bSwallowsTouches = m_pScriptTouchHandlerEntry->m_bSwallowsTouches;
m_nPriority = m_pScriptTouchHandlerEntry->m_nPriority;
LABEL_9:
if ( !this )
v5 = nullptr;
cocos2d::CCTouchDispatcher::addTargetedDelegate(v3, v5, m_nPriority, m_bSwallowsTouches);
return;
}
}
else if ( this->m_eTouchMode )
{
m_nPriority = this->m_nTouchPriority;
m_bSwallowsTouches = 1;
goto LABEL_9;
}
if ( !this )
v5 = nullptr;
cocos2d::CCTouchDispatcher::addStandardDelegate(v3, v5, 0);
}