//
// CCSpriteWithHue::draw from 0x1001a3c30 to 0x1001a3dac (380 bytes)
//
// 2 xrefs:
// > ??> @ 0x1007accf0
// > ??> @ 0x1007ad2a8
//
// 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 CCSpriteWithHue::draw(CCSpriteWithHue *a1)
{
cocos2d::CCGLProgram *v2; // x0
cocos2d::CCGLProgram *v3; // x0
unsigned int v4; // w0
cocos2d::CCGLProgram *v5; // x0
cocos2d::CCGLProgram *v6; // x0
unsigned int v7; // s0
cocos2d::CCGLProgram *v8; // x0
if ( !a1->m_bDontDraw )
{
if ( a1->_realOpacity )
{
cocos2d::ccGLEnable(a1->m_eGLServerState);
((void (__fastcall *)(CCSpriteWithHue *))a1->getShaderProgram)(a1);
v2 = (cocos2d::CCGLProgram *)((__int64 (__fastcall *)(CCSpriteWithHue *))a1->getShaderProgram)(a1);
cocos2d::CCGLProgram::use(v2);
v3 = (cocos2d::CCGLProgram *)((__int64 (__fastcall *)(CCSpriteWithHue *))a1->getShaderProgram)(a1);
cocos2d::CCGLProgram::setUniformsForBuiltins(v3);
cocos2d::ccGLBlendFunc(a1->m_sBlendFunc.src, a1->m_sBlendFunc.dst);
v4 = ((__int64 (__fastcall *)(cocos2d::CCTexture2D *))a1->m_pobTexture->getName)(a1->m_pobTexture);
cocos2d::ccGLBindTexture2D(v4);
cocos2d::ccGLEnableVertexAttribs(7u);
v5 = (cocos2d::CCGLProgram *)((__int64 (__fastcall *)(CCSpriteWithHue *))a1->getShaderProgram)(a1);
cocos2d::CCGLProgram::setUniformLocationWithMatrix3fv(v5, a1->m_uHueLoc, (float *)&a1->m_colorMatrix, 1u);
v6 = (cocos2d::CCGLProgram *)((__int64 (__fastcall *)(CCSpriteWithHue *))a1->getShaderProgram)(a1);
LOBYTE(v7) = a1->_displayedOpacity;
cocos2d::CCGLProgram::setUniformLocationWith1f(v6, a1->m_uAlphaLoc, (float)v7 / 255.0);
v8 = (cocos2d::CCGLProgram *)((__int64 (__fastcall *)(CCSpriteWithHue *))a1->getShaderProgram)(a1);
cocos2d::CCGLProgram::setUniformLocationWith3f(
v8,
a1->m_uLumLoc,
a1->m_luminance.__elems_[0],
a1->m_luminance.__elems_[1],
a1->m_luminance.__elems_[2]);
glVertexAttribPointer(0, 3, 0x1406u, 0, 24, &a1->m_sQuad);
glVertexAttribPointer(2u, 2, 0x1406u, 0, 24, &a1->m_sQuad.tl.texCoords);
glVertexAttribPointer(1u, 4, 0x1401u, 1u, 24, &a1->m_sQuad.tl.colors);
glDrawArrays(5u, 0, 4);
++dword_100885D50;
}
}
}