//
// cocos2d::extension::CCControlSwitch::initWithMaskSprite from 0x1003a86d0 to 0x1003a88a7 (471 bytes)
//
// 3 xrefs:
// > cocos2d::extension::CCControlSwitch::initWithMaskSprite_1 @ 0x1003a86c3
// > cocos2d::extension::CCControlSwitch::create_1 @ 0x1003a897d
// > cocos2d::extension::CCControlSwitch::create @ 0x1003a8a86
//
// 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 __fastcall cocos2d::extension::CCControlSwitch::initWithMaskSprite(
cocos2d::extension::CCControlSwitch *a1,
cocos2d::CCSprite *a2,
cocos2d::CCSprite *a3,
cocos2d::CCSprite *a4,
cocos2d::CCSprite *a5,
cocos2d::CCLabelTTF *a6,
cocos2d::CCLabelTTF *a7)
{
bool result; // al
cocos2d::extension::CCControlSwitch_vtbl *v11; // r15
cocos2d::extension::CCControlSwitch_vtbl *v12; // r14
__int64 v13; // rax
__int64 v14; // rax
float v15; // [rsp+8h] [rbp-48h] BYREF
cocos2d::CCLabelTTF *v16; // [rsp+10h] [rbp-40h]
cocos2d::CCSprite *v17; // [rsp+18h] [rbp-38h]
bool v18; // [rsp+27h] [rbp-29h]
v17 = a5;
result = cocos2d::extension::CCControl::init(a1);
if ( result )
{
v16 = a6;
v18 = result;
((void (__fastcall *)(cocos2d::extension::CCControlSwitch *, __int64))a1->setTouchEnabled)(a1, 1);
BYTE1(a1[1].m_nLuaID) = 1;
v11 = (cocos2d::extension::CCControlSwitch_vtbl *)operator new(0x2A8u);
cocos2d::CCSprite::CCSprite((__int64)v11, 1);
v11->copyWithZone = (cocos2d::CCObject *(__cdecl *)(cocos2d::CCCopying *__hidden, cocos2d::CCZone *))off_100927CD0;
v11->getScaledContentSize = (cocos2d::CCSize (__cdecl *)(cocos2d::CCNode *__hidden))off_1009281A8;
v11->setRotation = (void (__cdecl *)(cocos2d::CCNode *__hidden, float))off_100928228;
v11->setGrid = (void (__cdecl *)(cocos2d::CCNode *__hidden, cocos2d::CCGridBase *))off_100928258;
v11->getUserData = nullptr;
LODWORD(v11->setUserData) = 0;
*(_OWORD *)&v11->getUserObject = 0;
*(_OWORD *)&v11->getShaderProgram = 0;
*(_OWORD *)&v11->getCamera = 0;
v11->registerScriptHandler = nullptr;
a1[1].cocos2d::extension::CCControl::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable = v11;
sub_1003A79A0((__int64)v11, (__int64)a2, a3, a4, v17, v16, a7);
v12 = a1[1].cocos2d::extension::CCControl::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
*(float *)&v17 = *(float *)(*((__int64 (__fastcall **)(cocos2d::extension::CCControlSwitch_vtbl *))v12->copyWithZone
+ 39))(v12)
* 0.5;
v13 = (*((__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);
sub_10028CBE0(&v15, *(float *)&v17, *(float *)(v13 + 4) * 0.5);
(*((void (__fastcall **)(cocos2d::extension::CCControlSwitch_vtbl *, float *))v12->copyWithZone + 23))(v12, &v15);
((void (__fastcall *)(cocos2d::extension::CCControlSwitch *, cocos2d::extension::CCControlSwitch_vtbl *))a1->addChild)(
a1,
a1[1].cocos2d::extension::CCControl::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable);
((void (__fastcall *)(cocos2d::extension::CCControlSwitch *, _QWORD))a1->ignoreAnchorPointForPosition)(a1, 0);
sub_10028CBE0(&v15, 0.5, 0.5);
((void (__fastcall *)(cocos2d::extension::CCControlSwitch *, float *))a1->setAnchorPoint)(a1, &v15);
v14 = (*((__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);
((void (__fastcall *)(cocos2d::extension::CCControlSwitch *, __int64))a1->setContentSize)(a1, v14);
return v18;
}
return result;
}