//
// cocos2d::CCSprite::updateColor from 0x100239150 to 0x100239218 (200 bytes)
//
// 9 xrefs:
// > CCSpriteWithHue::updateColor @ 0x1001a3a14
// > cocos2d::CCSprite::setOpacity @ 0x10023928c
// > cocos2d::CCSprite::setColor @ 0x100239398
// > cocos2d::CCSprite::setOpacityModifyRGB @ 0x100239458
// > sub_10023945C @ 0x100239478
// > cocos2d::CCSprite::updateDisplayedColor @ 0x1002394ac
// > sub_1002394B0 @ 0x1002394d4
// > cocos2d::CCSprite::updateDisplayedOpacity @ 0x1002394f8
// > sub_1002394FC @ 0x100239520
//
// 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::CCSprite::updateColor(cocos2d::CCSprite *a1)
{
unsigned int r; // w11
unsigned int g; // w10
unsigned int b; // w9
unsigned int displayedOpacity; // w8
float v5; // s0
unsigned int m_uAtlasIndex; // w2
r = a1->_displayedColor.r;
g = a1->_displayedColor.g;
b = a1->_displayedColor.b;
displayedOpacity = a1->_displayedOpacity;
if ( a1->m_bOpacityModifyRGB )
{
v5 = (float)displayedOpacity / 255.0;
r = (int)(float)(v5 * (float)r);
g = (int)(float)(v5 * (float)g);
b = (int)(float)(v5 * (float)b);
}
a1->m_sQuad.bl.colors.r = r;
a1->m_sQuad.bl.colors.g = g;
a1->m_sQuad.bl.colors.b = b;
a1->m_sQuad.bl.colors.a = displayedOpacity;
a1->m_sQuad.br.colors.r = r;
a1->m_sQuad.br.colors.g = g;
a1->m_sQuad.br.colors.b = b;
a1->m_sQuad.br.colors.a = displayedOpacity;
a1->m_sQuad.tl.colors.r = r;
a1->m_sQuad.tl.colors.g = g;
a1->m_sQuad.tl.colors.b = b;
a1->m_sQuad.tl.colors.a = displayedOpacity;
a1->m_sQuad.tr.colors.r = r;
a1->m_sQuad.tr.colors.g = g;
a1->m_sQuad.tr.colors.b = b;
a1->m_sQuad.tr.colors.a = displayedOpacity;
if ( a1->m_pobBatchNode )
{
m_uAtlasIndex = a1->m_uAtlasIndex;
if ( m_uAtlasIndex == -1 )
((void (__fastcall *)(cocos2d::CCSprite *, __int64))a1->setDirty)(a1, 1);
else
cocos2d::CCTextureAtlas::updateQuad(a1->m_pobTextureAtlas, &a1->m_sQuad, m_uAtlasIndex);
}
}