From ca9fac131283ed536971799bef0d1fff4ef8adc1 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 15 Feb 2014 22:21:02 +0300 Subject: Remove useless graphics casts. --- src/gui/widgets/spellshortcutcontainer.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/gui/widgets/spellshortcutcontainer.cpp') diff --git a/src/gui/widgets/spellshortcutcontainer.cpp b/src/gui/widgets/spellshortcutcontainer.cpp index 7c59676b9..696b0fbb4 100644 --- a/src/gui/widgets/spellshortcutcontainer.cpp +++ b/src/gui/widgets/spellshortcutcontainer.cpp @@ -103,12 +103,11 @@ void SpellShortcutContainer::draw(Graphics *graphics) mBackgroundImg->setAlpha(mAlpha); } - Graphics *const g = static_cast(graphics); gcn::Font *const font = getFont(); const int selectedId = spellShortcut->getSelectedItem(); - g->setColorAll(mForegroundColor, mForegroundColor2); - drawBackground(g); + graphics->setColorAll(mForegroundColor, mForegroundColor2); + drawBackground(graphics); for (unsigned i = 0; i < mMaxItems; i++) { @@ -118,7 +117,7 @@ void SpellShortcutContainer::draw(Graphics *graphics) const int itemId = getItemByIndex(i); if (selectedId >= 0 && itemId == selectedId) { - g->drawRectangle(gcn::Rectangle(itemX + 1, itemY + 1, + graphics->drawRectangle(gcn::Rectangle(itemX + 1, itemY + 1, mBoxWidth - 1, mBoxHeight - 1)); } @@ -135,11 +134,11 @@ void SpellShortcutContainer::draw(Graphics *graphics) if (image) { image->setAlpha(1.0F); - g->drawImage2(image, itemX, itemY); + graphics->drawImage2(image, itemX, itemY); } } - font->drawString(g, spell->getSymbol(), + font->drawString(graphics, spell->getSymbol(), itemX + 2, itemY + mBoxHeight / 2); } } -- cgit v1.2.3-70-g09d2