From 32c15a8266a5d08e990c4dbee15b58c4b916ae3f Mon Sep 17 00:00:00 2001 From: AlexVinS Date: Mon, 22 Jun 2015 23:57:34 +0300 Subject: [PATCH] Extract fps counter drawing --- client/CPlayerInterface.cpp | 3 --- client/CPreGame.cpp | 3 --- client/gui/CGuiHandler.cpp | 3 +++ 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/client/CPlayerInterface.cpp b/client/CPlayerInterface.cpp index 721b1e0c8..809b3aae7 100644 --- a/client/CPlayerInterface.cpp +++ b/client/CPlayerInterface.cpp @@ -1617,9 +1617,6 @@ void CPlayerInterface::update() GH.totalRedraw(); else GH.simpleRedraw(); - - if (settings["general"]["showfps"].Bool()) - GH.drawFPSCounter(); } int CPlayerInterface::getLastIndex( std::string namePrefix) diff --git a/client/CPreGame.cpp b/client/CPreGame.cpp index 5e18e9e06..da6f4ba28 100644 --- a/client/CPreGame.cpp +++ b/client/CPreGame.cpp @@ -537,9 +537,6 @@ void CGPreGame::update() // /FIXME: find out why GH.listInt is empty to begin with if (GH.topInt() != nullptr) GH.topInt()->show(screen); - - if (settings["general"]["showfps"].Bool()) - GH.drawFPSCounter(); } void CGPreGame::openCampaignScreen(std::string name) diff --git a/client/gui/CGuiHandler.cpp b/client/gui/CGuiHandler.cpp index b191c6323..b6f94a108 100644 --- a/client/gui/CGuiHandler.cpp +++ b/client/gui/CGuiHandler.cpp @@ -414,6 +414,9 @@ void CGuiHandler::renderFrame() if(nullptr != curInt) curInt->update(); + + if (settings["general"]["showfps"].Bool()) + drawFPSCounter(); // draw the mouse cursor and update the screen CCS->curh->render();