diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-03-09 03:21:39 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-03-09 03:21:39 +0000 |
commit | 7593d6c71e2331c3e43c732db60ad03ee4d5385d (patch) | |
tree | 3ad242a957b6a500319d7bdae15149c553521ee4 /src/gui | |
parent | 81cf85e9ec1d37dc6e8dd9883f42bb50dace9135 (diff) | |
download | mana-7593d6c71e2331c3e43c732db60ad03ee4d5385d.tar.gz mana-7593d6c71e2331c3e43c732db60ad03ee4d5385d.tar.bz2 mana-7593d6c71e2331c3e43c732db60ad03ee4d5385d.tar.xz mana-7593d6c71e2331c3e43c732db60ad03ee4d5385d.zip |
Added Spriteset::get() and Spriteset::size() to hide the member vector and remove the weird mySpriteset->spriteset stuff.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/equipmentwindow.cpp | 4 | ||||
-rw-r--r-- | src/gui/itemcontainer.cpp | 14 | ||||
-rw-r--r-- | src/gui/playerbox.cpp | 6 |
3 files changed, 12 insertions, 12 deletions
diff --git a/src/gui/equipmentwindow.cpp b/src/gui/equipmentwindow.cpp index f1b9b4ba..9904af02 100644 --- a/src/gui/equipmentwindow.cpp +++ b/src/gui/equipmentwindow.cpp @@ -69,7 +69,7 @@ void EquipmentWindow::draw(gcn::Graphics *graphics) continue; } - image = itemset->spriteset[item->getInfo()->getImage() - 1]; + image = itemset->get(item->getInfo()->getImage() - 1); dynamic_cast<Graphics*>(graphics)->drawImage( image, 36 * (i % 4) + 10, 36 * (i / 4) + 25); } @@ -81,7 +81,7 @@ void EquipmentWindow::draw(gcn::Graphics *graphics) return; } - image = itemset->spriteset[item->getInfo()->getImage() - 1]; + image = itemset->get(item->getInfo()->getImage() - 1); dynamic_cast<Graphics*>(graphics)->drawImage(image, 160, 25); std::stringstream n; diff --git a/src/gui/itemcontainer.cpp b/src/gui/itemcontainer.cpp index 67cb5251..cc42066a 100644 --- a/src/gui/itemcontainer.cpp +++ b/src/gui/itemcontainer.cpp @@ -74,8 +74,8 @@ void ItemContainer::logic() void ItemContainer::draw(gcn::Graphics* graphics) { - int gridWidth = itemset->spriteset[0]->getWidth() + 4; - int gridHeight = itemset->spriteset[0]->getHeight() + 10; + int gridWidth = itemset->get(0)->getWidth() + 4; + int gridHeight = itemset->get(0)->getHeight() + 10; int w = getWidth(); int columns = w / gridWidth; @@ -119,7 +119,7 @@ void ItemContainer::draw(gcn::Graphics* graphics) if ((idx = item->getInfo()->getImage()) > 0) { dynamic_cast<Graphics*>(graphics)->drawImage( - itemset->spriteset[idx - 1], itemX, itemY); + itemset->get(idx - 1), itemX, itemY); } // Draw item caption @@ -143,8 +143,8 @@ void ItemContainer::setWidth(int width) { gcn::Widget::setWidth(width); - int gridWidth = itemset->spriteset[0]->getWidth() + 4; - int gridHeight = itemset->spriteset[0]->getHeight() + 14; + int gridWidth = itemset->get(0)->getWidth() + 4; + int gridHeight = itemset->get(0)->getHeight() + 14; int columns = getWidth() / gridWidth; if (columns < 1) @@ -168,8 +168,8 @@ void ItemContainer::selectNone() void ItemContainer::mousePress(int mx, int my, int button) { - int gridWidth = itemset->spriteset[0]->getWidth() + 4; - int gridHeight = itemset->spriteset[0]->getHeight() + 10; + int gridWidth = itemset->get(0)->getWidth() + 4; + int gridHeight = itemset->get(0)->getHeight() + 10; int w = getWidth(); int columns = w / gridWidth; diff --git a/src/gui/playerbox.cpp b/src/gui/playerbox.cpp index e61cabde..34283b4c 100644 --- a/src/gui/playerbox.cpp +++ b/src/gui/playerbox.cpp @@ -90,16 +90,16 @@ void PlayerBox::draw(gcn::Graphics *graphics) // Draw character dynamic_cast<Graphics*>(graphics)->drawImage( - playerset->spriteset[0], 23, 12); + playerset->get(0), 23, 12); // Draw his hair if (hairColor >= 0 && hairStyle >= 0 && hairColor < NR_HAIR_COLORS && hairStyle < NR_HAIR_STYLES) { int hf = 9 * hairColor; - if (hf >= 0 && hf < (int)hairset[hairStyle]->spriteset.size()) { + if (hf >= 0 && hf < (int)hairset[hairStyle]->size()) { dynamic_cast<Graphics*>(graphics)->drawImage( - hairset[hairStyle]->spriteset[hf], 35, 7); + hairset[hairStyle]->get(hf), 35, 7); } } } |