//
// cocos2d::extension::CCControlSlider::initWithSprites from 0xa9e568 to 0xa9e880 (792 bytes)
//
// 2 xrefs:
// > ??> @ 0x6d7e8
// > ??> @ 0x11f6ec8
//
// 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::CCControlSlider::initWithSprites(
cocos2d::extension::CCControlSlider *a1,
cocos2d::CCSprite *a2,
cocos2d::CCSprite *a3,
cocos2d::CCSprite *a4)
{
bool v8; // w22
cocos2d::CCSprite *v10; // x0
cocos2d::CCSprite *v11; // x25
cocos2d::CCSprite *v12; // x0
cocos2d::CCSprite *v13; // x0
cocos2d::CCSprite *v14; // x24
void (__fastcall *setContentSize)(cocos2d::CCNode *__hidden, const cocos2d::CCSize *); // x23
__int64 v16; // x23
void (__fastcall *v17)(__int64, cocos2d::CCRect *); // x24
__int64 v18; // x23
void (__fastcall *v19)(__int64, cocos2d::CCRect *); // x24
const cocos2d::CCSize *v20; // x0
__int64 v21; // x23
void (__fastcall *v22)(__int64, cocos2d::CCRect *); // x24
__int64 v23; // x23
void (__fastcall *v24)(__int64, cocos2d::CCRect *); // x24
const cocos2d::CCSize *v25; // x0
__int64 v26; // x23
void (__fastcall *v27)(__int64, cocos2d::CCRect *); // x24
const cocos2d::CCSize *v28; // x0
void (__fastcall *setValue)(cocos2d::extension::CCControlSlider *__hidden, float); // x1
float v30; // [xsp+50h] [xbp+50h]
float v31; // [xsp+70h] [xbp+70h]
float v32; // [xsp+74h] [xbp+74h]
cocos2d::CCRect v33; // [xsp+78h] [xbp+78h] BYREF
cocos2d::CCRect v34; // [xsp+88h] [xbp+88h] BYREF
v8 = cocos2d::extension::CCControl::init(a1);
if ( v8 )
{
a1->ignoreAnchorPointForPosition(a1, 0);
a1->setTouchEnabled(a1, 1);
v10 = *(cocos2d::CCSprite **)&a1[1].m_unknown2;
v11 = v10;
if ( v10 != a2 )
{
v11 = nullptr;
if ( a2 )
{
v11 = a2;
cocos2d::CCObject::retain(a2);
v10 = *(cocos2d::CCSprite **)&a1[1].m_unknown2;
}
if ( v10 )
cocos2d::CCObject::release(v10);
*(_QWORD *)&a1[1].m_unknown2 = a2;
}
v12 = *(cocos2d::CCSprite **)&a1[1].m_uIndexInArray;
if ( a3 != v12 )
{
if ( a3 )
{
cocos2d::CCObject::retain(a3);
v12 = *(cocos2d::CCSprite **)&a1[1].m_uIndexInArray;
}
if ( v12 )
cocos2d::CCObject::release(v12);
*(_QWORD *)&a1[1].m_uIndexInArray = a3;
}
v13 = *(cocos2d::CCSprite **)&a1[1].m_uAutoReleaseCount;
v14 = a4;
if ( a4 != v13 )
{
v14 = nullptr;
if ( a4 )
{
v14 = a4;
cocos2d::CCObject::retain(a4);
v13 = *(cocos2d::CCSprite **)&a1[1].m_uAutoReleaseCount;
}
if ( v13 )
cocos2d::CCObject::release(v13);
*(_QWORD *)&a1[1].m_uAutoReleaseCount = a4;
}
cocos2d::CCNode::boundingBox(v11);
cocos2d::CCNode::boundingBox(v14);
cocos2d::extension::CCControlUtils::CCRectUnion(&v33, &v34);
setContentSize = a1->setContentSize;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v34, v31, v32);
setContentSize(a1, (const cocos2d::CCSize *)&v34);
v16 = *(_QWORD *)&a1[1].m_unknown2;
v17 = *(void (__fastcall **)(__int64, cocos2d::CCRect *))(*(_QWORD *)v16 + 280LL);
cocos2d::CCPoint::CCPoint(&v34.origin, 0.5, 0.5);
v17(v16, &v34);
v18 = *(_QWORD *)&a1[1].m_unknown2;
v19 = *(void (__fastcall **)(__int64, cocos2d::CCRect *))(*(_QWORD *)v18 + 184LL);
v30 = a1->getContentSize(a1)->width * 0.5;
v20 = a1->getContentSize(a1);
cocos2d::CCPoint::CCPoint(&v34.origin, v30, v20->height * 0.5);
v19(v18, &v34);
a1->addChild(a1, *(cocos2d::CCNode **)&a1[1].m_unknown2);
v21 = *(_QWORD *)&a1[1].m_uIndexInArray;
v22 = *(void (__fastcall **)(__int64, cocos2d::CCRect *))(*(_QWORD *)v21 + 280LL);
cocos2d::CCPoint::CCPoint(&v34.origin, 0.0, 0.5);
v22(v21, &v34);
v23 = *(_QWORD *)&a1[1].m_uIndexInArray;
v24 = *(void (__fastcall **)(__int64, cocos2d::CCRect *))(*(_QWORD *)v23 + 184LL);
v25 = a1->getContentSize(a1);
cocos2d::CCPoint::CCPoint(&v34.origin, 0.0, v25->height * 0.5);
v24(v23, &v34);
a1->addChild(a1, *(cocos2d::CCNode **)&a1[1].m_uIndexInArray);
v26 = *(_QWORD *)&a1[1].m_uAutoReleaseCount;
v27 = *(void (__fastcall **)(__int64, cocos2d::CCRect *))(*(_QWORD *)v26 + 184LL);
v28 = a1->getContentSize(a1);
cocos2d::CCPoint::CCPoint(&v34.origin, 0.0, v28->height * 0.5);
v27(v26, &v34);
a1->addChild(a1, *(cocos2d::CCNode **)&a1[1].m_uAutoReleaseCount);
setValue = a1->setValue;
*(float *)&a1[1].m_uID = 1.0;
HIDWORD(a1[1].cocos2d::extension::CCControl::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable) = 0;
setValue(a1, 0.0);
}
return v8;
}