Better var names and make obvious that until counter expires FPS will not show.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@4555 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
mbjornstk 2010-01-29 02:03:45 +00:00
parent f1353892c1
commit 17949c6ffe

View File

@ -704,19 +704,19 @@ void IrrDriver::renderBulletDebugView()
*/
void IrrDriver::displayFPS()
{
gui::IGUIFont* font = GUIEngine::getFont();
const int fps = m_device->getVideoDriver()->getFPS();
// We will let pass some time to let things settle before trusting FPS counter
// even if we also ignore fps = 1 which tends to happen in first checks
#define NOTRUST 20
static int notrust = NOTRUST;
// even if we also ignore fps = 1, which tends to happen in first checks
#define NO_TRUST_COUNT 25
static int no_trust = NO_TRUST_COUNT;
if(notrust) {
notrust--;
if(no_trust) {
no_trust--;
return;
}
gui::IGUIFont* font = GUIEngine::getFont();
const int fps = m_device->getVideoDriver()->getFPS();
// Min and max info tracking, per mode, so user can check game vs menus
bool current_state = StateManager::get()->getGameState() == GUIEngine::GAME;
static bool prev_state = false;
@ -728,7 +728,7 @@ void IrrDriver::displayFPS()
{
min = 999;
max = 0;
notrust = NOTRUST;
no_trust = NO_TRUST_COUNT;
prev_state = current_state;
}