//
// cocos2d::CCMouseDispatcher::flushPendingDelegates from 0x1800631e0 to 0x180063288 (168 bytes)
//
// 4 xrefs:
// > ??> @ 0x180142b50
// > ??> @ 0x180142b60
// > ??> @ 0x18014cf68
// > ??> @ 0x1801bd8ac
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:21:51 +0000
//
void __fastcall cocos2d::CCMouseDispatcher::flushPendingDelegates(cocos2d::CCMouseDispatcher *this)
{
__int64 v1; // rdi
Concurrency::details::_NonReentrantLock *v3; // rcx
unsigned int i; // esi
Concurrency::details::_NonReentrantLock *v5; // rcx
struct cocos2d::CCObject *v6; // rax
v1 = 0;
if ( *((_BYTE *)this + 66) )
{
*((_BYTE *)this + 66) = 0;
v3 = *((Concurrency::details::_NonReentrantLock **)this + 10);
for ( i = 0; i < *(_DWORD *)v3; ++i )
{
cocos2d::CCMouseDispatcher::forceRemoveDelegate(
this,
*(struct cocos2d::CCMouseDelegate **)(*((_QWORD *)v3 + 2) + 8LL * i));
v3 = *((Concurrency::details::_NonReentrantLock **)this + 10);
}
Concurrency::details::_NonReentrantLock::_Release(v3);
}
if ( *((_BYTE *)this + 65) )
{
v5 = *((Concurrency::details::_NonReentrantLock **)this + 9);
*((_BYTE *)this + 65) = 0;
if ( *(_DWORD *)v5 )
{
do
{
v6 = cocos2d::CCMouseHandler::handlerWithDelegate(*(struct cocos2d::CCMouseDelegate **)(*((_QWORD *)v5 + 2)
+ 8 * v1));
if ( v6 )
cocos2d::CCArray::addObject(*((cocos2d::CCArray **)this + 7), v6);
v5 = *((Concurrency::details::_NonReentrantLock **)this + 9);
v1 = (unsigned int)(v1 + 1);
}
while ( (unsigned int)v1 < *(_DWORD *)v5 );
}
Concurrency::details::_NonReentrantLock::_Release(v5);
}
}