summaryrefslogtreecommitdiff
path: root/src/gui/fonts/font.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-05-03 22:44:42 +0300
committerAndrei Karas <akaras@inbox.ru>2015-05-03 22:44:42 +0300
commitb94678289a5e671fc168ec58525b7aae2a56e6ec (patch)
tree475822a9d1acae55f2602facbbb14dba4347fb67 /src/gui/fonts/font.cpp
parent602fd127d09c995bc5470218c862b2cebfc558d5 (diff)
downloadmv-b94678289a5e671fc168ec58525b7aae2a56e6ec.tar.gz
mv-b94678289a5e671fc168ec58525b7aae2a56e6ec.tar.bz2
mv-b94678289a5e671fc168ec58525b7aae2a56e6ec.tar.xz
mv-b94678289a5e671fc168ec58525b7aae2a56e6ec.zip
Remove useless dynamic_cast.
Diffstat (limited to 'src/gui/fonts/font.cpp')
-rw-r--r--src/gui/fonts/font.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/gui/fonts/font.cpp b/src/gui/fonts/font.cpp
index cac29d758..469d4e81c 100644
--- a/src/gui/fonts/font.cpp
+++ b/src/gui/fonts/font.cpp
@@ -213,12 +213,8 @@ void Font::drawString(Graphics *const graphics,
return;
}
- Graphics *const g = dynamic_cast<Graphics *const>(graphics);
- if (!g)
- return;
-
- Color col = g->getColor();
- const Color &col2 = g->getColor2();
+ Color col = graphics->getColor();
+ const Color &col2 = graphics->getColor2();
const float alpha = static_cast<float>(col.a) / 255.0F;
/* The alpha value is ignored at string generation so avoid caching the
@@ -240,7 +236,7 @@ void Font::drawString(Graphics *const graphics,
if (image)
{
image->setAlpha(alpha);
- g->drawImage(image, x, y);
+ graphics->drawImage(image, x, y);
}
}
else
@@ -262,7 +258,7 @@ void Font::drawString(Graphics *const graphics,
const Image *const image = chunk2->img;
if (image)
- g->drawImage(image, x, y);
+ graphics->drawImage(image, x, y);
}
BLOCK_END("Font::drawString")
}