[Orxonox-commit 1457] r6175 - code/branches/presentation2/src/libraries/core
rgrieder at orxonox.net
rgrieder at orxonox.net
Sat Nov 28 23:28:51 CET 2009
Author: rgrieder
Date: 2009-11-28 23:28:51 +0100 (Sat, 28 Nov 2009)
New Revision: 6175
Modified:
code/branches/presentation2/src/libraries/core/Game.cc
Log:
And I thought I really though this one through...
The frame rate was shown one frame above the actual one, so it needs a minus one ;)
Modified: code/branches/presentation2/src/libraries/core/Game.cc
===================================================================
--- code/branches/presentation2/src/libraries/core/Game.cc 2009-11-28 17:06:57 UTC (rev 6174)
+++ code/branches/presentation2/src/libraries/core/Game.cc 2009-11-28 22:28:51 UTC (rev 6175)
@@ -306,8 +306,8 @@
}
uint32_t framesPerPeriod = this->statisticsTickTimes_.size();
- // Why plus 1? No idea, but otherwise the fps rate is always (from 10 to 200!) one frame too low
- this->avgFPS_ = 1 + static_cast<float>(framesPerPeriod) / (currentTime - this->statisticsTickTimes_.front().tickTime) * 1000000.0f;
+ // Why minus 1? No idea, but otherwise the fps rate is always (from 10 to 200!) one frame too low
+ this->avgFPS_ = -1 + static_cast<float>(framesPerPeriod) / (currentTime - this->statisticsTickTimes_.front().tickTime) * 1000000.0f;
this->avgTickTime_ = static_cast<float>(this->periodTickTime_) / framesPerPeriod / 1000.0f;
this->periodTime_ -= this->statisticsRefreshCycle_;
More information about the Orxonox-commit
mailing list