//
// cocos2d::extension::CCControlHuePicker::initWithTargetAndPos from 0xa9d14c to 0xa9d308 (444 bytes)
//
// 2 xrefs:
// > ??> @ 0x90b10
// > ??> @ 0x11f60c0
//
// 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::CCControlHuePicker::initWithTargetAndPos(
cocos2d::extension::CCControlHuePicker *a1,
cocos2d::CCNode *a2,
cocos2d::CCPoint a3)
{
const cocos2d::CCPoint *v3; // x2
const cocos2d::CCPoint *v6; // x22
bool v7; // w21
cocos2d::CCSprite *v9; // x0
cocos2d::CCSprite *v10; // x26
cocos2d::CCSprite *m_background; // x1
cocos2d::CCSprite *v12; // x0
cocos2d::CCSprite *v13; // x25
cocos2d::CCSprite *m_slider; // x1
float y; // s8
void (__fastcall *setPosition)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x24
float v17; // s0
float v18; // s1
float x; // [xsp+60h] [xbp+60h]
cocos2d::CCPoint v20; // [xsp+70h] [xbp+70h] BYREF
cocos2d::CCPoint v21; // [xsp+78h] [xbp+78h] BYREF
float v22; // [xsp+84h] [xbp+84h]
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
v6 = v3;
v7 = cocos2d::extension::CCControl::init(a1);
if ( v7 )
{
a1->setTouchEnabled(a1, 1);
cocos2d::CCPoint::CCPoint(&v20, v6);
cocos2d::CCPoint::CCPoint(&v21, 0.0, 0.0);
v9 = cocos2d::extension::CCControlUtils::addSpriteToTargetWithPosAndAnchor("huePickerBackground.png", a2, v23, v25);
v10 = v9;
m_background = a1->m_background;
if ( m_background != v9 )
{
if ( v9 )
{
cocos2d::CCObject::retain(v9);
m_background = a1->m_background;
}
if ( m_background )
cocos2d::CCObject::release(m_background);
a1->m_background = v10;
}
cocos2d::CCPoint::CCPoint(&v20, v6);
cocos2d::CCPoint::CCPoint(&v21, 0.5, 0.5);
v12 = cocos2d::extension::CCControlUtils::addSpriteToTargetWithPosAndAnchor("colourPicker.png", a2, v24, v26);
v13 = v12;
m_slider = a1->m_slider;
if ( v12 != m_slider )
{
if ( v12 )
{
cocos2d::CCObject::retain(v12);
m_slider = a1->m_slider;
}
if ( m_slider )
cocos2d::CCObject::release(m_slider);
a1->m_slider = v13;
}
y = v6->y;
setPosition = v13->setPosition;
x = v6->x;
cocos2d::CCNode::boundingBox(a1->m_background);
cocos2d::CCPoint::CCPoint(&v20, x, y + (float)(v22 * 0.5));
v17 = ((float (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCPoint *))setPosition)(v13, &v20);
cocos2d::CCPoint::operator=(&a1->m_startPos, v17, v18);
a1->m_hue = 0.0;
a1->m_huePercentage = 0.0;
}
return v7;
}