From 007cc9f4ac59fc580e4b9d1f16b67a8eae85c613 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 12 Jan 2007 21:44:28 +0000 Subject: [PATCH] From Tom Jolley, "There was some unnecessary creation and deletion of Particle objects in include/osgParticle/ParticleSystem. I replaced Particle(ptemplate? *ptemplate: _def_ptemp) with ptemplate? *ptemplate: _def_ptemp in a couple of places. This should make particle creation and reuse go a little faster without all that memory allocation and copying." --- include/osgParticle/ParticleSystem | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/osgParticle/ParticleSystem b/include/osgParticle/ParticleSystem index dd49ea5a3..529c1825d 100644 --- a/include/osgParticle/ParticleSystem +++ b/include/osgParticle/ParticleSystem @@ -372,7 +372,7 @@ namespace osgParticle Particle* P = _deadparts.top(); // create a new (alive) particle in the same place - *P = Particle(ptemplate? *ptemplate: _def_ptemp); + *P = ptemplate? *ptemplate: _def_ptemp; // remove the pointer from the death stack _deadparts.pop(); @@ -381,7 +381,7 @@ namespace osgParticle } else { // add a new particle to the vector - _particles.push_back(Particle(ptemplate? *ptemplate: _def_ptemp)); + _particles.push_back(ptemplate? *ptemplate: _def_ptemp); return &_particles.back(); } }