//
// cocos2d::CCSprite::updateColor from 0x5e6dec to 0x5e6ed4 (232 bytes)
//
// 6 xrefs:
// > CCSpriteWithHue::updateColor @ 0x307014
// > cocos2d::CCSprite::setOpacityModifyRGB @ 0x5e6ee4
// > cocos2d::CCSprite::setOpacity @ 0x5e7908
// > cocos2d::CCSprite::setColor @ 0x5e7948
// > cocos2d::CCSprite::updateDisplayedColor @ 0x5e7964
// > cocos2d::CCSprite::updateDisplayedOpacity @ 0x5e797e
//
// 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 cocos2d::CCSprite::updateColor(cocos2d::CCSprite *a1)
{
_BOOL4 m_bOpacityModifyRGB; // r5
int r; // r0
int g; // r2
int b; // r3
int displayedOpacity; // r4
float v7; // s14
cocos2d::CCSpriteBatchNode *m_pobBatchNode; // r3
unsigned int m_uAtlasIndex; // r2
m_bOpacityModifyRGB = a1->m_bOpacityModifyRGB;
r = a1->_displayedColor.r;
g = a1->_displayedColor.g;
b = a1->_displayedColor.b;
displayedOpacity = a1->_displayedOpacity;
if ( m_bOpacityModifyRGB )
{
v7 = (float)displayedOpacity / 255.0;
LOBYTE(r) = (unsigned int)(float)((float)r * v7);
LOBYTE(g) = (unsigned int)(float)((float)g * v7);
LOBYTE(b) = (unsigned int)(float)((float)b * v7);
}
a1->m_sQuad.bl.colors.b = b;
a1->m_sQuad.br.colors.b = b;
a1->m_sQuad.tl.colors.b = b;
a1->m_sQuad.tr.colors.b = b;
m_pobBatchNode = a1->m_pobBatchNode;
a1->m_sQuad.bl.colors.r = r;
a1->m_sQuad.bl.colors.g = g;
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.a = displayedOpacity;
a1->m_sQuad.tl.colors.r = r;
a1->m_sQuad.tl.colors.g = g;
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.a = displayedOpacity;
if ( m_pobBatchNode )
{
m_uAtlasIndex = a1->m_uAtlasIndex;
if ( m_uAtlasIndex == -1 )
a1->setDirty(a1, 1);
else
cocos2d::CCTextureAtlas::updateQuad(a1->m_pobTextureAtlas, &a1->m_sQuad, m_uAtlasIndex);
}
}