//
// HSVLiveOverlay::hsvChanged from 0x1403c1480 to 0x1403c1566 (230 bytes)
//
// 2 xrefs:
// > ??> @ 0x140783dd8
// > ??> @ 0x140924098
//
// 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 11:31:28 +0000
//
int __fastcall HSVLiveOverlay::hsvChanged(__int64 a1, __int64 a2)
{
struct cocos2d::CCArray *v4; // rax
struct cocos2d::CCObject *v5; // rcx
unsigned int v6; // edi
int v7; // ebp
BOOL v8; // r14d
cocos2d::CCArray *v9; // rbx
struct cocos2d::CCObject *v10; // rcx
int v11; // eax
__int64 RelativeSpriteColor; // rax
__int128 v14; // [rsp+20h] [rbp-18h]
LODWORD(v4) = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 56LL))(a2);
v5 = *(struct cocos2d::CCObject **)(a1 + 8);
v6 = 0;
v7 = (int)v4;
v8 = (_DWORD)v4 != 1;
v14 = *(_OWORD *)(a2 + 376);
if ( v5 )
{
v4 = cocos2d::CCArray::createWithObject(v5);
v9 = v4;
}
else
{
v9 = *(cocos2d::CCArray **)(a1 + 16);
}
if ( v9 )
{
LODWORD(v4) = cocos2d::CCArray::count(v9);
if ( (_DWORD)v4 )
{
do
{
v10 = cocos2d::CCArray::objectAtIndex(v9, v6);
v11 = *((_DWORD *)v10 + 259);
if ( v11 == 1006 || v11 == 899 )
{
if ( v7 == 1 )
*(_OWORD *)((char *)v10 + 1628) = v14;
}
else
{
RelativeSpriteColor = GameObject::getRelativeSpriteColor((__int64)v10, v8 + 1);
if ( RelativeSpriteColor )
*(_OWORD *)(RelativeSpriteColor + 16) = v14;
}
++v6;
LODWORD(v4) = cocos2d::CCArray::count(v9);
}
while ( v6 < (unsigned int)v4 );
}
}
return (int)v4;
}