summaryrefslogtreecommitdiff
path: root/src/gui/equipmentwindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-12-27 00:14:17 +0300
committerAndrei Karas <akaras@inbox.ru>2012-12-27 23:15:05 +0300
commite56ea6cbf7726b258a4eb6b51a0574cddd862558 (patch)
tree5b5fe42389d3c67a6b30f222b92bac5e303a0b32 /src/gui/equipmentwindow.cpp
parent0c34224ca4f6cbc21c24e2e6018ded03c6906c44 (diff)
downloadmanaplus-e56ea6cbf7726b258a4eb6b51a0574cddd862558.tar.gz
manaplus-e56ea6cbf7726b258a4eb6b51a0574cddd862558.tar.bz2
manaplus-e56ea6cbf7726b258a4eb6b51a0574cddd862558.tar.xz
manaplus-e56ea6cbf7726b258a4eb6b51a0574cddd862558.zip
Improve a bit equipment window draw speed.
Diffstat (limited to 'src/gui/equipmentwindow.cpp')
-rw-r--r--src/gui/equipmentwindow.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gui/equipmentwindow.cpp b/src/gui/equipmentwindow.cpp
index 54eaaf58d..cb0577783 100644
--- a/src/gui/equipmentwindow.cpp
+++ b/src/gui/equipmentwindow.cpp
@@ -151,7 +151,8 @@ void EquipmentWindow::draw(gcn::Graphics *graphics)
Graphics *const g = static_cast<Graphics*>(graphics);
int i = 0;
- const int fontHeight = getFont()->getHeight();
+ gcn::Font *const font = getFont();
+ const int fontHeight = font->getHeight();
if (openGLMode != 2)
{
@@ -220,9 +221,10 @@ void EquipmentWindow::draw(gcn::Graphics *graphics)
if (i == EQUIP_PROJECTILE_SLOT)
{
g->setColor(mLabelsColor);
- graphics->drawText(toString(item->getQuantity()),
- box->x + (mBoxSize / 2), box->y - fontHeight,
- gcn::Graphics::CENTER);
+ const std::string str = toString(item->getQuantity());
+ font->drawString(g, str,
+ box->x + (mBoxSize - font->getWidth(str)) / 2,
+ box->y - fontHeight);
}
}
}