From a48521b503b916602a0067cc29a7e08e26b28c01 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Tue, 24 Aug 2010 20:19:30 +0000 Subject: [PATCH] - added fire particles to the visible check to improve performance --- .../shared_lib/sources/graphics/particle.cpp | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/source/shared_lib/sources/graphics/particle.cpp b/source/shared_lib/sources/graphics/particle.cpp index bbdf53935..518c51b06 100644 --- a/source/shared_lib/sources/graphics/particle.cpp +++ b/source/shared_lib/sources/graphics/particle.cpp @@ -926,17 +926,18 @@ void ParticleManager::update(int renderFps) { particleCount += (*it)->getAliveParticleCount(); //if(renderFps < 0 || renderFps >= MIN_FPS_NORMAL_RENDERING || // dynamic_cast((*it)) == NULL) { - bool showParticle = true; - if(dynamic_cast((*it)) != NULL) { - showParticle = (*it)->getVisible(); - } - if(showParticle == true) { - (*it)->update(); - if((*it)->isEmpty()) { - delete *it; - *it= NULL; - } + bool showParticle = true; + if( dynamic_cast((*it)) != NULL || + dynamic_cast((*it)) != NULL ) { + showParticle = (*it)->getVisible(); + } + if(showParticle == true) { + (*it)->update(); + if((*it)->isEmpty()) { + delete *it; + *it= NULL; } + } //} } particleSystems.remove(NULL);