summaryrefslogtreecommitdiff
path: root/src/gui/sdlfont.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-05-13 17:52:35 +0300
committerAndrei Karas <akaras@inbox.ru>2012-05-13 17:52:35 +0300
commit12e311bd5261078e02bffe63e125f89ae1a57209 (patch)
tree9a71f8e4ca78ea6f5eb09ccdb3bd6cd95830c884 /src/gui/sdlfont.cpp
parent258f968327f6e790e11e809070c5ea5dc21a299c (diff)
downloadmv-12e311bd5261078e02bffe63e125f89ae1a57209.tar.gz
mv-12e311bd5261078e02bffe63e125f89ae1a57209.tar.bz2
mv-12e311bd5261078e02bffe63e125f89ae1a57209.tar.xz
mv-12e311bd5261078e02bffe63e125f89ae1a57209.zip
Move some code from logic queue to separate calls.
It can improve perfomance in slow systems.
Diffstat (limited to 'src/gui/sdlfont.cpp')
-rw-r--r--src/gui/sdlfont.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/gui/sdlfont.cpp b/src/gui/sdlfont.cpp
index 63688fa29..cc76790d1 100644
--- a/src/gui/sdlfont.cpp
+++ b/src/gui/sdlfont.cpp
@@ -255,16 +255,6 @@ void SDLFont::drawString(gcn::Graphics *graphics,
if (data.img)
g->drawImage(data.img, x, y);
-
- if (!mCleanTime)
- {
- mCleanTime = cur_time + CLEAN_TIME;
- }
- else if (mCleanTime < cur_time)
- {
- doClean();
- mCleanTime = cur_time + CLEAN_TIME;
- }
}
else if (cache->front().img)
{
@@ -275,6 +265,19 @@ void SDLFont::drawString(gcn::Graphics *graphics,
}
+void SDLFont::slowLogic()
+{
+ if (!mCleanTime)
+ {
+ mCleanTime = cur_time + CLEAN_TIME;
+ }
+ else if (mCleanTime < cur_time)
+ {
+ doClean();
+ mCleanTime = cur_time + CLEAN_TIME;
+ }
+}
+
void SDLFont::createSDLTextChunk(SDLTextChunk *chunk)
{
if (!chunk || chunk->text.empty())