//
// cocos2d::extension::CCControlHuePicker::initWithTargetAndPos from 0x1800080d0 to 0x1800082d4 (516 bytes)
//
// 5 xrefs:
// > ??> @ 0x180027358
// > ??> @ 0x180030054
// > ??> @ 0x180030094
// > ??> @ 0x180032408
// > ??> @ 0x18004b7d4
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:15:36 +0000
//
char __fastcall cocos2d::extension::CCControlHuePicker::initWithTargetAndPos(
cocos2d::extension::CCControl *a1,
__int64 a2,
float *a3)
{
__int64 v6; // rdx
__int64 v7; // rax
__int64 v8; // r14
__int64 v9; // r15
struct cocos2d::CCSprite *v10; // rax
cocos2d::CCObject *v11; // rbx
cocos2d::CCObject *v12; // rcx
__int64 v13; // rax
__int64 v14; // r14
__int64 v15; // r15
struct cocos2d::CCSprite *v16; // rax
cocos2d::CCObject *v17; // rbx
cocos2d::CCObject *v18; // rcx
float v19; // xmm6_4
__int64 v20; // rax
__int64 *v21; // rdi
__int64 v22; // rbx
__int64 v23; // rax
_BYTE v25[16]; // [rsp+20h] [rbp-38h] BYREF
char v26; // [rsp+78h] [rbp+20h] BYREF
if ( !cocos2d::extension::CCControl::init(a1) )
return 0;
LOBYTE(v6) = 1;
(*(void (__fastcall **)(cocos2d::extension::CCControl *, __int64))(*(_QWORD *)a1 + 920LL))(a1, v6);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v26, 0.0, 0.0);
v8 = v7;
v9 = cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v25, (const struct cocos2d::CCPoint *)a3);
v10 = cocos2d::CCSprite::createWithSpriteFrameName("huePickerBackground.png");
v11 = v10;
if ( v10 )
{
(*(void (__fastcall **)(struct cocos2d::CCSprite *, __int64))(*(_QWORD *)v10 + 184LL))(v10, v9);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v11 + 288LL))(v11, v8);
(*(void (__fastcall **)(__int64, cocos2d::CCObject *))(*(_QWORD *)a2 + 464LL))(a2, v11);
}
if ( *((cocos2d::CCObject **)a1 + 60) != v11 )
{
if ( v11 )
cocos2d::CCObject::retain(v11);
v12 = *((cocos2d::CCObject **)a1 + 60);
if ( v12 )
cocos2d::CCObject::release(v12);
*((_QWORD *)a1 + 60) = v11;
}
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v26, 0.5, 0.5);
v14 = v13;
v15 = cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v25, (const struct cocos2d::CCPoint *)a3);
v16 = cocos2d::CCSprite::createWithSpriteFrameName("colourPicker.png");
v17 = v16;
if ( v16 )
{
(*(void (__fastcall **)(struct cocos2d::CCSprite *, __int64))(*(_QWORD *)v16 + 184LL))(v16, v15);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v17 + 288LL))(v17, v14);
(*(void (__fastcall **)(__int64, cocos2d::CCObject *))(*(_QWORD *)a2 + 464LL))(a2, v17);
}
if ( *((cocos2d::CCObject **)a1 + 61) != v17 )
{
if ( v17 )
cocos2d::CCObject::retain(v17);
v18 = *((cocos2d::CCObject **)a1 + 61);
if ( v18 )
cocos2d::CCObject::release(v18);
*((_QWORD *)a1 + 61) = v17;
}
v19 = a3[1];
v20 = cocos2d::CCNode::boundingBox(*((_QWORD *)a1 + 60), v25);
v21 = *((__int64 **)a1 + 61);
v22 = *v21;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v26, *a3, (float)(*(float *)(v20 + 12) * 0.5) + v19);
(*(void (__fastcall **)(__int64 *, __int64))(v22 + 184))(v21, v23);
cocos2d::CCPoint::operator=((char *)a1 + 496, a3);
*((_QWORD *)a1 + 59) = 0;
return 1;
}