diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-05-10 19:34:42 +0200 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-05-10 19:54:02 +0200 |
commit | f2dbb7140f8efab0278ac17489b75c0c8ab60102 (patch) | |
tree | 400111c6fe5c6114a96d1e1a9178f8109725faec | |
parent | 7f15330d969e5c973429d03ca767551e7b67c3c3 (diff) | |
download | mana-f2dbb7140f8efab0278ac17489b75c0c8ab60102.tar.gz mana-f2dbb7140f8efab0278ac17489b75c0c8ab60102.tar.bz2 mana-f2dbb7140f8efab0278ac17489b75c0c8ab60102.tar.xz mana-f2dbb7140f8efab0278ac17489b75c0c8ab60102.zip |
Fixed the problem with items disappearing beneath the road
Increased their pixel y coordinate by half a tile, to make them draw
between the fringe and the beings.
-rw-r--r-- | src/flooritem.h | 19 | ||||
-rw-r--r-- | src/gui/inventorywindow.cpp | 2 | ||||
-rw-r--r-- | src/item.h | 4 |
3 files changed, 14 insertions, 11 deletions
diff --git a/src/flooritem.h b/src/flooritem.h index 9911cd25..99074943 100644 --- a/src/flooritem.h +++ b/src/flooritem.h @@ -41,6 +41,12 @@ class FloorItem : public Sprite public: /** * Constructor. + * + * @param id the unique ID of this item instance + * @param itemId the item ID + * @param x the x position in tiles + * @param y the y position in tiles + * @param map the map this item is on */ FloorItem(int id, int itemId, @@ -48,18 +54,15 @@ class FloorItem : public Sprite int y, Map *map); - /** - * Destructor. - */ ~FloorItem(); /** - * Returns instance id of this item. + * Returns instance ID of this item. */ int getId() const { return mId; } /** - * Returns the item id. + * Returns the item ID. */ int getItemId() const; @@ -70,12 +73,12 @@ class FloorItem : public Sprite Item *getItem() const; /** - * Returns the x coordinate. + * Returns the x coordinate in tiles. */ int getX() const { return mX; } /** - * Returns the y coordinate. + * Returns the y coordinate in tiles. */ int getY() const { return mY; } @@ -84,7 +87,7 @@ class FloorItem : public Sprite * * @see Sprite::getPixelY() */ - int getPixelY() const { return mY * 32; } + int getPixelY() const { return mY * 32 + 16; } /** * Draws this floor item to the given graphics context. diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp index a7be69b8..efa5bc2e 100644 --- a/src/gui/inventorywindow.cpp +++ b/src/gui/inventorywindow.cpp @@ -184,7 +184,7 @@ void InventoryWindow::action(const gcn::ActionEvent &event) } } -Item* InventoryWindow::getSelectedItem() const +Item *InventoryWindow::getSelectedItem() const { return mItems->getSelectedItem(); } @@ -56,7 +56,7 @@ class Item /** * Returns the item image. */ - Image* getImage() { return mImage; } + Image *getImage() { return mImage; } /** * Sets the number of items. @@ -106,7 +106,7 @@ class Item /** * Returns information about this item type. */ - const ItemInfo& getInfo() const { return ItemDB::get(mId); } + const ItemInfo &getInfo() const { return ItemDB::get(mId); } protected: int mId; /**< Item type id. */ |