Small logic changes to the FPS reporting, only update if FPS>1. Still disabled,

but at least nobody would say there is a bug like min FPS being 999.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@3330 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
mbjornstk 2009-03-31 18:04:04 +00:00
parent d2ecdcafff
commit 4eadddd8ab

View File

@ -222,19 +222,23 @@ void MainLoop::run()
#if 0
int fps = irr_driver->getDevice()->getVideoDriver()->getFPS();
bool printFPS = false;
if((fps < minFPS) && (fps > 1)) { // First report seems to be always 1, so not useful
minFPS = fps;
printFPS = true;
}
if(fps > maxFPS) {
maxFPS = fps;
printFPS = true;
}
if ((lastFPS+5 <= fps) || (lastFPS-5 >= fps)) {
lastFPS = fps;
printFPS = true;
}
// First print per run will be really silly, as in 999 1 1, just ignore it ;]
// First reports seem to be always 1, so not useful
if (fps > 1) {
// More than +-5 range is interesting to report (otherwise noise)
if ((lastFPS+5 <= fps) || (lastFPS-5 >= fps)) {
lastFPS = fps;
printFPS = true;
}
// Min and max are worth updating any time they happen
if (fps < minFPS) {
minFPS = fps;
printFPS = true;
}
if (fps > maxFPS) {
maxFPS = fps;
printFPS = true;
}
} // no else, or you get over 50 'printf ("FPS below 1!\n")' easily
if (printFPS) printf("FPS %3d<%3d<%3d\n", minFPS, fps, maxFPS);
#endif
#else