From 5fb040c9f10cf2d3ec855efdb6d603dd05982534 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Thu, 26 Aug 2010 01:25:27 +0000 Subject: [PATCH] - Fixed bug related to particles not updating smoothly --- source/glest_game/graphics/renderer.cpp | 8 +++----- source/glest_game/world/world.cpp | 18 ++---------------- .../shared_lib/sources/graphics/particle.cpp | 4 ++-- 3 files changed, 7 insertions(+), 23 deletions(-) diff --git a/source/glest_game/graphics/renderer.cpp b/source/glest_game/graphics/renderer.cpp index 0da57d907..02685ebab 100644 --- a/source/glest_game/graphics/renderer.cpp +++ b/source/glest_game/graphics/renderer.cpp @@ -475,9 +475,7 @@ void Renderer::manageParticleSystem(ParticleSystem *particleSystem, ResourceScop } void Renderer::updateParticleManager(ResourceScope rs, int renderFps) { - //if(renderFps < 0 || renderFps >= MIN_FPS_NORMAL_RENDERING) { - particleManager[rs]->update(renderFps); - //} + particleManager[rs]->update(renderFps); } void Renderer::renderParticleManager(ResourceScope rs){ @@ -490,7 +488,7 @@ void Renderer::renderParticleManager(ResourceScope rs){ void Renderer::swapBuffers(){ //glFlush(); // should not be required - http://www.opengl.org/wiki/Common_Mistakes - //glFlush(); + glFlush(); GraphicsInterface::getInstance().getCurrentContext()->swapBuffers(); } @@ -1340,7 +1338,7 @@ void Renderer::renderSurface(const int renderFps, const int worldFrameCount) { glEnd(); } } - //glEnd(); + glEnd(); //Restore static_cast(modelRenderer)->setDuplicateTexCoords(false); diff --git a/source/glest_game/world/world.cpp b/source/glest_game/world/world.cpp index 3574e7709..28e5fc702 100644 --- a/source/glest_game/world/world.cpp +++ b/source/glest_game/world/world.cpp @@ -243,23 +243,10 @@ void World::loadScenario(const string &path, Checksum *checksum){ // ==================== misc ==================== void World::updateAllFactionUnits() { - int factionIdxToTick = -1; - //if(staggeredFactionUpdates == true) { - // factionIdxToTick = tickFactionIndex(); - // if(factionIdxToTick < 0) { - // return; - // } - //} - - SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] factionIdxToTick = %d\n",__FILE__,__FUNCTION__,__LINE__,factionIdxToTick); - //units for(int i=0; igetUnitCount(); ++j) { - unitUpdater.updateUnit(getFaction(i)->getUnit(j)); - } + for(int j=0; jgetUnitCount(); ++j) { + unitUpdater.updateUnit(getFaction(i)->getUnit(j)); } } } @@ -358,7 +345,6 @@ void World::update(){ //tick bool needToTick = canTickWorld(); if(needToTick == true) { - //if(frameCount % (GameConstants::updateFps / GameConstants::maxPlayers) == 0) { tick(); } if(chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s] Line: %d took msecs: %lld [world tick]\n",__FILE__,__FUNCTION__,__LINE__,chrono.getMillis()); diff --git a/source/shared_lib/sources/graphics/particle.cpp b/source/shared_lib/sources/graphics/particle.cpp index 434c57ad6..0f90057cc 100644 --- a/source/shared_lib/sources/graphics/particle.cpp +++ b/source/shared_lib/sources/graphics/particle.cpp @@ -37,8 +37,8 @@ ParticleSystem::ParticleSystem(int particleCount) { blendMode = bmOne; //particles= new Particle[particleCount]; particles.clear(); - particles.reserve(300); - particles.resize(1); + //particles.reserve(particleCount); + particles.resize(particleCount); state= sPlay; aliveParticleCount=0;