mirror of
https://github.com/glest/glest-source.git
synced 2025-08-20 23:21:19 +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) {
|
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){
|
void Renderer::renderParticleManager(ResourceScope rs){
|
||||||
@@ -490,7 +488,7 @@ void Renderer::renderParticleManager(ResourceScope rs){
|
|||||||
void Renderer::swapBuffers(){
|
void Renderer::swapBuffers(){
|
||||||
|
|
||||||
//glFlush(); // should not be required - http://www.opengl.org/wiki/Common_Mistakes
|
//glFlush(); // should not be required - http://www.opengl.org/wiki/Common_Mistakes
|
||||||
//glFlush();
|
glFlush();
|
||||||
|
|
||||||
GraphicsInterface::getInstance().getCurrentContext()->swapBuffers();
|
GraphicsInterface::getInstance().getCurrentContext()->swapBuffers();
|
||||||
}
|
}
|
||||||
@@ -1340,7 +1338,7 @@ void Renderer::renderSurface(const int renderFps, const int worldFrameCount) {
|
|||||||
glEnd();
|
glEnd();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//glEnd();
|
glEnd();
|
||||||
|
|
||||||
//Restore
|
//Restore
|
||||||
static_cast<ModelRendererGl*>(modelRenderer)->setDuplicateTexCoords(false);
|
static_cast<ModelRendererGl*>(modelRenderer)->setDuplicateTexCoords(false);
|
||||||
|
@@ -243,23 +243,10 @@ void World::loadScenario(const string &path, Checksum *checksum){
|
|||||||
// ==================== misc ====================
|
// ==================== misc ====================
|
||||||
|
|
||||||
void World::updateAllFactionUnits() {
|
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
|
//units
|
||||||
for(int i=0; i<getFactionCount(); ++i) {
|
for(int i=0; i<getFactionCount(); ++i) {
|
||||||
if(factionIdxToTick == -1 || factionIdxToTick == i) {
|
for(int j=0; j<getFaction(i)->getUnitCount(); ++j) {
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] factionIdxToTick = %d, i = %d\n",__FILE__,__FUNCTION__,__LINE__,factionIdxToTick,i);
|
unitUpdater.updateUnit(getFaction(i)->getUnit(j));
|
||||||
for(int j=0; j<getFaction(i)->getUnitCount(); ++j) {
|
|
||||||
unitUpdater.updateUnit(getFaction(i)->getUnit(j));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -358,7 +345,6 @@ void World::update(){
|
|||||||
//tick
|
//tick
|
||||||
bool needToTick = canTickWorld();
|
bool needToTick = canTickWorld();
|
||||||
if(needToTick == true) {
|
if(needToTick == true) {
|
||||||
//if(frameCount % (GameConstants::updateFps / GameConstants::maxPlayers) == 0) {
|
|
||||||
tick();
|
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());
|
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;
|
blendMode = bmOne;
|
||||||
//particles= new Particle[particleCount];
|
//particles= new Particle[particleCount];
|
||||||
particles.clear();
|
particles.clear();
|
||||||
particles.reserve(300);
|
//particles.reserve(particleCount);
|
||||||
particles.resize(1);
|
particles.resize(particleCount);
|
||||||
|
|
||||||
state= sPlay;
|
state= sPlay;
|
||||||
aliveParticleCount=0;
|
aliveParticleCount=0;
|
||||||
|
Reference in New Issue
Block a user