//
// cocos2d::CCTextureCache::addPVRImage from 0x8011e0 to 0x801322 (322 bytes)
//
// 1 xrefs:
// > cocos2d::CCTextureCache::addImage @ 0x801ff2
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:01:20 +0000
//
cocos2d::CCTexture2D *__fastcall cocos2d::CCTextureCache::addPVRImage(cocos2d::CCTextureCache *this, const char *a2)
{
char *v2; // r9
size_t v5; // r0
int v6; // r10
size_t v7; // r0
cocos2d::CCTexture2D *v8; // r4
cocos2d::CCFileUtils *v9; // r0
int v10; // r1
char *v11; // r2
float v12; // r2
char *v13; // r1
int v14; // r3
cocos2d::CCTexture2D *v15; // r0
char *v17; // r1
int v18; // r10
size_t v19; // r0
int v20[2]; // [sp+0h] [bp+0h] BYREF
char *v21; // [sp+8h] [bp+8h]
char v22; // [sp+Ch] [bp+Ch] BYREF
_BYTE v23[7]; // [sp+Dh] [bp+Dh] BYREF
char *v24; // [sp+14h] [bp+14h]
int v25; // [sp+18h] [bp+18h] BYREF
int v26; // [sp+1Ch] [bp+1Ch]
int v27; // [sp+20h] [bp+20h]
v20[0] = 0;
v20[1] = 0;
v21 = nullptr;
v5 = strlen(a2);
std::string::__init(v20, a2, v5);
v25 = 0;
v26 = 0;
if ( (v20[0] & 1) == 0 )
v2 = (char *)v20 + 1;
v27 = 0;
if ( (v20[0] & 1) != 0 )
v2 = v21;
v6 = *((_DWORD *)this + 13);
v7 = strlen(v2);
std::string::__init(&v25, v2, v7);
v8 = (cocos2d::CCTexture2D *)cocos2d::CCDictionary::objectForKey(v6, (int)&v25);
v9 = (cocos2d::CCFileUtils *)std::string::~string((int)&v25);
if ( !v8 )
{
v10 = cocos2d::CCFileUtils::sharedFileUtils(v9);
if ( (v20[0] & 1) != 0 )
v11 = v21;
else
v11 = (char *)v20 + 1;
(*(void (__fastcall **)(char *, int, char *, _DWORD))(*(_DWORD *)v10 + 24))(&v22, v10, v11, 0);
v8 = (cocos2d::CCTexture2D *)operator new(0x60u);
cocos2d::CCTexture2D::CCTexture2D(v8);
if ( (v22 & 1) != 0 )
v13 = v24;
else
v13 = v23;
if ( cocos2d::CCTexture2D::initWithPVRFile(v8, v13, v12, COERCE_FLOAT(v22)) )
{
if ( (v22 & 1) != 0 )
v17 = v24;
else
v17 = v23;
cocos2d::VolatileTexture::addImageTexture(v8, (cocos2d::CCTexture2D *)v17, 4);
v18 = *((_DWORD *)this + 13);
if ( (v20[0] & 1) == 0 )
this = (cocos2d::CCTextureCache *)((char *)v20 + 1);
v25 = 0;
if ( (v20[0] & 1) != 0 )
this = (cocos2d::CCTextureCache *)v21;
v26 = 0;
v27 = 0;
v19 = strlen((const char *)this);
std::string::__init(&v25, this, v19);
cocos2d::CCDictionary::setObject(v18, v8, (int)&v25);
std::string::~string((int)&v25);
cocos2d::CCObject::autorelease(v8);
}
else
{
v14 = *(_DWORD *)v8;
v15 = v8;
v8 = nullptr;
(*(void (__fastcall **)(cocos2d::CCTexture2D *))(v14 + 8))(v15);
}
std::string::~string((int)&v22);
}
std::string::~string((int)v20);
return v8;
}