summaryrefslogtreecommitdiff
path: root/src/floor_item.h
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2008-06-12 09:06:01 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2008-06-12 09:06:01 +0000
commit2f8ee95fbacb71e7cbca85fcc11e6f9f7e36c258 (patch)
tree8d256ac1a38932aaf0db7b55ed178e4212616555 /src/floor_item.h
parenteb019ab915998a3ec247b33dad4b23f763d7a29a (diff)
downloadmana-client-2f8ee95fbacb71e7cbca85fcc11e6f9f7e36c258.tar.gz
mana-client-2f8ee95fbacb71e7cbca85fcc11e6f9f7e36c258.tar.bz2
mana-client-2f8ee95fbacb71e7cbca85fcc11e6f9f7e36c258.tar.xz
mana-client-2f8ee95fbacb71e7cbca85fcc11e6f9f7e36c258.zip
Merged revisions 3738 via svnmerge from
https://themanaworld.svn.sourceforge.net/svnroot/themanaworld/tmw/trunk ........ r3738 | b_lindeijer | 2007-11-16 00:44:01 +0100 (Fri, 16 Nov 2007) | 3 lines Moved item icon from ItemInfo class to the Item class, so that it can be loaded on demand. Results in faster startup time and reduced memory usage. ........
Diffstat (limited to 'src/floor_item.h')
-rw-r--r--src/floor_item.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/floor_item.h b/src/floor_item.h
index 36f81585..a87e3f79 100644
--- a/src/floor_item.h
+++ b/src/floor_item.h
@@ -25,6 +25,7 @@
#define _TMW_FLOORITEM_H_
#include "graphics.h"
+#include "item.h"
#include "map.h"
#include "sprite.h"
#include "resources/image.h"
@@ -59,7 +60,7 @@ class FloorItem : public Sprite
* Returns the item id.
*/
unsigned int
- getItemId() const { return mItemId; }
+ getItemId() const { return mItem->getId(); }
/**
* Returns the x coordinate.
@@ -89,16 +90,15 @@ class FloorItem : public Sprite
void
draw(Graphics *graphics, int offsetX, int offsetY) const
{
- graphics->drawImage(mImage,
+ graphics->drawImage(mItem->getImage(),
mX * 32 + offsetX,
mY * 32 + offsetY);
}
private:
unsigned int mId;
- unsigned int mItemId;
unsigned short mX, mY;
- Image *mImage;
+ Item *mItem;
Sprites::iterator mSpriteIterator;
Map *mMap;
};