summaryrefslogtreecommitdiff
path: root/src/gui/windows/equipmentwindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-02-15 22:21:02 +0300
committerAndrei Karas <akaras@inbox.ru>2014-02-15 22:21:02 +0300
commitca9fac131283ed536971799bef0d1fff4ef8adc1 (patch)
treeec70584d20b117c5d2446ef42b898eeacdda9d12 /src/gui/windows/equipmentwindow.cpp
parent29f929794c7519b049de0be3af635f05d7e83be6 (diff)
downloadmv-ca9fac131283ed536971799bef0d1fff4ef8adc1.tar.gz
mv-ca9fac131283ed536971799bef0d1fff4ef8adc1.tar.bz2
mv-ca9fac131283ed536971799bef0d1fff4ef8adc1.tar.xz
mv-ca9fac131283ed536971799bef0d1fff4ef8adc1.zip
Remove useless graphics casts.
Diffstat (limited to 'src/gui/windows/equipmentwindow.cpp')
-rw-r--r--src/gui/windows/equipmentwindow.cpp30
1 files changed, 19 insertions, 11 deletions
diff --git a/src/gui/windows/equipmentwindow.cpp b/src/gui/windows/equipmentwindow.cpp
index e7bf02aa9..327cabe6a 100644
--- a/src/gui/windows/equipmentwindow.cpp
+++ b/src/gui/windows/equipmentwindow.cpp
@@ -161,7 +161,6 @@ void EquipmentWindow::draw(Graphics *graphics)
BLOCK_START("EquipmentWindow::draw")
// Draw window graphics
Window::draw(graphics);
- Graphics *const g = static_cast<Graphics*>(graphics);
int i = 0;
gcn::Font *const font = getFont();
@@ -179,17 +178,19 @@ void EquipmentWindow::draw(Graphics *graphics)
continue;
if (i == mSelected)
{
- g->calcTileCollection(mVertexes,
- mSlotHighlightedBackground, box->x, box->y);
+ graphics->calcTileCollection(mVertexes,
+ mSlotHighlightedBackground,
+ box->x, box->y);
}
else
{
- g->calcTileCollection(mVertexes, mSlotBackground,
+ graphics->calcTileCollection(mVertexes,
+ mSlotBackground,
box->x, box->y);
}
}
}
- g->drawTileCollection(mVertexes);
+ graphics->drawTileCollection(mVertexes);
}
else
{
@@ -200,9 +201,14 @@ void EquipmentWindow::draw(Graphics *graphics)
if (!box)
continue;
if (i == mSelected)
- g->drawImage2(mSlotHighlightedBackground, box->x, box->y);
+ {
+ graphics->drawImage2(mSlotHighlightedBackground,
+ box->x, box->y);
+ }
else
- g->drawImage2(mSlotBackground, box->x, box->y);
+ {
+ graphics->drawImage2(mSlotBackground, box->x, box->y);
+ }
}
}
@@ -228,13 +234,14 @@ void EquipmentWindow::draw(Graphics *graphics)
{
image->setAlpha(1.0F); // Ensure the image is drawn
// with maximum opacity
- g->drawImage2(image, box->x + mItemPadding,
+ graphics->drawImage2(image, box->x + mItemPadding,
box->y + mItemPadding);
if (i == EQUIP_PROJECTILE_SLOT)
{
- g->setColorAll(mLabelsColor, mLabelsColor2);
+ graphics->setColorAll(mLabelsColor, mLabelsColor2);
const std::string str = toString(item->getQuantity());
- font->drawString(g, str,
+ font->drawString(graphics,
+ str,
box->x + (mBoxSize - font->getWidth(str)) / 2,
box->y - fontHeight);
}
@@ -242,7 +249,8 @@ void EquipmentWindow::draw(Graphics *graphics)
}
else if (box->image)
{
- g->drawImage2(box->image, box->x + mItemPadding,
+ graphics->drawImage2(box->image,
+ box->x + mItemPadding,
box->y + mItemPadding);
}
}