//
// cocos2d::extension::CCControlHuePicker::initWithTargetAndPos from 0x1001af898 to 0x1001af9cc (308 bytes)
//
// 1 xrefs:
// > ??> @ 0x1007b0430
//
// 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::CCControlHuePicker::initWithTargetAndPos(
cocos2d::extension::CCControlHuePicker *a1,
cocos2d::CCNode *a2,
cocos2d::CCPoint a3)
{
__int64 v3; // x2
__int64 v4; // x21
_BOOL4 v7; // w20
__n128 v8; // q0
__n128 v9; // q1
cocos2d::CCSprite *v10; // x0
__n128 v11; // q0
__n128 v12; // q1
cocos2d::CCSprite *v13; // x0
unsigned __int32 v14; // s8
float v15; // s10
cocos2d::CCSprite *m_slider; // x22
__n128 v17; // q1
__n128 v18; // q0
__int64 v20; // [xsp+8h] [xbp-58h] BYREF
float v21; // [xsp+14h] [xbp-4Ch]
int v22; // [xsp+18h] [xbp-48h] BYREF
cocos2d::CCPoint v23; // 0:s0.4,4:s1.4
cocos2d::CCPoint v24; // 0:s0.4,4:s1.4
cocos2d::CCPoint v25; // 0:s2.4,4:s3.4
cocos2d::CCPoint v26; // 0:s2.4,4:s3.4
v4 = v3;
v7 = cocos2d::extension::CCControl::init(a1);
if ( v7 )
{
((void (__fastcall *)(cocos2d::extension::CCControlHuePicker *, __int64))a1->setTouchEnabled)(a1, 1);
sub_1000229B8(&v20, (__int64 *)v4);
v8.n128_u32[0] = 0;
v9.n128_u32[0] = 0;
sub_100022980(v8, v9, &v22);
v10 = cocos2d::extension::CCControlUtils::addSpriteToTargetWithPosAndAnchor("huePickerBackground.png", a2, v23, v25);
sub_1001AF9CC(a1, v10);
sub_1000229B8(&v20, (__int64 *)v4);
v11.n128_u32[0] = 0.5;
v12.n128_u32[0] = 0.5;
sub_100022980(v11, v12, &v22);
v13 = cocos2d::extension::CCControlUtils::addSpriteToTargetWithPosAndAnchor("colourPicker.png", a2, v24, v26);
sub_1001AFA14(a1, v13);
v14 = *(_DWORD *)v4;
v15 = *(float *)(v4 + 4);
m_slider = a1->m_slider;
cocos2d::CCNode::boundingBox(a1->m_background);
v17.n128_f32[0] = v15 + (float)(v21 * 0.5);
v18.n128_u32[0] = v14;
sub_100022980(v18, v17, &v22);
((void (__fastcall *)(cocos2d::CCSprite *, int *))m_slider->setPosition)(m_slider, &v22);
sub_1000229D0(&a1->m_startPos, (double *)v4);
*(_QWORD *)&a1->m_hue = 0;
}
return v7;
}