//
// cocos2d::CCSpriteBatchNode::initWithTexture from 0x180091880 to 0x1800919d3 (339 bytes)
//
// 8 xrefs:
// > cocos2d::CCLabelBMFont::initWithString @ 0x18004a1c5
// > cocos2d::CCSpriteBatchNode::create @ 0x180091508
// > cocos2d::CCSpriteBatchNode::createWithTexture @ 0x1800915a5
// > cocos2d::CCSpriteBatchNode::init @ 0x18009182b
// > cocos2d::CCSpriteBatchNode::initWithFile @ 0x180091873
// > cocos2d::CCTMXLayer::initWithTilesetInfo @ 0x1800af9d6
// > ??> @ 0x18014cf68
// > ??> @ 0x1801c02dc
//
// 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:22:08 +0000
//
// Hidden C++ exception states: #wind=3
char __fastcall cocos2d::CCSpriteBatchNode::initWithTexture(
cocos2d::CCSpriteBatchNode *this,
struct cocos2d::CCTexture2D *a2,
unsigned int a3)
{
cocos2d::CCTextureAtlas *v6; // rax
cocos2d::CCArray *v7; // rbx
cocos2d::CCTextureAtlas *v8; // rax
unsigned int v9; // esi
cocos2d::CCCamera *v10; // rax
char isDirty; // al
int v12; // ecx
cocos2d::CCArray *v13; // rax
cocos2d::CCArray *v14; // rax
cocos2d::CCArray *v15; // rax
__int64 v16; // rbx
cocos2d::CCShaderCache *v17; // rax
struct cocos2d::CCGLProgram *v18; // rax
*((_DWORD *)this + 84) = 1;
*((_DWORD *)this + 85) = 771;
v6 = (cocos2d::CCTextureAtlas *)sub_1800E4AC0(0x70u);
v7 = nullptr;
if ( v6 )
v8 = (cocos2d::CCTextureAtlas *)cocos2d::CCTextureAtlas::CCTextureAtlas(v6);
else
v8 = nullptr;
*((_QWORD *)this + 41) = v8;
v9 = 29;
if ( a3 )
v9 = a3;
cocos2d::CCTextureAtlas::initWithTexture(v8, a2, v9);
v10 = (cocos2d::CCCamera *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 41) + 88LL))(*((_QWORD *)this + 41));
isDirty = cocos2d::CCCamera::isDirty(v10);
v12 = 770;
if ( isDirty )
v12 = 1;
*((_DWORD *)this + 84) = v12;
*((_DWORD *)this + 85) = 771;
v13 = (cocos2d::CCArray *)sub_1800E4AC0(0x40u);
if ( v13 )
v14 = cocos2d::CCArray::CCArray(v13);
else
v14 = nullptr;
*((_QWORD *)this + 26) = v14;
cocos2d::CCArray::initWithCapacity(v14, v9);
v15 = (cocos2d::CCArray *)sub_1800E4AC0(0x40u);
if ( v15 )
v7 = cocos2d::CCArray::CCArray(v15);
*((_QWORD *)this + 43) = v7;
cocos2d::CCArray::initWithCapacity(v7, v9);
*((_WORD *)this + 176) = 0;
v16 = *(_QWORD *)this;
v17 = cocos2d::CCShaderCache::sharedShaderCache();
v18 = cocos2d::CCShaderCache::programForKey(v17, "ShaderPositionTextureColor");
(*(void (__fastcall **)(cocos2d::CCSpriteBatchNode *, struct cocos2d::CCGLProgram *))(v16 + 656))(this, v18);
return 1;
}