diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-05-13 17:52:35 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-05-13 17:52:35 +0300 |
commit | 12e311bd5261078e02bffe63e125f89ae1a57209 (patch) | |
tree | 9a71f8e4ca78ea6f5eb09ccdb3bd6cd95830c884 /src/gui/sdlfont.cpp | |
parent | 258f968327f6e790e11e809070c5ea5dc21a299c (diff) | |
download | plus-12e311bd5261078e02bffe63e125f89ae1a57209.tar.gz plus-12e311bd5261078e02bffe63e125f89ae1a57209.tar.bz2 plus-12e311bd5261078e02bffe63e125f89ae1a57209.tar.xz plus-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.cpp | 23 |
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()) |