mirror of
https://github.com/glest/glest-source.git
synced 2025-08-20 15:11:20 +02:00
- Fixed bug related to particles not updating smoothly
This commit is contained in:
@@ -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);
|
||||
|
@@ -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());
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user