//
// cocos2d::CCTouchDispatcher::removeDelegate from 0x5fa9c0 to 0x5fa9fe (62 bytes)
//
// 3 xrefs:
// > cocos2d::CCScrollLayer::~CCScrollLayer @ 0x2e7bd2
// > cocos2d::CCLayer::setTouchEnabled @ 0x5cf2fa
// > cocos2d::CCLayer::onExit @ 0x5d039e
//
// 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 cocos2d::CCTouchDispatcher::removeDelegate(cocos2d::CCTouchDispatcher *a1, cocos2d::CCTouchDelegate *a2)
{
cocos2d::CCTouchHandler *Handler; // r1
bool v5; // [sp+0h] [bp-4h]
if ( a2 )
{
if ( a1->m_bLocked )
{
Handler = cocos2d::CCTouchDispatcher::findHandler(a1, (cocos2d::CCTouchDelegate *)a1->m_pHandlersToAdd);
if ( Handler )
{
cocos2d::CCArray::removeObject(a1->m_pHandlersToAdd, (cocos2d::_ccArray *)Handler, 1, v5);
}
else
{
cocos2d::ccCArrayAppendValue(&a1->m_pHandlersToRemove->num, (cocos2d::_ccCArray *)a2);
a1->m_bToRemove = 1;
}
}
else
{
cocos2d::CCTouchDispatcher::forceRemoveDelegate(a1, a2);
}
}
}