summaryrefslogtreecommitdiff
path: root/src/text.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-05-27 21:29:06 +0300
committerAndrei Karas <akaras@inbox.ru>2015-05-27 21:29:06 +0300
commit420664f4025b261674e0cdea503d43fb95beae38 (patch)
treea7f75459b34593f355384abe9e68c20239d1c51a /src/text.cpp
parentb2f868c841bf466714796bc9ce155f411ae8df06 (diff)
downloadplus-420664f4025b261674e0cdea503d43fb95beae38.tar.gz
plus-420664f4025b261674e0cdea503d43fb95beae38.tar.bz2
plus-420664f4025b261674e0cdea503d43fb95beae38.tar.xz
plus-420664f4025b261674e0cdea503d43fb95beae38.zip
Add strong typed bool type Speech.
Diffstat (limited to 'src/text.cpp')
-rw-r--r--src/text.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/text.cpp b/src/text.cpp
index 0331b5263..bec055f60 100644
--- a/src/text.cpp
+++ b/src/text.cpp
@@ -41,9 +41,11 @@
int Text::mInstances = 0;
ImageRect Text::mBubble;
-Text::Text(const std::string &text, const int x, const int y,
+Text::Text(const std::string &text,
+ const int x, const int y,
const Graphics::Alignment alignment,
- const Color *const color, const bool isSpeech,
+ const Color *const color,
+ const Speech isSpeech,
Font *const font) :
mFont(font ? font : (gui ? gui->getFont() : nullptr)),
mTextChunk(),
@@ -54,7 +56,8 @@ Text::Text(const std::string &text, const int x, const int y,
mXOffset(0),
mText(text),
mColor(color),
- mOutlineColor(isSpeech ? *color : theme->getColor(Theme::OUTLINE, 255)),
+ mOutlineColor(isSpeech == Speech_true ?
+ *color : theme->getColor(Theme::OUTLINE, 255)),
mIsSpeech(isSpeech),
mTextChanged(true)
{
@@ -120,7 +123,7 @@ Text::~Text()
void Text::setColor(const Color *const color)
{
mTextChanged = true;
- if (mIsSpeech)
+ if (mIsSpeech == Speech_true)
{
mColor = color;
mOutlineColor = *color;
@@ -147,7 +150,7 @@ void Text::adviseXY(const int x, const int y, const bool move)
void Text::draw(Graphics *const graphics, const int xOff, const int yOff)
{
BLOCK_START("Text::draw")
- if (mIsSpeech)
+ if (mIsSpeech == Speech_true)
{
graphics->drawImageRect(mX - xOff - 5,
mY - yOff - 5,
@@ -179,7 +182,7 @@ FlashText::FlashText(const std::string &text,
const Graphics::Alignment alignment,
const Color *const color,
Font *const font) :
- Text(text, x, y, alignment, color, false, font),
+ Text(text, x, y, alignment, color, Speech_false, font),
mTime(0)
{
}