//
// cocos2d::CCTextureAtlas::initWithTexture from 0xda4528 to 0xda4664 (316 bytes)
//
// 6 xrefs:
// > cocos2d::CCAtlasNode::initWithTexture @ 0xd3c294
// > cocos2d::CCParticleBatchNode::initWithTexture @ 0xd725e0
// > cocos2d::CCSpriteBatchNode::initWithTexture @ 0xd89708
// > cocos2d::CCTextureAtlas::createWithTexture @ 0xda4698
// > cocos2d::CCTextureAtlas::initWithFile @ 0xda471c
// > ??> @ 0x8caa0
//
// 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:31 +0000
//
__int64 __fastcall cocos2d::CCTextureAtlas::initWithTexture(
cocos2d::CCTextureAtlas *this,
cocos2d::CCTexture2D *a2,
unsigned int a3)
{
unsigned int v4; // w21
void *v5; // x0
void *v6; // x22
void *v7; // x0
void *v8; // x23
cocos2d::CCNotificationCenter *v9; // x0
cocos2d::CCArray **v10; // x0
_DWORD *v12; // x0
*((_DWORD *)this + 19) = 0;
*((_DWORD *)this + 20) = a3;
*((_DWORD *)this + 26) = 0;
*((_QWORD *)this + 11) = a2;
if ( a2 )
{
cocos2d::CCObject::retain((__int64)a2);
v4 = *((_DWORD *)this + 20);
}
else
{
v4 = a3;
}
v5 = malloc(96LL * v4);
*((_QWORD *)this + 12) = v5;
v6 = v5;
v7 = malloc(12LL * v4);
*((_QWORD *)this + 7) = v7;
v8 = v7;
if ( v6 && v7 || !v4 )
{
memset(v6, 0, 96LL * v4);
v9 = (cocos2d::CCNotificationCenter *)memset(v8, 0, 12LL * v4);
v10 = (cocos2d::CCArray **)cocos2d::CCNotificationCenter::sharedNotificationCenter(v9);
cocos2d::CCNotificationCenter::addObserver(
v10,
this,
(__int64)cocos2d::CCTextureAtlas::listenBackToForeground,
0,
"event_come_to_foreground",
0);
cocos2d::CCTextureAtlas::setupIndices((__int64)this);
cocos2d::CCTextureAtlas::setupVBO(this);
*((_BYTE *)this + 72) = 1;
return 1;
}
else
{
if ( v6 )
{
free(v6);
*((_QWORD *)this + 12) = 0;
}
if ( v8 )
{
free(v8);
*((_QWORD *)this + 7) = 0;
}
v12 = *((_DWORD **)this + 11);
if ( v12 )
{
cocos2d::CCObject::release(v12);
*((_QWORD *)this + 11) = 0;
}
return 0;
}
}