//
// cocos2d::extension::CCControlSwitch::ccTouchBegan from 0x5a4b98 to 0x5a4c20 (136 bytes)
//
// 1 xrefs:
// > `non-virtual thunk to'cocos2d::extension::CCControlSwitch::ccTouchBegan @ 0x5a4c2c
//
// 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
//
bool cocos2d::extension::CCControlSwitch::ccTouchBegan(
cocos2d::extension::CCControlSwitch *a1,
cocos2d::CCTouch *a2,
cocos2d::CCEvent *a3)
{
int v5; // r6
cocos2d::extension::CCControlSwitch_vtbl *v6; // r3
void (__fastcall *setMouseEnabled)(cocos2d::CCLayer *__hidden, bool); // r0
unsigned int v8; // s15
void (__fastcall *v9)(_DWORD, void *); // r3
cocos2d::CCPoint v11; // [sp+4h] [bp-10h] BYREF
if ( ((int (__fastcall *)(cocos2d::extension::CCControlSwitch *, cocos2d::CCTouch *, cocos2d::CCEvent *))a1->isTouchInside)(
a1,
a2,
a3)
&& ((int (__fastcall *)(cocos2d::extension::CCControlSwitch *))a1->isEnabled)(a1)
&& (v5 = ((int (__fastcall *)(cocos2d::extension::CCControlSwitch *))a1->isVisible)(a1)) != 0 )
{
LOBYTE(a1[1].m_nLuaID) = 0;
cocos2d::extension::CCControlSwitch::locationFromTouch(&v11, a1, a2);
v6 = a1[1].cocos2d::extension::CCControl::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
setMouseEnabled = v6->setMouseEnabled;
*(float *)&v8 = v11.x - *(float *)&v6->isAccelerometerEnabled;
v9 = *(void (__fastcall **)(_DWORD, void *))(*(_DWORD *)setMouseEnabled + 472);
a1[1].m_uID = v8;
v9(setMouseEnabled, &unk_9AE0B0);
cocos2d::extension::CCControlSwitchSprite::needsLayout((cocos2d::CCSprite *)a1[1].cocos2d::extension::CCControl::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable);
}
else
{
LOBYTE(v5) = 0;
}
return v5;
}