//
// cocos2d::CCSprite::setTexture from 0x5e6800 to 0x5e68b0 (176 bytes)
//
// 1 xrefs:
// > `non-virtual thunk to'cocos2d::CCSprite::setTexture @ 0x5e68bc
//
// 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 cocos2d::CCSprite::setTexture(cocos2d::CCSprite *a1, cocos2d::CCTexture2D *a2)
{
cocos2d::CCTexture2D *v3; // r4
cocos2d::CCTexture2D *v4; // r0
cocos2d::CCTextureCache *v5; // r0
cocos2d::CCImage *v6; // r6
cocos2d::CCTextureCache *v7; // r0
cocos2d::CCTexture2D *m_pobTexture; // r0
cocos2d::CCSprite_vtbl *v9; // r3
v3 = a2;
if ( a1->m_pobBatchNode )
{
a2->getName(a2);
v4 = a1->m_pobBatchNode->getTexture(a1->m_pobBatchNode);
v4->getName(v4);
}
else if ( !a2 )
{
v5 = cocos2d::CCTextureCache::sharedTextureCache();
v3 = cocos2d::CCTextureCache::textureForKey(v5, "cc_2x2_white_image");
if ( !v3 )
{
v6 = (cocos2d::CCImage *)operator new(0x48u);
cocos2d::CCImage::CCImage(v6);
cocos2d::CCImage::initWithImageData(v6, &unk_ABACE8, 16, kFmtRawData, 2, 2, 8, 0);
v7 = cocos2d::CCTextureCache::sharedTextureCache();
v3 = cocos2d::CCTextureCache::addUIImage(v7, v6, "cc_2x2_white_image");
cocos2d::CCObject::release(v6);
}
}
if ( !a1->m_pobBatchNode && a1->m_pobTexture != v3 )
{
if ( v3 )
cocos2d::CCObject::retain(v3);
m_pobTexture = a1->m_pobTexture;
if ( m_pobTexture )
cocos2d::CCObject::release(m_pobTexture);
v9 = a1->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_pobTexture = v3;
v9->updateBlendFunc(a1);
}
}