summaryrefslogtreecommitdiff
path: root/src/gui/windows
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
parent29f929794c7519b049de0be3af635f05d7e83be6 (diff)
downloadmanaverse-ca9fac131283ed536971799bef0d1fff4ef8adc1.tar.gz
manaverse-ca9fac131283ed536971799bef0d1fff4ef8adc1.tar.bz2
manaverse-ca9fac131283ed536971799bef0d1fff4ef8adc1.tar.xz
manaverse-ca9fac131283ed536971799bef0d1fff4ef8adc1.zip
Remove useless graphics casts.
Diffstat (limited to 'src/gui/windows')
-rw-r--r--src/gui/windows/debugwindow.cpp3
-rw-r--r--src/gui/windows/equipmentwindow.cpp30
-rw-r--r--src/gui/windows/minimap.cpp8
-rw-r--r--src/gui/windows/outfitwindow.cpp5
-rw-r--r--src/gui/windows/serverdialog.cpp9
-rw-r--r--src/gui/windows/skilldialog.cpp4
6 files changed, 30 insertions, 29 deletions
diff --git a/src/gui/windows/debugwindow.cpp b/src/gui/windows/debugwindow.cpp
index 4f57b9798..7cc074086 100644
--- a/src/gui/windows/debugwindow.cpp
+++ b/src/gui/windows/debugwindow.cpp
@@ -139,8 +139,7 @@ void DebugWindow::draw(Graphics *g)
const Being *const target = player_node->getTarget();
if (target)
{
- Graphics *const g2 = static_cast<Graphics*>(g);
- target->draw(g2, -target->getPixelX() + mapTileSize / 2
+ target->draw(g, -target->getPixelX() + mapTileSize / 2
+ mDimension.width / 2, -target->getPixelY() + mapTileSize
+ mDimension.height / 2);
}
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);
}
}
diff --git a/src/gui/windows/minimap.cpp b/src/gui/windows/minimap.cpp
index 181055053..691506753 100644
--- a/src/gui/windows/minimap.cpp
+++ b/src/gui/windows/minimap.cpp
@@ -244,8 +244,6 @@ void Minimap::draw(Graphics *graphics)
return;
}
- Graphics *const graph = static_cast<Graphics*>(graphics);
-
const gcn::Rectangle a = getChildrenArea();
graphics->pushClipArea(a);
@@ -286,7 +284,7 @@ void Minimap::draw(Graphics *graphics)
mMapOriginY = 0;
}
- graph->drawImage2(mMapImage, mMapOriginX, mMapOriginY);
+ graphics->drawImage2(mMapImage, mMapOriginX, mMapOriginY);
}
const ActorSprites &actors = actorManager->getAll();
@@ -401,8 +399,8 @@ void Minimap::draw(Graphics *graphics)
const Vector &pos = player_node->getPosition();
- const int gw = graph->getWidth();
- const int gh = graph->getHeight();
+ const int gw = graphics->getWidth();
+ const int gh = graphics->getHeight();
int x = static_cast<float>((pos.x - (gw / 2)
+ viewport->getCameraRelativeX())
* mWidthProportion) / 32 + mMapOriginX;
diff --git a/src/gui/windows/outfitwindow.cpp b/src/gui/windows/outfitwindow.cpp
index 677337b70..3729841bc 100644
--- a/src/gui/windows/outfitwindow.cpp
+++ b/src/gui/windows/outfitwindow.cpp
@@ -314,7 +314,6 @@ void OutfitWindow::draw(Graphics *graphics)
{
BLOCK_START("OutfitWindow::draw")
Window::draw(graphics);
- Graphics *const g = static_cast<Graphics*>(graphics);
if (mCurrentOutfit < 0 || mCurrentOutfit
>= static_cast<signed int>(OUTFITS_COUNT))
@@ -348,7 +347,7 @@ void OutfitWindow::draw(Graphics *graphics)
const Image *const image = item->getImage();
if (image)
{
- g->drawImage2(image, itemX, itemY);
+ graphics->drawImage2(image, itemX, itemY);
foundItem = true;
}
}
@@ -359,7 +358,7 @@ void OutfitWindow::draw(Graphics *graphics)
mItemColors[mCurrentOutfit][i]);
if (image)
{
- g->drawImage2(image, itemX, itemY);
+ graphics->drawImage2(image, itemX, itemY);
image->decRef();
}
}
diff --git a/src/gui/windows/serverdialog.cpp b/src/gui/windows/serverdialog.cpp
index 82a264ac7..b7e21556c 100644
--- a/src/gui/windows/serverdialog.cpp
+++ b/src/gui/windows/serverdialog.cpp
@@ -164,12 +164,11 @@ public:
ServersListModel *const model = static_cast<ServersListModel *const>(
mListModel);
- Graphics *const g = static_cast<Graphics*>(graphics);
updateAlpha();
mHighlightColor.a = static_cast<int>(mAlpha * 255.0F);
- g->setColor(mHighlightColor);
+ graphics->setColor(mHighlightColor);
const int height = getRowHeight();
mNotSupportedColor.a = static_cast<int>(mAlpha * 255.0F);
@@ -196,12 +195,12 @@ public:
if (mSelected == i)
{
- g->setColorAll(mForegroundSelectedColor,
+ graphics->setColorAll(mForegroundSelectedColor,
mForegroundSelectedColor2);
}
else
{
- g->setColorAll(mForegroundColor, mForegroundColor2);
+ graphics->setColorAll(mForegroundColor, mForegroundColor2);
}
int top;
@@ -224,7 +223,7 @@ public:
if (info.version.first > 0)
{
- g->setColorAll(mNotSupportedColor, mNotSupportedColor2);
+ graphics->setColorAll(mNotSupportedColor, mNotSupportedColor2);
font2->drawString(graphics, info.version.second,
width - info.version.first - mPadding, top);
}
diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp
index 674848725..7e823b742 100644
--- a/src/gui/windows/skilldialog.cpp
+++ b/src/gui/windows/skilldialog.cpp
@@ -100,15 +100,13 @@ class SkillListBox final : public ListBox
return static_cast<SkillModel*>(mListModel)->getSkillAt(selected);
}
- void draw(Graphics *gcnGraphics) override
+ void draw(Graphics *graphics) override
{
if (!mListModel)
return;
SkillModel *const model = static_cast<SkillModel*>(mListModel);
updateAlpha();
- Graphics *const graphics = static_cast<Graphics *const>(
- gcnGraphics);
mHighlightColor.a = static_cast<int>(mAlpha * 255.0F);
graphics->setColor(mHighlightColor);