MCPcopy Create free account
hub / github.com/axmolengine/axmol / setBatchNode

Method setBatchNode

core/2d/ParticleSystemQuad.cpp:835–863  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

833}
834
835void ParticleSystemQuad::setBatchNode(ParticleBatchNode* batchNode)
836{
837 if (_batchNode != batchNode)
838 {
839 ParticleBatchNode* oldBatch = _batchNode;
840
841 ParticleSystem::setBatchNode(batchNode);
842
843 // NEW: is self render ?
844 if (!batchNode)
845 {
846 allocMemory();
847 initIndices();
848 setTexture(oldBatch->getTexture());
849 // setupVBO();
850 }
851 // OLD: was it self render ? cleanup
852 else if (!oldBatch)
853 {
854 // copy current state to batch
855 V3F_C4B_T2F_Quad* batchQuads = _batchNode->getTextureAtlas()->getQuads();
856 V3F_C4B_T2F_Quad* quad = &(batchQuads[_atlasIndex]);
857 memcpy(quad, _quads, _totalParticles * sizeof(_quads[0]));
858
859 AX_SAFE_FREE(_quads);
860 AX_SAFE_FREE(_indices);
861 }
862 }
863}
864
865ParticleSystemQuad* ParticleSystemQuad::create()
866{

Callers

nothing calls this directly

Calls 4

setBatchNodeFunction · 0.85
getQuadsMethod · 0.80
getTextureAtlasMethod · 0.80
getTextureMethod · 0.45

Tested by

no test coverage detected