//
// cocos2d::CCTexturePVR::createGLTexture from 0x803318 to 0x803446 (302 bytes)
//
// 1 xrefs:
// > cocos2d::CCTexturePVR::initWithContentsOfFile @ 0x8035de
//
// 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:21 +0000
//
int __fastcall cocos2d::CCTexturePVR::createGLTexture(cocos2d::CCTexturePVR *this, unsigned int a2, GLuint a3)
{
cocos2d::CCTexturePVR *v3; // r4
unsigned int v4; // r5
unsigned int v5; // r6
cocos2d *v6; // r0
unsigned int v7; // r1
unsigned int v8; // r2
GLint v9; // r2
int v10; // r3
unsigned int v11; // r7
cocos2d::CCTexturePVR *v12; // r8
GLenum v13; // r10
int v14; // r9
cocos2d::CCConfiguration *v15; // r0
unsigned int v17; // r1
GLenum format; // [sp+18h] [bp-Ch]
GLenum type; // [sp+1Ch] [bp-8h]
v3 = this;
v4 = *((_DWORD *)this + 46);
v5 = *((_DWORD *)this + 47);
if ( *((_DWORD *)this + 45) )
{
v6 = *((cocos2d **)this + 48);
if ( v6 )
cocos2d::ccGLDeleteTexture(v6, a2, a3);
glPixelStorei(0xCF5u, 1);
glGenTextures(1, (GLuint *)v3 + 48);
cocos2d::ccGLBindTexture2D(*((cocos2d **)v3 + 48), v7, v8);
if ( *((_DWORD *)v3 + 45) == 1 )
v9 = 9729;
else
v9 = 9985;
glTexParameteri(0xDE1u, 0x2801u, v9);
glTexParameteri(0xDE1u, 0x2800u, 9729);
glTexParameteri(0xDE1u, 0x2802u, 33071);
glTexParameteri(0xDE1u, 0x2803u, 33071);
}
v10 = *((_DWORD *)v3 + 51);
v11 = 0;
v12 = v3;
v13 = *(_DWORD *)v10;
v14 = *(unsigned __int8 *)(v10 + 16);
format = *(_DWORD *)(v10 + 4);
type = *(_DWORD *)(v10 + 8);
while ( v11 < *((_DWORD *)v3 + 45) )
{
if ( v14 )
{
v15 = (cocos2d::CCConfiguration *)cocos2d::CCConfiguration::sharedConfiguration(this);
if ( !cocos2d::CCConfiguration::supportsPVRTC(v15) )
return 0;
}
if ( v14 )
glCompressedTexImage2D(0xDE1u, v11, v13, v4, v5, 0, *((_DWORD *)v12 + 14), *((const GLvoid **)v12 + 13));
else
glTexImage2D(0xDE1u, v11, v13, v4, v5, 0, format, type, *((const GLvoid **)v12 + 13));
if ( v11 && v4 == v5 )
cocos2d::ccNextPOT((cocos2d *)v4, v17);
this = (cocos2d::CCTexturePVR *)glGetError();
if ( this )
return 0;
v4 >>= 1;
++v11;
v12 = (cocos2d::CCTexturePVR *)((char *)v12 + 8);
if ( !v4 )
v4 = 1;
v5 >>= 1;
if ( !v5 )
v5 = 1;
}
return 1;
}