From 697e5bbf3171b0ba1fbbc0bbe61461c7726bf1ce Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 27 Dec 2012 15:58:18 +0300 Subject: Remove textrenderer class. --- src/textparticle.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'src/textparticle.cpp') diff --git a/src/textparticle.cpp b/src/textparticle.cpp index e3d3fc710..178a6a086 100644 --- a/src/textparticle.cpp +++ b/src/textparticle.cpp @@ -22,9 +22,12 @@ #include "textparticle.h" -#include "textrenderer.h" +#include "graphics.h" + +#include "gui/theme.h" #include +#include #include "debug.h" @@ -35,7 +38,8 @@ TextParticle::TextParticle(Map *const map, const std::string &text, mText(text), mTextFont(font), mColor(color), - mOutline(outline) + mOutline(outline), + mTextWidth(mTextFont->getWidth(mText) / 2) { } @@ -66,13 +70,16 @@ bool TextParticle::draw(Graphics *graphics, int offsetX, int offsetY) const / static_cast(mFadeIn); } - const gcn::Color color = *mColor; -// color.a = (int)alpha; - - TextRenderer::renderText(graphics, mText, - screenX, screenY, gcn::Graphics::CENTER, - color, mTextFont, mOutline, false, static_cast(alpha)); + gcn::Color color = *mColor; + color.a = (int)alpha; + graphics->setColor(color); + if (mOutline) + { + graphics->setColor2(Theme::getThemeColor( + Theme::OUTLINE, static_cast(alpha))); + } + mTextFont->drawString(graphics, mText, screenX - mTextWidth, screenY); BLOCK_END("TextParticle::draw") return true; } -- cgit v1.2.3-70-g09d2