From 3b15170d09f40f67043d908464f657610dcb4ecb Mon Sep 17 00:00:00 2001 From: Jacob Essex Date: Mon, 16 Jan 2012 18:16:33 +0000 Subject: [PATCH] Cleaned up and simplified the code relating to the fps display --- apps/openmw/engine.cpp | 15 ++++----------- apps/openmw/mwgui/window_manager.hpp | 3 +-- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp index b8a71d2e7..f4a1c407e 100644 --- a/apps/openmw/engine.cpp +++ b/apps/openmw/engine.cpp @@ -113,17 +113,10 @@ bool OMW::Engine::frameRenderingQueued (const Ogre::FrameEvent& evt) } // update GUI - if(mFpsLevel == 1) - { - mEnvironment.mWindowManager->wmSetFPS(mOgre->getFPS()); - } - else if(mFpsLevel == 2) //detailed - { - Ogre::RenderWindow* window = mOgre->getWindow(); - mEnvironment.mWindowManager->wmSetDetailedFPS(window->getLastFPS(), - window->getTriangleCount(), - window->getBatchCount()); - } + Ogre::RenderWindow* window = mOgre->getWindow(); + mEnvironment.mWindowManager->wmUpdateFps(window->getLastFPS(), + window->getTriangleCount(), + window->getBatchCount()); mEnvironment.mWindowManager->onFrame(mEnvironment.mFrameDuration); diff --git a/apps/openmw/mwgui/window_manager.hpp b/apps/openmw/mwgui/window_manager.hpp index 0178943eb..a46aa3533 100644 --- a/apps/openmw/mwgui/window_manager.hpp +++ b/apps/openmw/mwgui/window_manager.hpp @@ -205,8 +205,7 @@ namespace MWGui MyGUI::Gui* getGui() const { return gui; } - void wmSetFPS(float fps) { mFPS = fps; } - void wmSetDetailedFPS(float fps, size_t triangleCount, size_t batchCount) + void wmUpdateFps(float fps, size_t triangleCount, size_t batchCount) { mFPS = fps; mTriangleCount = triangleCount;