//
// cocos2d::CCTexturePVR::createGLTexture from 0xb379c8 to 0xb37ba4 (476 bytes)
//
// 2 xrefs:
// > cocos2d::CCTexturePVR::initWithContentsOfFile @ 0xb37d4c
// > ??> @ 0x7e8d0
//
// 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
//
bool cocos2d::CCTexturePVR::createGLTexture(cocos2d::CCTexturePVR *a1)
{
unsigned int m_uUnknown; // w19
unsigned int m_unknown2; // w20
unsigned int m_nZOrder; // w0
int v5; // w27
cocos2d::CCTexturePVR *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
m_uUnknown = a1[5].m_uUnknown;
m_unknown2 = a1[5].m_unknown2;
if ( !a1[5].m_uIndexInArray )
return 1;
m_nZOrder = a1[5].m_nZOrder;
if ( m_nZOrder )
cocos2d::ccGLDeleteTexture(m_nZOrder);
glPixelStorei();
glGenTextures();
cocos2d::ccGLBindTexture2D(a1[5].m_nZOrder);
glTexParameteri();
glTexParameteri();
glTexParameteri();
glTexParameteri();
v5 = LOBYTE(a1[6].~CCTexturePVR_0);
if ( !a1[5].m_uIndexInArray )
return 1;
v6 = a1 + 1;
v7 = 0;
while ( 1 )
{
if ( v5 )
{
v11 = cocos2d::CCConfiguration::sharedConfiguration();
if ( !cocos2d::CCConfiguration::supportsPVRTC(v11) )
return 0;
glCompressedTexImage2D();
}
else
{
glTexImage2D();
}
v8 = m_uUnknown == m_unknown2;
m_unknown2 >>= 1;
if ( v7 )
{
if ( v8 )
break;
}
m_uUnknown >>= 1;
Error = glGetError();
++v7;
v6 = (cocos2d::CCTexturePVR *)((char *)v6 + 16);
v10 = m_uUnknown == 0;
if ( Error )
return 0;
LABEL_10:
if ( v10 )
m_uUnknown = 1;
if ( !m_unknown2 )
m_unknown2 = 1;
if ( a1[5].m_uIndexInArray <= v7 )
return 1;
}
v13 = (cocos2d *)m_uUnknown;
m_uUnknown >>= 1;
++v7;
v6 = (cocos2d::CCTexturePVR *)((char *)v6 + 16);
cocos2d::ccNextPOT(v13);
v14 = glGetError();
v10 = m_uUnknown == 0;
if ( !v14 )
goto LABEL_10;
return 0;
}