//
// cocos2d::CCTexturePVR::createGLTexture from 0xdaa0b8 to 0xdaa294 (476 bytes)
//
// 2 xrefs:
// > cocos2d::CCTexturePVR::initWithContentsOfFile @ 0xdaa454
// > ??> @ 0xa8af0
//
// 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:34 +0000
//
__int64 __fastcall cocos2d::CCTexturePVR::createGLTexture(cocos2d::CCTexturePVR *this)
{
unsigned int v1; // w19
unsigned int v2; // w20
cocos2d *v4; // x0
int v5; // w27
char *v6; // x22
unsigned int v7; // w21
bool v8; // zf
int Error; // w0
bool v10; // zf
cocos2d::CCConfiguration *v11; // x0
cocos2d *v13; // x0
int v14; // w0
v1 = *((_DWORD *)this + 79);
v2 = *((_DWORD *)this + 80);
if ( !*((_DWORD *)this + 78) )
return 1;
v4 = (cocos2d *)*((unsigned int *)this + 81);
if ( (_DWORD)v4 )
cocos2d::ccGLDeleteTexture(v4);
glPixelStorei();
glGenTextures();
cocos2d::ccGLBindTexture2D((cocos2d *)*((unsigned int *)this + 81));
glTexParameteri();
glTexParameteri();
glTexParameteri();
glTexParameteri();
v5 = *(unsigned __int8 *)(*((_QWORD *)this + 42) + 16LL);
if ( !*((_DWORD *)this + 78) )
return 1;
v6 = (char *)this + 56;
v7 = 0;
while ( 1 )
{
if ( v5 )
{
v11 = (cocos2d::CCConfiguration *)cocos2d::CCConfiguration::sharedConfiguration((cocos2d::CCConfiguration *)((char *)&elf_hash_bucket[762] + 1));
if ( !(unsigned __int8)cocos2d::CCConfiguration::supportsPVRTC(v11) )
return 0;
glCompressedTexImage2D();
}
else
{
glTexImage2D();
}
v8 = v1 == v2;
v2 >>= 1;
if ( v7 )
{
if ( v8 )
break;
}
v1 >>= 1;
Error = glGetError();
++v7;
v6 += 16;
v10 = v1 == 0;
if ( Error )
return 0;
LABEL_10:
if ( v10 )
v1 = 1;
if ( !v2 )
v2 = 1;
if ( *((_DWORD *)this + 78) <= v7 )
return 1;
}
v13 = (cocos2d *)v1;
v1 >>= 1;
++v7;
v6 += 16;
cocos2d::ccNextPOT(v13);
v14 = glGetError();
v10 = v1 == 0;
if ( !v14 )
goto LABEL_10;
return 0;
}