//
// cocos2d::CCLayerRGBA::setColor from 0x10014954c to 0x100149618 (204 bytes)
//
// 10 xrefs:
// > sub_100149618 @ 0x10014961c
// > cocos2d::CCLayerColor::setColor @ 0x100149d84
// > sub_100149DA0 @ 0x100149db4
// > ??> @ 0x100797818
// > ??> @ 0x1007ae268
// > ??> @ 0x1007af570
// > ??> @ 0x1007b0390
// > ??> @ 0x1007b6318
// > ??> @ 0x1007bfd00
// > ??> @ 0x1007e6f98
//
// 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 cocos2d::CCLayerRGBA::setColor(cocos2d::CCLayerRGBA *a1, const cocos2d::ccColor3B *a2)
{
__int64 v2; // x29
__int64 v3; // x30
__int16 v4; // w9
__int16 v5; // w8
cocos2d::CCNode *m_pParent; // x0
void *v8; // x0
void *v9; // x20
__int64 v10; // x0
char v11; // w8
__int16 v12; // [xsp+Ch] [xbp-24h] BYREF
char v13; // [xsp+Eh] [xbp-22h]
__int64 v14; // [xsp+20h] [xbp-10h]
__int64 v15; // [xsp+28h] [xbp-8h]
v4 = *(_WORD *)&a2->r;
a1->_realColor.b = a2->b;
*(_WORD *)&a1->_realColor.r = v4;
v5 = *(_WORD *)&a2->r;
a1->_displayedColor.b = a2->b;
*(_WORD *)&a1->_displayedColor.r = v5;
if ( a1->_cascadeColorEnabled )
{
v14 = v2;
v15 = v3;
v13 = -1;
v12 = -1;
m_pParent = a1->m_pParent;
if ( m_pParent )
{
v8 = __dynamic_cast(
m_pParent,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCNode,
(const struct __class_type_info *)&off_100770F10,
-2);
if ( v8 )
{
v9 = v8;
if ( (*(unsigned int (__fastcall **)(void *))(*(_QWORD *)v8 + 64LL))(v8) )
{
v10 = (*(__int64 (__fastcall **)(void *))(*(_QWORD *)v9 + 16LL))(v9);
v11 = *(_BYTE *)(v10 + 2);
v12 = *(_WORD *)v10;
v13 = v11;
}
}
}
((void (__fastcall *)(cocos2d::CCLayerRGBA *, __int16 *))a1->updateDisplayedColor)(a1, &v12);
}
}