//
// Slider::init from 0x100304830 to 0x1003049d7 (423 bytes)
//
// 3 xrefs:
// > Slider::create_2 @ 0x1003045a9
// > Slider::create_1 @ 0x1003046cb
// > Slider::create @ 0x1003047e8
//
// 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 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)
{
size_t adj; // r12
void (__cdecl *ptr)(cocos2d::CCObject *); // r13
bool result; // al
size_t v12; // rdx
bool v13; // r12
cocos2d::CCSprite *v14; // rax
cocos2d::CCSprite *v15; // rax
cocos2d::CCTexture2D *v16; // rax
cocos2d::CCSprite *m_sliderBar; // r14
cocos2d::CCSprite *v18; // r14
__int128 v19; // [rsp+0h] [rbp-50h] BYREF
float v20; // [rsp+10h] [rbp-40h] BYREF
const char *v21; // [rsp+18h] [rbp-38h]
float v22; // [rsp+24h] [rbp-2Ch]
v22 = a8;
v21 = a4;
adj = a3.adj;
ptr = a3.ptr;
result = cocos2d::CCLayer::init(a1);
if ( result )
{
v12 = adj;
v13 = result;
a1->m_touchLogic = SliderTouchLogic::create(
a2,
(cocos2d::SEL_MenuHandler)__PAIR128__(v12, (unsigned __int64)ptr),
a6,
a7,
v22);
v14 = cocos2d::CCSprite::create_1(a5);
a1->m_groove = v14;
((void (__fastcall *)(cocos2d::CCSprite *, float))v14->setScale)(v14, v22);
((void (__fastcall *)(Slider *, cocos2d::CCSprite *))a1->addChild)(a1, a1->m_groove);
((void (__fastcall *)(Slider *, SliderTouchLogic *))a1->addChild)(a1, a1->m_touchLogic);
v15 = cocos2d::CCSprite::create_1(v21);
a1->m_sliderBar = v15;
a1->m_width = a1->m_groove->m_obRect.size.width + -4.0;
a1->m_height = 8.0;
v19 = xmmword_100815E00;
v16 = (cocos2d::CCTexture2D *)((__int64 (__fastcall *)(cocos2d::CCSprite *))v15->getTexture)(v15);
cocos2d::CCTexture2D::setTexParameters(v16, (cocos2d::ccTexParams *)&v19);
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSprite *, __int64))a1->m_groove->addChild_0)(
a1->m_groove,
a1->m_sliderBar,
0xFFFFFFFFLL);
m_sliderBar = a1->m_sliderBar;
sub_10028CBE0(&v20, 0.0, 0.0);
((void (__fastcall *)(cocos2d::CCSprite *, float *))m_sliderBar->setAnchorPoint)(m_sliderBar, &v20);
v18 = a1->m_sliderBar;
sub_10028CBE0(&v20, 2.0, 4.0);
((void (__fastcall *)(cocos2d::CCSprite *, float *))v18->setPosition)(v18, &v20);
((void (__fastcall *)(cocos2d::CCSprite *, float))a1->m_sliderBar->setScaleY)(a1->m_sliderBar, 1.0);
a1->m_touchLogic->m_slider = a1;
return v13;
}
return result;
}