From 8a488aeb866b19a1f5f8d5088234dcc717cb5e1d Mon Sep 17 00:00:00 2001 From: AlexVinS Date: Thu, 3 Jul 2014 19:57:21 +0400 Subject: [PATCH] Cleanup --- client/CMT.cpp | 7 ------- client/CPlayerInterface.cpp | 2 -- client/gui/CGuiHandler.cpp | 27 ++++++++++++--------------- client/gui/CGuiHandler.h | 1 - 4 files changed, 12 insertions(+), 25 deletions(-) diff --git a/client/CMT.cpp b/client/CMT.cpp index caeaad2af..11beac7bb 100644 --- a/client/CMT.cpp +++ b/client/CMT.cpp @@ -1227,13 +1227,6 @@ void handleQuit() if(client) endGame(); -// if(mainGUIThread) -// { -// GH.terminate = true; -// if(mainGUIThread->get_id() != boost::this_thread::get_id()) mainGUIThread->join(); -// delete mainGUIThread; -// mainGUIThread = nullptr; -// } delete console; console = nullptr; boost::this_thread::sleep(boost::posix_time::milliseconds(750)); diff --git a/client/CPlayerInterface.cpp b/client/CPlayerInterface.cpp index e9106e284..03dbd64e8 100644 --- a/client/CPlayerInterface.cpp +++ b/client/CPlayerInterface.cpp @@ -1528,8 +1528,6 @@ bool CPlayerInterface::ctrlPressed() const void CPlayerInterface::update() { -// if(duringMovement) -// return; // Updating GUI requires locking pim mutex (that protects screen and GUI state). // When ending the game, the pim mutex might be hold by other thread, // that will notify us about the ending game by setting terminate_cond flag. diff --git a/client/gui/CGuiHandler.cpp b/client/gui/CGuiHandler.cpp index e624c0605..c929f03dc 100644 --- a/client/gui/CGuiHandler.cpp +++ b/client/gui/CGuiHandler.cpp @@ -409,23 +409,21 @@ void CGuiHandler::fakeMouseMove() void CGuiHandler::renderFrame() { - if(!terminate) - { - if(curInt) - curInt->update(); // calls a update and drawing process of the loaded game interface object at the moment + if(curInt) + curInt->update(); // calls a update and drawing process of the loaded game interface object at the moment - // draw the mouse cursor and update the screen - CCS->curh->render(); + // draw the mouse cursor and update the screen + CCS->curh->render(); -#ifndef VCMI_SDL1 - if(0 != SDL_RenderCopy(mainRenderer, screenTexture, nullptr, nullptr)) - logGlobal->errorStream() << __FUNCTION__ << " SDL_RenderCopy " << SDL_GetError(); + #ifndef VCMI_SDL1 + if(0 != SDL_RenderCopy(mainRenderer, screenTexture, nullptr, nullptr)) + logGlobal->errorStream() << __FUNCTION__ << " SDL_RenderCopy " << SDL_GetError(); - SDL_RenderPresent(mainRenderer); -#endif - - mainFPSmng->framerateDelay(); // holds a constant FPS - } + SDL_RenderPresent(mainRenderer); + #endif + + mainFPSmng->framerateDelay(); // holds a constant FPS + } @@ -434,7 +432,6 @@ CGuiHandler::CGuiHandler() { curInt = nullptr; current = nullptr; - terminate = false; statusbar = nullptr; // Creates the FPS manager and sets the framerate to 48 which is doubled the value of the original Heroes 3 FPS rate diff --git a/client/gui/CGuiHandler.h b/client/gui/CGuiHandler.h index 8697f9d1a..c81213207 100644 --- a/client/gui/CGuiHandler.h +++ b/client/gui/CGuiHandler.h @@ -76,7 +76,6 @@ public: Point lastClick; unsigned lastClickTime; - bool terminate; CGuiHandler(); ~CGuiHandler();