From b94678289a5e671fc168ec58525b7aae2a56e6ec Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 3 May 2015 22:44:42 +0300 Subject: Remove useless dynamic_cast. --- src/gui/fonts/font.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/gui/fonts') 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); - 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(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") } -- cgit v1.2.3-70-g09d2