From 761682b6254a3d43e65ff45e07683c61afa6f1e4 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 31 Mar 2012 16:54:22 +0300 Subject: Last part of fixes. --- src/gui/sdlfont.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/gui/sdlfont.cpp') diff --git a/src/gui/sdlfont.cpp b/src/gui/sdlfont.cpp index 7e0114cb8..197b0f9cd 100644 --- a/src/gui/sdlfont.cpp +++ b/src/gui/sdlfont.cpp @@ -249,7 +249,11 @@ void SDLFont::drawString(gcn::Graphics *graphics, mCreateCounter ++; #endif cache->push_front(chunk); - cache->front().generate(mFont, alpha); + SDLTextChunk &data = cache->front(); + data.generate(mFont, alpha); + + if (data.img) + g->drawImage(data.img, x, y); if (!mCleanTime) { @@ -260,16 +264,12 @@ void SDLFont::drawString(gcn::Graphics *graphics, doClean(); mCleanTime = cur_time + CLEAN_TIME; } - if (cache->front().img) - { -// cache->front().img->setAlpha(alpha); - g->drawImage(cache->front().img, x, y); - } } else if (cache->front().img) { - cache->front().img->setAlpha(alpha); - g->drawImage(cache->front().img, x, y); + Image *image = cache->front().img; + image->setAlpha(alpha); + g->drawImage(image, x, y); } } -- cgit v1.2.3-70-g09d2