//
// cocos2d::extension::CCControlHuePicker::initWithTargetAndPos from 0xd0eb84 to 0xd0ed40 (444 bytes)
//
// 2 xrefs:
// > ??> @ 0xbf638
// > ??> @ 0x150b8b0
//
// This function is hookable on this platform (idp: arm, 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 13:07:01 +0000
//
__int64 __fastcall cocos2d::extension::CCControlHuePicker::initWithTargetAndPos(__int64 a1, __int64 a2, float *a3)
{
unsigned __int8 v6; // w0
unsigned int v7; // w21
cocos2d::CCObject *v9; // x0
cocos2d::CCObject *v10; // x26
cocos2d::CCObject *v11; // x1
cocos2d::CCObject *v12; // x0
cocos2d::CCObject *v13; // x25
cocos2d::CCObject *v14; // x1
float v15; // s8
void (__fastcall *v16)(cocos2d::CCObject *, _BYTE *); // x24
float v17; // [xsp+60h] [xbp+60h]
_BYTE v18[8]; // [xsp+70h] [xbp+70h] BYREF
__int64 v19; // [xsp+78h] [xbp+78h] BYREF
float v20; // [xsp+84h] [xbp+84h]
v6 = cocos2d::extension::CCControl::init((cocos2d::extension::CCControl *)a1);
v7 = v6;
if ( v6 )
{
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1000LL))(a1, 1);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v18, (const cocos2d::CCPoint *)a3);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v19, 0.0, 0.0);
v9 = (cocos2d::CCObject *)cocos2d::extension::CCControlUtils::addSpriteToTargetWithPosAndAnchor(
"huePickerBackground.png",
a2,
v18,
&v19);
v10 = v9;
v11 = *(cocos2d::CCObject **)(a1 + 480);
if ( v11 != v9 )
{
if ( v9 )
{
cocos2d::CCObject::retain(v9);
v11 = *(cocos2d::CCObject **)(a1 + 480);
}
if ( v11 )
cocos2d::CCObject::release(v11);
*(_QWORD *)(a1 + 480) = v10;
}
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v18, (const cocos2d::CCPoint *)a3);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v19, 0.5, 0.5);
v12 = (cocos2d::CCObject *)cocos2d::extension::CCControlUtils::addSpriteToTargetWithPosAndAnchor(
"colourPicker.png",
a2,
v18,
&v19);
v13 = v12;
v14 = *(cocos2d::CCObject **)(a1 + 488);
if ( v12 != v14 )
{
if ( v12 )
{
cocos2d::CCObject::retain(v12);
v14 = *(cocos2d::CCObject **)(a1 + 488);
}
if ( v14 )
cocos2d::CCObject::release(v14);
*(_QWORD *)(a1 + 488) = v13;
}
v15 = a3[1];
v16 = *(void (__fastcall **)(cocos2d::CCObject *, _BYTE *))(*(_QWORD *)v13 + 184LL);
v17 = *a3;
cocos2d::CCNode::boundingBox(&v19, *(cocos2d::CCNode **)(a1 + 480));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v18, v17, v15 + (float)(v20 * 0.5));
v16(v13, v18);
cocos2d::CCPoint::operator=(a1 + 496, a3);
*(_DWORD *)(a1 + 472) = 0;
*(_DWORD *)(a1 + 476) = 0;
}
return v7;
}