//
// cocos2d::CCParticleSystemQuad::setBatchNode from 0xb03b24 to 0xb03c1c (248 bytes)
//
// 13 xrefs:
// > ??> @ 0x62fe8
// > ??> @ 0x1212138
// > ??> @ 0x12127e8
// > ??> @ 0x1212e98
// > ??> @ 0x1213548
// > ??> @ 0x1213bf8
// > ??> @ 0x12142a8
// > ??> @ 0x1214958
// > ??> @ 0x1215008
// > ??> @ 0x12156b8
// > ??> @ 0x1215d68
// > ??> @ 0x1216418
// > ??> @ 0x12175d8
//
// 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
//
void cocos2d::CCParticleSystemQuad::setBatchNode(cocos2d::CCParticleSystemQuad *a1, cocos2d::CCParticleBatchNode *a2)
{
cocos2d::CCParticleBatchNode *m_pBatchNode; // x20
cocos2d::ccV3F_C4B_T2F_Quad *v5; // x0
cocos2d::ccV3F_C4B_T2F_Quad *m_pQuads; // x0
GLushort *m_pIndices; // x0
void (__fastcall *setTexture)(cocos2d::CCParticleSystemQuad *__hidden, cocos2d::CCTexture2D *); // x19
__int64 v9; // x0
m_pBatchNode = a1->m_pBatchNode;
if ( m_pBatchNode != a2 )
{
cocos2d::CCParticleSystem::setBatchNode(a1, a2);
if ( a2 )
{
if ( !m_pBatchNode )
{
v5 = a1->m_pBatchNode->m_pTextureAtlas->getQuads(a1->m_pBatchNode->m_pTextureAtlas);
memcpy(&v5[a1->m_uAtlasIndex], a1->m_pQuads, 96LL * a1->m_uTotalParticles);
m_pQuads = a1->m_pQuads;
if ( m_pQuads )
{
free(m_pQuads);
a1->m_pQuads = nullptr;
}
m_pIndices = a1->m_pIndices;
if ( m_pIndices )
{
free(m_pIndices);
a1->m_pIndices = nullptr;
}
glDeleteBuffers();
*(_QWORD *)a1->m_pBuffersVBO = 0;
}
}
else
{
cocos2d::CCParticleSystemQuad::allocMemory(a1);
cocos2d::CCParticleSystemQuad::initIndices(a1);
setTexture = a1->setTexture;
v9 = (__int64)m_pBatchNode->getTexture(m_pBatchNode);
setTexture(a1, (cocos2d::CCTexture2D *)v9);
cocos2d::CCParticleSystemQuad::setupVBO(a1);
}
}
}