- Fixed bug related to particles not updating smoothly

This commit is contained in:
Mark Vejvoda
2010-08-26 01:25:27 +00:00
parent 5a796444b8
commit 5fb040c9f1
3 changed files with 7 additions and 23 deletions

View File

@@ -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);
//}
}
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<ModelRendererGl*>(modelRenderer)->setDuplicateTexCoords(false);

View File

@@ -243,26 +243,13 @@ 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; i<getFactionCount(); ++i) {
if(factionIdxToTick == -1 || factionIdxToTick == i) {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] factionIdxToTick = %d, i = %d\n",__FILE__,__FUNCTION__,__LINE__,factionIdxToTick,i);
for(int j=0; j<getFaction(i)->getUnitCount(); ++j) {
unitUpdater.updateUnit(getFaction(i)->getUnit(j));
}
}
}
}
void World::underTakeDeadFactionUnits() {
int factionIdxToTick = -1;
@@ -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());

View File

@@ -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;