//
// cocos2d::CCTouchDispatcher::removeDelegate from 0x1004cc130 to 0x1004cc1e4 (180 bytes)
//
// 7 xrefs:
// > cocos2d::CCLayer::setTouchEnabled @ 0x1004b0965
// > cocos2d::CCLayer::onExit @ 0x1004b1050
// > sub_10056A8F0 @ 0x10056a964
// > sub_10056A990 @ 0x10056aa04
// > sub_10056AA30 @ 0x10056aa94
// > sub_10056AAC0 @ 0x10056ab34
// > sub_10056AB60 @ 0x10056abc4
//
// 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::CCTouchDispatcher::removeDelegate(
cocos2d::CCTouchDispatcher *a1,
cocos2d::CCTouchDelegate *a2)
{
cocos2d::CCArray *m_pHandlersToAdd; // rax
cocos2d::ccArray *data; // rax
cocos2d::CCTouchHandler **arr; // r12
unsigned __int64 v5; // r13
cocos2d::CCTouchHandler *v6; // r14
if ( a2 )
{
if ( a1->m_bLocked )
{
m_pHandlersToAdd = a1->m_pHandlersToAdd;
if ( m_pHandlersToAdd )
{
data = m_pHandlersToAdd->data;
if ( data->num )
{
arr = (cocos2d::CCTouchHandler **)data->arr;
v5 = (unsigned __int64)&arr[data->num - 1];
do
{
v6 = *arr;
if ( !*arr )
break;
if ( cocos2d::CCTouchHandler::getDelegate(*arr) == a2 )
{
sub_100720220(a1->m_pHandlersToAdd, v6, 1);
return;
}
++arr;
}
while ( (unsigned __int64)arr <= v5 );
}
}
sub_100668440(a1->m_pHandlersToRemove, a2);
a1->m_bToRemove = 1;
}
else
{
cocos2d::CCTouchDispatcher::forceRemoveDelegate(a1, a2);
}
}
}