//
// cocos2d::CCParticleBatchNode::insertChild from 0x5dd56c to 0x5dd644 (216 bytes)
//
// 1 xrefs:
// > cocos2d::CCParticleBatchNode::addChild @ 0x5dd6ea
//
// 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::CCParticleBatchNode::insertChild(
cocos2d::CCParticleBatchNode *a1,
cocos2d::CCParticleSystem *a2,
unsigned int a3)
{
cocos2d::CCTextureAtlas *m_pTextureAtlas; // r0
int v7; // r7
unsigned int v8; // r7
unsigned int v9; // r7
unsigned int v10; // r0
cocos2d::CCTextureAtlas *v11; // r8
int v12; // r7
unsigned int v13; // r7
unsigned int v14; // r0
unsigned int m_uAtlasIndex; // r7
unsigned int v16; // r7
cocos2d::CCTextureAtlas *v17; // r7
unsigned int v18; // r0
cocos2d::CCTextureAtlas *v19; // r6
unsigned int v20; // r0
m_pTextureAtlas = a1->m_pTextureAtlas;
a2->m_uAtlasIndex = a3;
v7 = m_pTextureAtlas->getTotalQuads(m_pTextureAtlas);
v8 = v7 + a2->getTotalParticles(a2);
if ( v8 > a1->m_pTextureAtlas->getCapacity(a1->m_pTextureAtlas) )
{
v9 = a1->m_pTextureAtlas->getTotalQuads(a1->m_pTextureAtlas);
v10 = a2->getTotalParticles(a2);
cocos2d::CCParticleBatchNode::increaseAtlasCapacityTo(a1, v10 + v9);
v11 = a1->m_pTextureAtlas;
v12 = v11->getCapacity(v11);
v13 = v12 - a2->getTotalParticles(a2);
v14 = a2->getTotalParticles(a2);
cocos2d::CCTextureAtlas::fillWithEmptyQuadsFromIndex(v11, v13, v14);
}
m_uAtlasIndex = a2->m_uAtlasIndex;
v16 = m_uAtlasIndex + a2->getTotalParticles(a2);
if ( v16 != a1->m_pTextureAtlas->getTotalQuads(a1->m_pTextureAtlas) )
{
v17 = a1->m_pTextureAtlas;
v18 = a2->getTotalParticles(a2);
cocos2d::CCTextureAtlas::moveQuadsFromIndex(v17, a3, v18 + a3);
}
v19 = a1->m_pTextureAtlas;
v20 = a2->getTotalParticles(a2);
cocos2d::CCTextureAtlas::increaseTotalQuadsWith(v19, v20);
cocos2d::CCParticleBatchNode::updateAllAtlasIndexes(a1);
}