| 833 | } |
| 834 | |
| 835 | void 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 | |
| 865 | ParticleSystemQuad* ParticleSystemQuad::create() |
| 866 | { |
nothing calls this directly
no test coverage detected