//
// Slider::init from 0x2f5780 to 0x2f58c6 (326 bytes)
//
// 1 xrefs:
// > Slider::create @ 0x2f595c
//
// 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 Slider::init(
Slider *a1,
cocos2d::CCNode *a2,
cocos2d::SEL_MenuHandler a3,
const char *a4,
const char *a5,
const char *a6,
const char *a7,
float a8)
{
_BOOL4 v10; // r0
bool v11; // r7
const char *v12; // r1
cocos2d::CCSprite *v13; // r0
cocos2d::CCSprite_vtbl *v14; // r3
const char *v15; // r1
cocos2d::CCSprite *v16; // r0
float width; // s15
cocos2d::CCTexture2D *v18; // r0
cocos2d::CCSprite *m_sliderBar; // r8
void (__fastcall *setAnchorPoint)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9
cocos2d::CCSprite *v21; // r8
void (__fastcall *setPosition)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9
cocos2d::CCPoint v24; // [sp+1Ch] [bp-20h] BYREF
cocos2d::ccTexParams v25; // [sp+24h] [bp-18h] BYREF
v10 = cocos2d::CCLayer::init(a1);
v11 = v10;
if ( v10 )
{
a1->m_touchLogic = SliderTouchLogic::create(a2, a3, a6, a7, a8);
v13 = (cocos2d::CCSprite *)cocos2d::CCSprite::create((cocos2d::CCSprite *)a5, v12);
v14 = v13->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_groove = v13;
((void (__fastcall *)(cocos2d::CCSprite *, _DWORD))v14->setScale)(v13, LODWORD(a8));
a1->addChild(a1, a1->m_groove);
a1->addChild(a1, a1->m_touchLogic);
v16 = (cocos2d::CCSprite *)cocos2d::CCSprite::create((cocos2d::CCSprite *)a4, v15);
width = a1->m_groove->m_obRect.size.width;
a1->m_height = 8.0;
a1->m_width = width - 4.0;
a1->m_sliderBar = v16;
*(_QWORD *)&v25.minFilter = 0x260100002601LL;
*(_QWORD *)&v25.wrapS = 0x290100002901LL;
v18 = v16->getTexture(v16);
cocos2d::CCTexture2D::setTexParameters(v18, &v25);
a1->m_groove->addChild_0(a1->m_groove, a1->m_sliderBar, -1);
m_sliderBar = a1->m_sliderBar;
setAnchorPoint = m_sliderBar->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v24, 0.0, 0.0);
setAnchorPoint(m_sliderBar, &v24);
v21 = a1->m_sliderBar;
setPosition = v21->setPosition;
cocos2d::CCPoint::CCPoint(&v24, 2.0, 4.0);
setPosition(v21, &v24);
((void (__fastcall *)(cocos2d::CCSprite *, int))a1->m_sliderBar->setScaleY)(a1->m_sliderBar, 1065353216);
a1->m_touchLogic->m_slider = a1;
}
return v11;
}