//
// cocos2d::CCTextureCache::addUIImage from 0xda85a8 to 0xda87a8 (512 bytes)
//
// 4 xrefs:
// > sub_D6B8F8 @ 0xd6b9a0
// > cocos2d::CCParticleSystem::initWithDictionary @ 0xd72050
// > cocos2d::CCSprite::setTexture @ 0xd86ab8
// > ??> @ 0xef458
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 13:08:33 +0000
//
cocos2d::CCTexture2D *__fastcall cocos2d::CCTextureCache::addUIImage(
cocos2d::CCTextureCache *this,
cocos2d::CCImage *a2,
const char *a3)
{
__int64 v5; // x0
__int64 v6; // x21
const char *v7; // x1
size_t v8; // x0
cocos2d::CCImage *v9; // x2
cocos2d::CCTexture2D *v10; // x21
__int64 v12; // x24
const char *v13; // x1
size_t v14; // x0
char *v16; // [xsp+48h] [xbp+48h]
char *v17; // [xsp+48h] [xbp+48h]
__int64 v18; // [xsp+58h] [xbp+58h] BYREF
__int64 v19; // [xsp+60h] [xbp+60h]
void *v20; // [xsp+68h] [xbp+68h]
__int64 v21; // [xsp+70h] [xbp+70h] BYREF
__int64 v22; // [xsp+78h] [xbp+78h]
void *v23; // [xsp+80h] [xbp+80h]
v18 = 0;
v19 = 0;
v20 = nullptr;
if ( a3 )
{
v5 = cocos2d::CCFileUtils::sharedFileUtils(_stack_chk_guard);
(*(void (__fastcall **)(__int64 *__return_ptr, __int64, const char *, _QWORD))(*(_QWORD *)v5 + 48LL))(
&v21,
v5,
a3,
0);
LOWORD(v18) = 0;
std::string::reserve(&v18, 0);
v6 = *((_QWORD *)this + 7);
v19 = v22;
if ( (v21 & 1) != 0 )
v7 = (const char *)v23;
else
v7 = (char *)&v18 + 1;
v18 = v21;
v16 = (char *)v7;
v20 = v23;
v21 = 0;
v22 = 0;
v23 = nullptr;
v8 = strlen(v7);
std::string::__init(&v21, v16, v8);
v10 = (cocos2d::CCTexture2D *)cocos2d::CCDictionary::objectForKey(v6, (__int64)&v21);
if ( (v21 & 1) != 0 )
operator delete(v23);
if ( !v10 )
{
v10 = (cocos2d::CCTexture2D *)operator new(0x68u);
cocos2d::CCTexture2D::CCTexture2D(v10);
cocos2d::CCTexture2D::initWithImage(v10, a2);
v12 = *((_QWORD *)this + 7);
v13 = (char *)&v18 + 1;
if ( (v18 & 1) != 0 )
v13 = (const char *)v20;
v17 = (char *)v13;
v21 = 0;
v22 = 0;
v23 = nullptr;
v14 = strlen(v13);
std::string::__init(&v21, v17, v14);
cocos2d::CCDictionary::setObject(v12, v10, (__int64)&v21);
if ( (v21 & 1) != 0 )
operator delete(v23);
cocos2d::CCObject::autorelease(v10);
}
}
else
{
v10 = (cocos2d::CCTexture2D *)operator new(0x68u);
cocos2d::CCTexture2D::CCTexture2D(v10);
cocos2d::CCTexture2D::initWithImage(v10, a2);
}
cocos2d::VolatileTexture::addCCImage(v10, a2, v9);
if ( (v18 & 1) != 0 )
operator delete(v20);
return v10;
}