From 950dbd86885db87907d4f3050821c23c883cdfcf Mon Sep 17 00:00:00 2001 From: auria Date: Fri, 18 Mar 2011 15:47:41 +0000 Subject: [PATCH] Display the FPS stirng even when waiting for data, sometimes I'd wonder whether FPS display was activated or not... git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@7987 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/graphics/irr_driver.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/graphics/irr_driver.cpp b/src/graphics/irr_driver.cpp index 221df67a9..107c79615 100644 --- a/src/graphics/irr_driver.cpp +++ b/src/graphics/irr_driver.cpp @@ -877,6 +877,8 @@ void IrrDriver::setAmbientLight(const video::SColor &light) */ void IrrDriver::displayFPS() { + gui::IGUIFont* font = GUIEngine::getFont(); + // 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 const int NO_TRUST_COUNT = 200; @@ -885,11 +887,14 @@ void IrrDriver::displayFPS() if (no_trust) { no_trust--; + + static video::SColor fpsColor = video::SColor(255, 255, 0, 0); + font->draw( L"FPS: ...", core::rect< s32 >(100,0,400,50), fpsColor, false ); + return; } // Ask for current frames per second and last number of triangles processed (trimed to thousands) - gui::IGUIFont* font = GUIEngine::getFont(); const int fps = m_device->getVideoDriver()->getFPS(); const int kilotris = (int)(m_device->getVideoDriver()->getPrimitiveCountDrawn(0) * (1.f / 1000.f) );