summaryrefslogtreecommitdiff
path: root/src/text.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/text.cpp')
-rw-r--r--src/text.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/text.cpp b/src/text.cpp
index d0027b8ae..27d794d33 100644
--- a/src/text.cpp
+++ b/src/text.cpp
@@ -26,23 +26,21 @@
#include "configuration.h"
#include "textmanager.h"
+#include "gui/font.h"
#include "gui/gui.h"
-#include "gui/sdlfont.h"
#include "gui/theme.h"
#include "resources/image.h"
-#include <guichan/font.hpp>
-
#include "debug.h"
int Text::mInstances = 0;
ImageRect Text::mBubble;
Text::Text(const std::string &text, const int x, const int y,
- const gcn::Graphics::Alignment alignment,
- const gcn::Color *const color, const bool isSpeech,
- gcn::Font *const font) :
+ const Graphics::Alignment alignment,
+ const Color *const color, const bool isSpeech,
+ Font *const font) :
mFont(font ? font : (gui ? gui->getFont() : nullptr)),
mX(x),
mY(y),
@@ -78,13 +76,13 @@ Text::Text(const std::string &text, const int x, const int y,
switch (alignment)
{
- case gcn::Graphics::LEFT:
+ case Graphics::LEFT:
mXOffset = 0;
break;
- case gcn::Graphics::CENTER:
+ case Graphics::CENTER:
mXOffset = mWidth / 2;
break;
- case gcn::Graphics::RIGHT:
+ case Graphics::RIGHT:
mXOffset = mWidth;
break;
default:
@@ -114,7 +112,7 @@ Text::~Text()
}
}
-void Text::setColor(const gcn::Color *const color)
+void Text::setColor(const Color *const color)
{
mColor = color;
}
@@ -137,9 +135,11 @@ void Text::draw(Graphics *const graphics, const int xOff, const int yOff)
BLOCK_START("Text::draw")
if (mIsSpeech)
{
- static_cast<Graphics*>(graphics)->drawImageRect(
- mX - xOff - 5, mY - yOff - 5, mWidth + 10, mHeight + 10,
- mBubble);
+ graphics->drawImageRect(mX - xOff - 5,
+ mY - yOff - 5,
+ mWidth + 10,
+ mHeight + 10,
+ mBubble);
}
graphics->setColor(*mColor);
@@ -151,8 +151,8 @@ void Text::draw(Graphics *const graphics, const int xOff, const int yOff)
}
FlashText::FlashText(const std::string &text, const int x, const int y,
- const gcn::Graphics::Alignment alignment,
- const gcn::Color *const color, gcn::Font *const font) :
+ const Graphics::Alignment alignment,
+ const Color *const color, Font *const font) :
Text(text, x, y, alignment, color, false, font),
mTime(0)
{