From 604cbb82a3e126e49142a4357a49998649227753 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 8 Sep 2018 08:36:11 +0300 Subject: Draw at end of frame before fps limiter. --- src/progs/manaplus/client.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/progs/manaplus/client.cpp b/src/progs/manaplus/client.cpp index 376097a2e..3ae4c2f76 100644 --- a/src/progs/manaplus/client.cpp +++ b/src/progs/manaplus/client.cpp @@ -1017,21 +1017,6 @@ int Client::gameExec() // This is done because at some point tick_time will wrap. lastTickTime = tick_time; - // Update the screen when application is visible, delay otherwise. - if (!WindowManager::getIsMinimized()) - { - frame_count++; - if (gui != nullptr) - gui->draw(); - mainGraphics->updateScreen(); - } - else - { - SDL_Delay(100); - } - - PERF_STAT(9); - BLOCK_START("Client::gameExec 6") if (mState == State::CONNECT_GAME) { @@ -1056,7 +1041,7 @@ int Client::gameExec() } BLOCK_END("Client::gameExec 6") - PERF_STAT(10); + PERF_STAT(9); if (mState != mOldState) { @@ -1682,6 +1667,21 @@ int Client::gameExec() BLOCK_END("Client::gameExec 8") } + PERF_STAT(10); + + // Update the screen when application is visible, delay otherwise. + if (!WindowManager::getIsMinimized()) + { + frame_count++; + if (gui != nullptr) + gui->draw(); + mainGraphics->updateScreen(); + } + else + { + SDL_Delay(100); + } + PERF_STAT(11); BLOCK_START("~Client::SDL_framerateDelay") -- cgit v1.2.3-60-g2f50