//
// ConfigureHSVWidget::getHSV from 0x4b7ae8 to 0x4b7c3e (342 bytes)
//
// 2 xrefs:
// > CustomizeObjectLayer::getHSV @ 0x4617d8
// > HSVLiveOverlay::createHSVWidget @ 0x5644ba
//
// 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
//
cocos2d::ccHSVValue *ConfigureHSVWidget::getHSV(
cocos2d::ccHSVValue *__return_ptr retstr,
GameObject *a2,
cocos2d::CCArray *a3,
int a4)
{
unsigned int v7; // r7
int v8; // r10
float v9; // s16
float v10; // s18
float v11; // s17
int v12; // r0
int v13; // r2
float v14; // r0
float v15; // r1
float v16; // r2
int v17; // r3
float h; // s15
float s; // s13
float v; // s14
GJSpriteColor *RelativeSpriteColor; // r0
int v23; // [sp+Ch] [bp-28h]
int v24; // [sp+1Ch] [bp-18h]
if ( a2 )
a3 = (cocos2d::CCArray *)cocos2d::CCArray::createWithObject((cocos2d::CCArray *)a2, a2);
if ( a3 )
{
v7 = 0;
v8 = 1;
v9 = flt_AC69AC;
v10 = flt_AC69B0;
v23 = *(_DWORD *)&byte_AC69B8;
v11 = flt_AC69B4;
while ( 1 )
{
if ( v7 >= cocos2d::CCArray::count(a3) )
{
v14 = v9;
v15 = v10;
v16 = v11;
v17 = v23;
goto LABEL_11;
}
v12 = cocos2d::CCArray::objectAtIndex(a3, v7);
v13 = *(_DWORD *)(v12 + 884);
if ( v13 == 1006 || v13 == 899 )
{
if ( a4 != 1 )
goto LABEL_23;
h = *(float *)(v12 + 1424);
v24 = *(_DWORD *)(v12 + 1436);
s = *(float *)(v12 + 1428);
v = *(float *)(v12 + 1432);
}
else
{
RelativeSpriteColor = GameObject::getRelativeSpriteColor((GameObject *)v12, a4);
if ( !RelativeSpriteColor )
goto LABEL_23;
h = RelativeSpriteColor->m_hsv.h;
s = RelativeSpriteColor->m_hsv.s;
v = RelativeSpriteColor->m_hsv.v;
v24 = *(_DWORD *)&RelativeSpriteColor->m_hsv.absoluteSaturation;
}
if ( h != -0.001 )
{
if ( v8 )
{
v8 = 0;
v11 = v;
v10 = s;
v23 = v24;
v9 = h;
}
else if ( v9 != h || v10 != s || v11 != v || (unsigned __int16)v23 != (unsigned __int16)v24 )
{
retstr->h = -0.001;
retstr->s = 0.0;
retstr->v = 0.0;
retstr->absoluteSaturation = 0;
retstr->absoluteBrightness = 0;
return retstr;
}
}
LABEL_23:
++v7;
}
}
v14 = flt_AC69AC;
v15 = flt_AC69B0;
v16 = flt_AC69B4;
v17 = *(_DWORD *)&byte_AC69B8;
LABEL_11:
retstr->h = v14;
retstr->s = v15;
retstr->v = v16;
*(_DWORD *)&retstr->absoluteSaturation = v17;
return retstr;
}