summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2006-12-24 00:05:26 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2006-12-24 00:05:26 +0000
commit166e9864f97275b1539edd8e89b271105f2fa04a (patch)
tree062a3a6e1251dfbe0fd5be98fbb405d2a422e6b3 /src/gui
parent1e6f5283eceff138873ec54159ad8f716ed39b45 (diff)
downloadmana-166e9864f97275b1539edd8e89b271105f2fa04a.tar.gz
mana-166e9864f97275b1539edd8e89b271105f2fa04a.tar.bz2
mana-166e9864f97275b1539edd8e89b271105f2fa04a.tar.xz
mana-166e9864f97275b1539edd8e89b271105f2fa04a.zip
Major rendering performance increase in software mode, by not using RLE
compression on loaded images while most of the time, we're only drawing a small subimage of them. Also, don't try to draw an icon when it is not defined or failed to load properly.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/shoplistbox.cpp6
-rw-r--r--src/gui/viewport.cpp4
2 files changed, 7 insertions, 3 deletions
diff --git a/src/gui/shoplistbox.cpp b/src/gui/shoplistbox.cpp
index f5581323..4821067c 100644
--- a/src/gui/shoplistbox.cpp
+++ b/src/gui/shoplistbox.cpp
@@ -89,7 +89,11 @@ void ShopListBox::draw(gcn::Graphics *gcnGraphics)
if (mShopItems)
{
- graphics->drawImage(mShopItems->at(i).image, 1, y);
+ Image *icon = mShopItems->at(i).image;
+ if (icon)
+ {
+ graphics->drawImage(icon, 1, y);
+ }
}
graphics->drawText(mListModel->getElementAt(i), ITEM_ICON_SIZE + 5,
y + (ITEM_ICON_SIZE - getFont()->getHeight()) / 2);
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index eabb717c..2c69143f 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -199,8 +199,8 @@ Viewport::draw(gcn::Graphics *gcnGraphics)
}
// Draw target marker if needed
- Being *target;
- if ((target = player_node->getTarget()))
+ Being *target = player_node->getTarget();
+ if (target)
{
graphics->setFont(speechFont);
graphics->setColor(gcn::Color(255, 32, 32));