//
// GJChestSprite::setColor from 0x10021f8a0 to 0x10021f962 (194 bytes)
//
// 2 xrefs:
// > sub_10021F970 @ 0x10021f97c
// > ??> @ 0x1008e0a50
//
// 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
//
void __fastcall GJChestSprite::setColor(GJChestSprite *a1, const cocos2d::ccColor3B *a2)
{
__int64 v2; // rax
__int64 v3; // rax
__int64 v4; // rbx
__int64 v5; // rax
_DWORD v6[3]; // [rsp+0h] [rbp-Ch] BYREF
v6[0] = HIDWORD(v2);
*(cocos2d::ccColor3B *)v6 = *a2;
if ( a1->m_dark )
{
BYTE2(v6[0]) = (int)(float)((float)BYTE2(v6[0]) * 0.40000001);
LOWORD(v6[0]) = ((unsigned __int8)(int)(float)((float)BYTE1(v6[0]) * 0.40000001) << 8)
| (unsigned __int8)(int)(float)((float)LOBYTE(v6[0]) * 0.40000001);
}
cocos2d::CCSprite::setColor(a1, (const cocos2d::ccColor3B *)v6);
v3 = ((__int64 (__fastcall *)(GJChestSprite *))a1->getChildren)(a1);
if ( v3 )
{
v4 = v3;
if ( (unsigned int)sub_100720070(v3) )
{
v5 = sub_1007200C0(v4, 0);
(*(void (__fastcall **)(__int64, _DWORD *))(*(_QWORD *)v5 + 944LL))(v5, v6);
}
}
}