//
// cocos2d::CCTouchDispatcher::forceAddHandler from 0x10014ee80 to 0x10014ef54 (212 bytes)
//
// 3 xrefs:
// > cocos2d::CCTouchDispatcher::addTargetedDelegate @ 0x10014ee50
// > cocos2d::CCTouchDispatcher::addStandardDelegate @ 0x10014efc0
// > cocos2d::CCTouchDispatcher::touches @ 0x10014f628
//
// 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::forceAddHandler(
cocos2d::CCTouchDispatcher *a1,
cocos2d::CCTouchHandler *a2,
cocos2d::CCArray *a3)
{
cocos2d::ccArray *data; // x9
__int64 num; // x8
__int64 v7; // x21
cocos2d::CCTouchHandler **arr; // x25
unsigned __int64 v9; // x26
cocos2d::CCTouchHandler *v10; // x23
int Priority; // w22
int v12; // w24
cocos2d::CCTouchDelegate *Delegate; // x23
if ( a3 && (data = a3->data, num = data->num, (_DWORD)num) )
{
v7 = 0;
arr = (cocos2d::CCTouchHandler **)data->arr;
v9 = (unsigned __int64)&arr[num - 1];
do
{
v10 = *arr;
if ( !*arr )
break;
Priority = cocos2d::CCTouchHandler::getPriority(*arr);
v12 = cocos2d::CCTouchHandler::getPriority(a2);
Delegate = cocos2d::CCTouchHandler::getDelegate(v10);
if ( Delegate == cocos2d::CCTouchHandler::getDelegate(a2) )
return;
v7 = Priority >= v12 ? (unsigned int)v7 : (unsigned int)(v7 + 1);
++arr;
}
while ( (unsigned __int64)arr <= v9 );
}
else
{
v7 = 0;
}
sub_10024A428(a3, a2, v7);
}