summaryrefslogtreecommitdiff
path: root/src/gui/gui.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-01-14 00:56:03 +0300
committerAndrei Karas <akaras@inbox.ru>2014-01-14 00:56:20 +0300
commit8e4f4e04ca61594e3dec31bad70eaf6cdf86ad8f (patch)
treeb246d23998da0af196460f42af22b7c89b845b2c /src/gui/gui.cpp
parentc28aa31fe3d701530280ac92c92e8dff36e65f03 (diff)
downloadmanaverse-8e4f4e04ca61594e3dec31bad70eaf6cdf86ad8f.tar.gz
manaverse-8e4f4e04ca61594e3dec31bad70eaf6cdf86ad8f.tar.bz2
manaverse-8e4f4e04ca61594e3dec31bad70eaf6cdf86ad8f.tar.xz
manaverse-8e4f4e04ca61594e3dec31bad70eaf6cdf86ad8f.zip
add support for thread safe writing to log.
Diffstat (limited to 'src/gui/gui.cpp')
-rw-r--r--src/gui/gui.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index f84750e17..8dbaec952 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -49,6 +49,7 @@
#include "resources/resourcemanager.h"
#include "utils/langs.h"
+#include "utils/timer.h"
#include <guichan/exception.hpp>
@@ -107,6 +108,7 @@ Gui::Gui() :
mFocusListeners(),
mForegroundColor(Theme::getThemeColor(Theme::TEXT)),
mForegroundColor2(Theme::getThemeColor(Theme::TEXT_OUTLINE)),
+ mTime(0),
mCustomCursor(false),
mDoubleClick(true)
{
@@ -366,6 +368,14 @@ void Gui::slowLogic()
mNpcFont->slowLogic(5);
if (windowContainer)
windowContainer->slowLogic();
+
+ const int time = cur_time;
+ if (mTime != time)
+ {
+ logger->flush();
+ mTime = time;
+ }
+
BLOCK_END("Gui::slowLogic")
}