//
// cocos2d::CCAtlasNode::initWithTexture from 0x5bc74c to 0x5bc7ec (160 bytes)
//
// 2 xrefs:
// > cocos2d::CCAtlasNode::initWithTileFile @ 0x5bc820
// > cocos2d::CCLabelAtlas::initWithString @ 0x5cb1b8
//
// 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::CCAtlasNode::initWithTexture(
cocos2d::CCAtlasNode *a1,
cocos2d::CCTexture2D *a2,
unsigned int a3,
unsigned int a4,
unsigned int a5)
{
cocos2d::CCTextureAtlas *v7; // r7
cocos2d::CCTextureAtlas *m_pTextureAtlas; // r0
cocos2d::CCAtlasNode_vtbl *v9; // r3
void (__fastcall *setShaderProgram)(cocos2d::CCNode *__hidden, cocos2d::CCGLProgram *); // r6
cocos2d::CCShaderCache *v11; // r0
cocos2d::CCGLProgram *v12; // r0
a1->m_uItemHeight = a4;
a1->m_uItemWidth = a3;
a1->m_bIsOpacityModifyRGB = 1;
a1->m_tBlendFunc.src = 1;
*(_WORD *)&a1->m_tColorUnmodified.r = -1;
a1->m_tColorUnmodified.b = -1;
a1->m_tBlendFunc.dst = 771;
v7 = (cocos2d::CCTextureAtlas *)operator new(0x58u);
cocos2d::CCTextureAtlas::CCTextureAtlas(v7);
a1->m_pTextureAtlas = v7;
cocos2d::CCTextureAtlas::initWithTexture(v7, a2, a5);
m_pTextureAtlas = a1->m_pTextureAtlas;
if ( m_pTextureAtlas )
{
cocos2d::CCAtlasNode::updateBlendFunc(a1);
cocos2d::CCAtlasNode::updateOpacityModifyRGB(a1);
cocos2d::CCAtlasNode::calculateMaxItems(a1);
v9 = a1->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_uQuadsToDraw = a5;
setShaderProgram = v9->setShaderProgram;
v11 = cocos2d::CCShaderCache::sharedShaderCache();
v12 = cocos2d::CCShaderCache::programForKey(v11, "ShaderPositionTexture_uColor");
setShaderProgram(a1, v12);
a1->getShaderProgram(a1);
a1->m_nUniformColor = glGetUniformLocation();
LOBYTE(m_pTextureAtlas) = 1;
}
return (char)m_pTextureAtlas;
}