- attempt to improve unit particle performance by ONLY updating unit particles progress if the particle is busy

This commit is contained in:
Mark Vejvoda 2010-08-24 19:24:37 +00:00
parent 0e3c0a8d0e
commit 3828d23670

View File

@ -926,11 +926,17 @@ void ParticleManager::update(int renderFps) {
particleCount += (*it)->getAliveParticleCount(); particleCount += (*it)->getAliveParticleCount();
//if(renderFps < 0 || renderFps >= MIN_FPS_NORMAL_RENDERING || //if(renderFps < 0 || renderFps >= MIN_FPS_NORMAL_RENDERING ||
// dynamic_cast<UnitParticleSystem *>((*it)) == NULL) { // dynamic_cast<UnitParticleSystem *>((*it)) == NULL) {
bool showParticle = true;
if(dynamic_cast<UnitParticleSystem *>((*it)) != NULL) {
showParticle = (*it)->getVisible();
}
if(showParticle == true) {
(*it)->update(); (*it)->update();
if((*it)->isEmpty()) { if((*it)->isEmpty()) {
delete *it; delete *it;
*it= NULL; *it= NULL;
} }
}
//} //}
} }
particleSystems.remove(NULL); particleSystems.remove(NULL);