//
// cocos2d::CCTexture2D::initWithImage from 0x1001ab200 to 0x1001ab270 (112 bytes)
//
// 4 xrefs:
// > cocos2d::CCTextureCache::addImageAsyncCallBack @ 0x10013c71c
// > cocos2d::CCTextureCache::addImage @ 0x10013cc18
// > cocos2d::CCTextureCache::addUIImage @ 0x10013d2ec
// > cocos2d::CCTexture2D::initWithString @ 0x1001ab6e0
//
// 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 11:00:05 +0000
//
__int64 __fastcall cocos2d::CCTexture2D::initWithImage(__int64 a1, __int64 a2)
{
__int64 v4; // x21
__int64 v5; // x22
__int64 v6; // x0
unsigned int MaxTextureSize; // w0
if ( !a2 )
return 0;
v4 = *(unsigned __int16 *)(a2 + 56);
v5 = *(unsigned __int16 *)(a2 + 58);
v6 = cocos2d::CCConfiguration::sharedConfiguration();
MaxTextureSize = cocos2d::CCConfiguration::getMaxTextureSize(v6);
if ( MaxTextureSize < (unsigned int)v4 || MaxTextureSize < (unsigned int)v5 )
return 0;
cocos2d::CCTexture2D::initPremultipliedATextureWithImage(a1, a2, v4, v5);
return 1;
}