//
// cocos2d::CCAtlasNode::initWithTexture from 0x180001bc0 to 0x180001d1a (346 bytes)
//
// 6 xrefs:
// > cocos2d::CCAtlasNode::create @ 0x1800019db
// > cocos2d::CCAtlasNode::initWithTileFile @ 0x180001d73
// > cocos2d::CCLabelAtlas::initWithString @ 0x180047e10
// > cocos2d::CCLabelAtlas::initWithString @ 0x180047e8a
// > ??> @ 0x18014cf68
// > ??> @ 0x1801b70f0
//
// This function is hookable on this platform (idp: pc, 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:21:15 +0000
//
// Hidden C++ exception states: #wind=1
char __fastcall cocos2d::CCAtlasNode::initWithTexture(
cocos2d::CCAtlasNode *this,
struct cocos2d::CCTexture2D *a2,
int a3,
int a4,
unsigned int a5)
{
cocos2d::CCTextureAtlas *v7; // rax
__int64 v8; // rcx
cocos2d::CCCamera *v10; // rax
cocos2d::CCCamera *v11; // rax
__int64 v12; // rbx
cocos2d::CCShaderCache *v13; // rax
struct cocos2d::CCGLProgram *v14; // rax
__int64 v15; // rax
*((_DWORD *)this + 90) = a3;
*((_DWORD *)this + 91) = a4;
*((_WORD *)this + 184) = -1;
*((_BYTE *)this + 370) = -1;
*((_BYTE *)this + 384) = 1;
*((_DWORD *)this + 97) = 1;
*((_DWORD *)this + 98) = 771;
v7 = (cocos2d::CCTextureAtlas *)sub_1800E4AC0(0x70u);
if ( v7 )
v7 = (cocos2d::CCTextureAtlas *)cocos2d::CCTextureAtlas::CCTextureAtlas(v7);
*((_QWORD *)this + 47) = v7;
cocos2d::CCTextureAtlas::initWithTexture(v7, a2, a5);
v8 = *((_QWORD *)this + 47);
if ( !v8 )
return 0;
v10 = (cocos2d::CCCamera *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v8 + 88LL))(v8);
if ( !cocos2d::CCCamera::isDirty(v10) )
{
*((_DWORD *)this + 97) = 770;
*((_DWORD *)this + 98) = 771;
}
v11 = (cocos2d::CCCamera *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 47) + 88LL))(*((_QWORD *)this + 47));
*((_BYTE *)this + 384) = cocos2d::CCCamera::isDirty(v11);
cocos2d::CCAtlasNode::calculateMaxItems(this);
*((_DWORD *)this + 99) = a5;
v12 = *(_QWORD *)this;
v13 = cocos2d::CCShaderCache::sharedShaderCache();
v14 = cocos2d::CCShaderCache::programForKey(v13, "ShaderPositionTexture_uColor");
(*(void (__fastcall **)(cocos2d::CCAtlasNode *, struct cocos2d::CCGLProgram *))(v12 + 656))(this, v14);
v15 = (*(__int64 (__fastcall **)(cocos2d::CCAtlasNode *))(*(_QWORD *)this + 648LL))(this);
*((_DWORD *)this + 100) = _glewGetUniformLocation(*(unsigned int *)(v15 + 56), "u_color");
return 1;
}