//
// ConfigureHSVWidget::getHSV from 0xa3a530 to 0xa3a734 (516 bytes)
//
// 3 xrefs:
// > CustomizeObjectLayer::getHSV @ 0x983218
// > HSVLiveOverlay::createHSVWidget @ 0xb50860
// > ??> @ 0x5ad78
//
// 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 12:59:53 +0000
//
unsigned __int64 __fastcall ConfigureHSVWidget::getHSV(ConfigureHSVWidget *this, GameObject *a2, cocos2d::CCArray *a3)
{
unsigned __int64 v3; // x23
cocos2d::CCArray *v4; // x20
int v5; // w21
unsigned int v6; // w19
int v7; // w22
unsigned __int64 v8; // kr00_8
float v9; // s10
unsigned __int64 v10; // x26
unsigned __int8 v11; // w25
unsigned __int8 i; // w24
__int64 v13; // x0
int v14; // w2
__int64 v15; // x1
__int64 RelativeSpriteColor; // x0
float v17; // s0
float v18; // s1
unsigned __int8 v19; // w2
float v20; // s2
unsigned __int8 v21; // w0
v4 = a2;
v5 = (int)a3;
if ( this )
v4 = (cocos2d::CCArray *)cocos2d::CCArray::createWithObject(this, a2);
if ( !v4 )
return qword_155D3A8;
v6 = 0;
v7 = 1;
v8 = qword_155D3A8;
v9 = *(float *)&qword_155D3B0;
v10 = qword_155D3B0;
v11 = BYTE4(qword_155D3B0);
for ( i = BYTE5(qword_155D3B0); v6 < (unsigned int)cocos2d::CCArray::count(v4); ++v6 )
{
v13 = cocos2d::CCArray::objectAtIndex(v4, v6);
v14 = *(_DWORD *)(v13 + 1028);
v15 = v13;
if ( v14 == 1006 || v14 == 899 )
{
if ( v5 != 1 )
continue;
v17 = *(float *)(v13 + 1612);
v19 = *(_BYTE *)(v13 + 1624);
v18 = *(float *)(v13 + 1616);
v21 = *(_BYTE *)(v13 + 1625);
v20 = *(float *)(v15 + 1620);
}
else
{
RelativeSpriteColor = GameObject::getRelativeSpriteColor((GameObject *)v13, v5);
if ( !RelativeSpriteColor )
continue;
v17 = *(float *)(RelativeSpriteColor + 16);
v3 = *(_QWORD *)(RelativeSpriteColor + 24);
v18 = *(float *)(RelativeSpriteColor + 20);
v19 = *(_BYTE *)(RelativeSpriteColor + 28);
v20 = *(float *)(RelativeSpriteColor + 24);
v21 = *(_BYTE *)(RelativeSpriteColor + 29);
}
if ( v17 != -0.001 )
{
if ( v7 )
{
v9 = v20;
i = v21;
v11 = v19;
v7 = 0;
v8 = __PAIR64__(LODWORD(v18), LODWORD(v17));
}
else
{
if ( v17 != *(float *)&v8 || v18 != *((float *)&v8 + 1) )
return 3129152111LL;
if ( v20 != v9 )
return 3129152111LL;
v3 = v3 & 0xFFFF0000FFFFFFFFLL
| ((unsigned __int64)v19 << 32) & 0xFFFF00FFFFFFFFFFLL
| ((unsigned __int64)v21 << 40);
v10 = v10 & 0xFFFF0000FFFFFFFFLL
| ((unsigned __int64)v11 << 32) & 0xFFFF00FFFFFFFFFFLL
| ((unsigned __int64)i << 40);
if ( WORD2(v3) != WORD2(v10) )
return 3129152111LL;
}
}
}
return v8;
}