summaryrefslogtreecommitdiff
path: root/src/text.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-03-25 22:50:59 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-03-25 22:50:59 +0100
commitcc79f0fe21e1a2ef73cbe987d54e848b9a47142d (patch)
treeedd316eb6094f0c02d6d014385865dcd88a2bc56 /src/text.cpp
parentb0df784f1be44a657ca8092069488602270629b7 (diff)
parent99e8a3fd77b63a029fe02dcf771b6af1aad252ed (diff)
downloadmana-client-cc79f0fe21e1a2ef73cbe987d54e848b9a47142d.tar.gz
mana-client-cc79f0fe21e1a2ef73cbe987d54e848b9a47142d.tar.bz2
mana-client-cc79f0fe21e1a2ef73cbe987d54e848b9a47142d.tar.xz
mana-client-cc79f0fe21e1a2ef73cbe987d54e848b9a47142d.zip
Merge branch 'eathena/master'
Conflicts: A lot of files.
Diffstat (limited to 'src/text.cpp')
-rw-r--r--src/text.cpp42
1 files changed, 7 insertions, 35 deletions
diff --git a/src/text.cpp b/src/text.cpp
index cb4587d3..83bd6c24 100644
--- a/src/text.cpp
+++ b/src/text.cpp
@@ -30,6 +30,8 @@
#include "resources/image.h"
#include "gui/gui.h"
+#include "gui/palette.h"
+#include "gui/textrenderer.h"
int Text::mInstances = 0;
ImageRect Text::mBubble;
@@ -37,7 +39,7 @@ Image *Text::mBubbleArrow;
Text::Text(const std::string &text, int x, int y,
gcn::Graphics::Alignment alignment,
- gcn::Color color, bool isSpeech) :
+ const gcn::Color* color, bool isSpeech) :
mText(text),
mColor(color),
mIsSpeech(isSpeech)
@@ -129,42 +131,14 @@ void Text::draw(gcn::Graphics *graphics, int xOff, int yOff)
*/
}
- // Text shadow
- graphics->setColor(gcn::Color(0, 0, 0));
- graphics->drawText(mText, mX - xOff + 1, mY - yOff + 1,
- gcn::Graphics::LEFT);
-
- if (!mIsSpeech) {
- graphics->setColor(gcn::Color(0, 0, 0, 64));
- /*
- // TODO: Reanable when we can draw it nicely in software mode
- graphics->drawText(mText, mX - xOff + 2, mY - yOff + 2,
- gcn::Graphics::LEFT);
- graphics->drawText(mText, mX - xOff + 1, mY - yOff + 2,
- gcn::Graphics::LEFT);
- graphics->drawText(mText, mX - xOff + 2, mY - yOff + 1,
- gcn::Graphics::LEFT);
- */
-
- // Text outline
- graphics->setColor(gcn::Color(0, 0, 0));
- graphics->drawText(mText, mX - xOff + 1, mY - yOff,
- gcn::Graphics::LEFT);
- graphics->drawText(mText, mX - xOff - 1, mY - yOff,
- gcn::Graphics::LEFT);
- graphics->drawText(mText, mX - xOff, mY - yOff + 1,
- gcn::Graphics::LEFT);
- graphics->drawText(mText, mX - xOff, mY - yOff - 1,
- gcn::Graphics::LEFT);
- }
-
- graphics->setColor(mColor);
- graphics->drawText(mText, mX - xOff, mY - yOff, gcn::Graphics::LEFT);
+ TextRenderer::renderText(graphics, mText,
+ mX - xOff, mY - yOff, gcn::Graphics::LEFT,
+ *mColor, boldFont, !mIsSpeech, true);
}
FlashText::FlashText(const std::string &text, int x, int y,
gcn::Graphics::Alignment alignment,
- gcn::Color color) :
+ const gcn::Color *color) :
Text(text, x, y, alignment, color),
mTime(0)
{
@@ -175,9 +149,7 @@ void FlashText::draw(gcn::Graphics *graphics, int xOff, int yOff)
if (mTime)
{
if ((--mTime & 4) == 0)
- {
return;
- }
}
Text::draw(graphics, xOff, yOff);
}