//
// cocos2d::CCSprite::initWithTexture from 0x5e6ef4 to 0x5e7020 (300 bytes)
//
// 1 xrefs:
// > CCSpriteWithHue::initWithTexture @ 0x30733a
//
// 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
//
bool cocos2d::CCSprite::initWithTexture(cocos2d::CCSprite *a1, cocos2d::CCTexture2D *a2)
{
const cocos2d::CCRect *v2; // r2
_BOOL4 v3; // r3
_BOOL4 v4; // r7
const cocos2d::CCRect *v7; // r8
_BOOL4 v8; // r10
cocos2d::CCSprite_vtbl *v9; // r3
cocos2d::CCSprite_vtbl *v10; // r3
int v11; // r2
bool v12; // r3
void (__fastcall *setShaderProgram)(cocos2d::CCNode *__hidden, cocos2d::CCGLProgram *); // r11
cocos2d::CCShaderCache *v14; // r0
cocos2d::CCGLProgram *v15; // r0
void (__fastcall *setAnchorPoint)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // [sp+4h] [bp-18h]
cocos2d::CCPoint v18; // [sp+Ch] [bp-10h] BYREF
v4 = v3;
v7 = v2;
v8 = cocos2d::CCNodeRGBA::init(a1);
if ( v8 )
{
v9 = a1->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_pobBatchNode = nullptr;
a1->m_bRecursiveDirty = 0;
v9->setDirty(a1, 0);
a1->m_bOpacityModifyRGB = 1;
a1->m_sBlendFunc.src = 1;
a1->m_sBlendFunc.dst = 771;
v10 = a1->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_bFlipY = 0;
a1->m_bFlipX = 0;
setAnchorPoint = v10->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v18, 0.5, 0.5);
setAnchorPoint(a1, &v18);
cocos2d::CCPoint::operator=(&a1->m_obOffsetPosition, &stru_AC92F0.x, v11, v12);
a1->m_bHasChildren = 0;
memset(&a1->m_sQuad, 0, sizeof(a1->m_sQuad));
a1->m_sQuad.bl.colors.r = -1;
a1->m_sQuad.bl.colors.g = -1;
a1->m_sQuad.bl.colors.b = -1;
a1->m_sQuad.bl.colors.a = -1;
a1->m_sQuad.br.colors.r = -1;
a1->m_sQuad.br.colors.g = -1;
a1->m_sQuad.br.colors.b = -1;
a1->m_sQuad.br.colors.a = -1;
a1->m_sQuad.tl.colors.r = -1;
a1->m_sQuad.tl.colors.g = -1;
a1->m_sQuad.tl.colors.b = -1;
a1->m_sQuad.tl.colors.a = -1;
a1->m_sQuad.tr.colors.r = -1;
a1->m_sQuad.tr.colors.g = -1;
a1->m_sQuad.tr.colors.b = -1;
a1->m_sQuad.tr.colors.a = -1;
setShaderProgram = a1->setShaderProgram;
v14 = cocos2d::CCShaderCache::sharedShaderCache();
v15 = cocos2d::CCShaderCache::programForKey(v14, "ShaderPositionTextureColor");
setShaderProgram(a1, v15);
a1->setTexture(a1, a2);
a1->setTextureRect_0(a1, v7, v4, &v7->size);
a1->setBatchNode(a1, nullptr);
a1->m_bDontDraw = 0;
}
return v8;
}