//
// CCSpriteWithHue::draw from 0x140048c90 to 0x140048e6f (479 bytes)
//
// 5 xrefs:
// > ??> @ 0x140530f08
// > ??> @ 0x140531448
// > ??> @ 0x14066319c
// > ??> @ 0x1406631ac
// > ??> @ 0x1406c4be4
//
// 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
//
// write access to const memory has been detected, the output may be wrong!
void CCSpriteWithHue::draw(CCSpriteWithHue *a1)
{
cocos2d::CCGLProgram *v2; // rax
cocos2d::CCGLProgram *v3; // rax
GLuint v4; // eax
unsigned int v5; // edx
unsigned int v6; // edx
cocos2d::CCGLProgram *v7; // rax
float v8; // xmm6_4
cocos2d::CCGLProgram *v9; // rax
cocos2d::CCGLProgram *v10; // rax
if ( !a1->m_bDontDraw )
{
if ( a1->_realOpacity )
{
cocos2d::ccGLEnable((cocos2d *)(unsigned int)a1->m_eGLServerState);
a1->getShaderProgram(a1);
v2 = a1->getShaderProgram(a1);
cocos2d::CCGLProgram::use(v2);
v3 = a1->getShaderProgram(a1);
cocos2d::CCGLProgram::setUniformsForBuiltins(v3);
cocos2d::ccGLBlendFunc((cocos2d *)a1->m_sBlendFunc.src, a1->m_sBlendFunc.dst);
v4 = a1->m_pobTexture->getName(a1->m_pobTexture);
cocos2d::ccGLBindTexture2D((cocos2d *)v4, v5);
cocos2d::ccGLEnableVertexAttribs((cocos2d *)7, v6);
v7 = a1->getShaderProgram(a1);
cocos2d::CCGLProgram::setUniformLocationWithMatrix3fv(v7, a1->m_uHueLoc, (float *)&a1->m_colorMatrix, 1u);
v8 = (float)a1->_displayedOpacity / 255.0;
v9 = a1->getShaderProgram(a1);
cocos2d::CCGLProgram::setUniformLocationWith1f(v9, a1->m_uAlphaLoc, v8);
v10 = a1->getShaderProgram(a1);
cocos2d::CCGLProgram::setUniformLocationWith3f(
v10,
a1->m_uLumLoc,
a1->m_luminance._Elems[0],
a1->m_luminance._Elems[1],
a1->m_luminance._Elems[2]);
_glewVertexAttribPointer(0, 3, 5126);
_glewVertexAttribPointer(2, 2, 5126);
_glewVertexAttribPointer(1, 4, 5121);
glDrawArrays(5u, 0, 4);
++g_uNumberOfDraws;
}
}
}