From 3828d23670138e94811654fb26cc948f023f4066 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Tue, 24 Aug 2010 19:24:37 +0000 Subject: [PATCH] - attempt to improve unit particle performance by ONLY updating unit particles progress if the particle is busy --- source/shared_lib/sources/graphics/particle.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/source/shared_lib/sources/graphics/particle.cpp b/source/shared_lib/sources/graphics/particle.cpp index e00d5cf0..bbdf5393 100644 --- a/source/shared_lib/sources/graphics/particle.cpp +++ b/source/shared_lib/sources/graphics/particle.cpp @@ -926,10 +926,16 @@ void ParticleManager::update(int renderFps) { particleCount += (*it)->getAliveParticleCount(); //if(renderFps < 0 || renderFps >= MIN_FPS_NORMAL_RENDERING || // dynamic_cast((*it)) == NULL) { - (*it)->update(); - if((*it)->isEmpty()) { - delete *it; - *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; + } } //} }