//
// cocos2d::CCTouchDispatcher::findHandler from 0xb3ef34 to 0xb3efc4 (144 bytes)
//
// 2 xrefs:
// > cocos2d::CCTouchDispatcher::removeDelegate @ 0xb3eff0
// > ??> @ 0x9e010
//
// 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
//
cocos2d::CCTouchHandler *cocos2d::CCTouchDispatcher::findHandler(
cocos2d::CCTouchDispatcher *a1,
cocos2d::CCTouchDelegate *a2)
{
cocos2d::CCTouchDelegate *v2; // x2
cocos2d::CCTouchDelegate_vtbl *v3; // x0
cocos2d::CCTouchHandler **ccTouchBegan; // x19
cocos2d::CCTouchHandler **v5; // x21
cocos2d::CCTouchHandler *v6; // x20
cocos2d::CCTouchDelegate *v7; // x22
if ( !a2 )
return nullptr;
v3 = a2[7].__vftable;
if ( !LODWORD(v3->~CCTouchDelegate) )
return nullptr;
ccTouchBegan = (cocos2d::CCTouchHandler **)v3->ccTouchBegan;
v5 = &ccTouchBegan[LODWORD(v3->~CCTouchDelegate) - 1];
if ( ccTouchBegan > v5 )
return nullptr;
v6 = *ccTouchBegan;
v7 = v2;
if ( !*ccTouchBegan )
return nullptr;
while ( 1 )
{
++ccTouchBegan;
if ( v7 == cocos2d::CCTouchHandler::getDelegate(v6) )
break;
if ( v5 >= ccTouchBegan )
{
v6 = *ccTouchBegan;
if ( *ccTouchBegan )
continue;
}
return nullptr;
}
return v6;
}