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/textpreview.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/gui/widgets/textpreview.cpp') diff --git a/src/gui/widgets/textpreview.cpp b/src/gui/widgets/textpreview.cpp index 5cfb2abb5..5ef553b3c 100644 --- a/src/gui/widgets/textpreview.cpp +++ b/src/gui/widgets/textpreview.cpp @@ -84,18 +84,17 @@ void TextPreview::draw(Graphics* graphics) BLOCK_START("TextPreview::draw") if (client->getGuiAlpha() != mAlpha) mAlpha = client->getGuiAlpha(); - Graphics *const g = static_cast(graphics); const int intAlpha = static_cast(mAlpha * 255.0F); const int alpha = mTextAlpha ? intAlpha : 255; if (mOpaque) { - g->setColor(gcn::Color(static_cast(mBGColor->r), + graphics->setColor(gcn::Color(static_cast(mBGColor->r), static_cast(mBGColor->g), static_cast(mBGColor->b), static_cast(mAlpha * 255.0F))); - g->fillRectangle(gcn::Rectangle(0, 0, + graphics->fillRectangle(gcn::Rectangle(0, 0, mDimension.width, mDimension.height)); } @@ -108,20 +107,20 @@ void TextPreview::draw(Graphics* graphics) + 2 * ((mOutline || mShadow) ? 1 :0); const int y = font->getHeight() + 1 + 2 * ((mOutline || mShadow) ? 1 : 0); - g->setColor(gcn::Color(static_cast(mTextBGColor->r), + graphics->setColor(gcn::Color(static_cast(mTextBGColor->r), static_cast(mTextBGColor->g), static_cast(mTextBGColor->b), intAlpha)); - g->fillRectangle(gcn::Rectangle(mPadding, mPadding, x, y)); + graphics->fillRectangle(gcn::Rectangle(mPadding, mPadding, x, y)); } } - g->setColorAll(gcn::Color(mTextColor->r, mTextColor->g, mTextColor->b, - alpha), gcn::Color(mTextColor2->r, mTextColor2->g, mTextColor2->b, - alpha)); + graphics->setColorAll(gcn::Color(mTextColor->r, + mTextColor->g, mTextColor->b, alpha), + gcn::Color(mTextColor2->r, mTextColor2->g, mTextColor2->b, alpha)); if (mOutline && mTextColor != mTextColor2) - g->setColor2(Theme::getThemeColor(Theme::OUTLINE)); + graphics->setColor2(Theme::getThemeColor(Theme::OUTLINE)); mFont->drawString(graphics, mText, mPadding + 1, mPadding + 1); BLOCK_END("TextPreview::draw") -- cgit v1.2.3-60-g2f50