//
// GJChestSprite::setColor from 0x140567020 to 0x1405670e0 (192 bytes)
//
// 2 xrefs:
// > ??> @ 0x1407db1a0
// > ??> @ 0x14092c57c
//
// 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:34:17 +0000
//
int __fastcall GJChestSprite::setColor(cocos2d::CCSprite *a1, __int16 *a2)
{
bool v2; // zf
_BYTE *v3; // rbx
__int16 v4; // ax
int v5; // r8d
cocos2d::CCArray *v6; // rax
cocos2d::CCArray *v7; // rbx
struct cocos2d::CCObject *v8; // rax
__int16 v10; // [rsp+30h] [rbp+8h] BYREF
char v11; // [rsp+32h] [rbp+Ah]
v2 = *((_BYTE *)a1 + 288) == 0;
v3 = (char *)a1 - 320;
v4 = *a2;
v5 = *((unsigned __int8 *)a2 + 2);
v10 = *a2;
v11 = v5;
if ( !v2 )
{
LOBYTE(v10) = (int)(float)((float)(unsigned __int8)v4 * 0.40000001);
HIBYTE(v10) = (int)(float)((float)HIBYTE(v10) * 0.40000001);
v11 = (int)(float)((float)v5 * 0.40000001);
}
cocos2d::CCSprite::setColor(a1, (const struct cocos2d::_ccColor3B *)&v10);
v6 = (cocos2d::CCArray *)(*(__int64 (__fastcall **)(_BYTE *))(*(_QWORD *)v3 + 480LL))(v3);
v7 = v6;
if ( v6 )
{
LODWORD(v6) = cocos2d::CCArray::count(v6);
if ( (_DWORD)v6 )
{
v8 = cocos2d::CCArray::objectAtIndex(v7, 0);
LODWORD(v6) = (**((__int64 (__fastcall ***)(__int64, __int16 *))v8 + 40))((__int64)v8 + 320, &v10);
}
}
return (int)v6;
}