//
// CCSpriteWithHue::initShader from 0x306b40 to 0x306c3c (252 bytes)
//
// 1 xrefs:
// > CCSpriteWithHue::initWithTexture @ 0x30734a
//
// 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 CCSpriteWithHue::initShader(CCSpriteWithHue *a1)
{
cocos2d::CCShaderCache *v2; // r4
cocos2d::CCGLProgram *v3; // r4
const char *v4; // r8
const char *v5; // r0
cocos2d::CCShaderCache *v6; // r8
char *v7; // [sp+0h] [bp-8h] BYREF
v7 = (char *)a1;
v2 = cocos2d::CCShaderCache::sharedShaderCache();
((void (__fastcall *)(char **, CCSpriteWithHue *))a1->getShaderName)(&v7, a1);
v3 = cocos2d::CCShaderCache::programForKey(v2, v7);
sub_774008(&v7);
if ( !v3 )
{
v3 = (cocos2d::CCGLProgram *)operator new(0x68u);
cocos2d::CCGLProgram::CCGLProgram(v3);
v4 = cocos2d::ccPositionTextureColor_vert[0];
v5 = (const char *)a1->shaderBody(a1);
cocos2d::CCGLProgram::initWithVertexShaderByteArray(v3, v4, v5);
cocos2d::CCGLProgram::addAttribute(v3, "a_position", 0);
cocos2d::CCGLProgram::addAttribute(v3, "a_color", 1u);
cocos2d::CCGLProgram::addAttribute(v3, "a_texCoord", 2u);
cocos2d::CCGLProgram::link(v3);
cocos2d::CCGLProgram::updateUniforms(v3);
v6 = cocos2d::CCShaderCache::sharedShaderCache();
((void (__fastcall *)(char **, CCSpriteWithHue *))a1->getShaderName)(&v7, a1);
cocos2d::CCShaderCache::addProgram(v6, v3, v7);
sub_774008(&v7);
cocos2d::CCObject::release(v3);
}
a1->setShaderProgram(a1, v3);
CCSpriteWithHue::getUniformLocations(a1);
a1->updateColor(a1);
}