//
// cocos2d::extension::CCControlSwitch::ccTouchCancelled from 0xaa01d8 to 0xaa02a8 (208 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'cocos2d::extension::CCControlSwitch::ccTouchCancelled @ 0xaa02ac
// > ??> @ 0xc0678
// > ??> @ 0x11f7a28
//
// 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 cocos2d::extension::CCControlSwitch::ccTouchCancelled(
cocos2d::extension::CCControlSwitch *a1,
cocos2d::CCTouch *a2,
cocos2d::CCEvent *a3)
{
float *v4; // x0
float v5; // [xsp+30h] [xbp+30h]
cocos2d::CCPoint v6; // 0:kr00_8.8
v6 = cocos2d::extension::CCControlSwitch::locationFromTouch(a1, a2);
(*(void (__fastcall **)(cocos2d::CCCamera *(__fastcall *)(cocos2d::CCNode *__hidden), _UNKNOWN **, float, float))(*(_QWORD *)a1[1].getCamera + 944LL))(
a1[1].getCamera,
&off_F16218,
v6.x,
v6.y);
if ( LOBYTE(a1[1].m_nLuaID) )
{
v4 = (float *)(*((__int64 (__fastcall **)(cocos2d::extension::CCControlSwitch_vtbl *))a1[1].copyWithZone + 39))(a1[1].cocos2d::extension::CCControl::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable);
cocos2d::extension::CCControlSwitch::setOn(a1, v5 >= (float)(*v4 * 0.5), 1);
}
else
{
cocos2d::extension::CCControlSwitch::setOn(a1, BYTE1(a1[1].m_nLuaID) ^ 1, 1);
}
}