diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-01-04 00:31:44 +0200 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-01-04 00:31:44 +0200 |
commit | 311783bebbe2bed366dca5097697ce34c690292d (patch) | |
tree | 0533581ca605f773a67739efccf75472a4d35dd7 /src/item.cpp | |
parent | 76bc1a5c994b46d8a4486a1226f681f7a4982f1c (diff) | |
download | manaplus-311783bebbe2bed366dca5097697ce34c690292d.tar.gz manaplus-311783bebbe2bed366dca5097697ce34c690292d.tar.bz2 manaplus-311783bebbe2bed366dca5097697ce34c690292d.tar.xz manaplus-311783bebbe2bed366dca5097697ce34c690292d.zip |
Add draw filter (incomplete)
Diffstat (limited to 'src/item.cpp')
-rw-r--r-- | src/item.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/item.cpp b/src/item.cpp index 94eaf383e..33d3916d3 100644 --- a/src/item.cpp +++ b/src/item.cpp @@ -62,7 +62,14 @@ void Item::setId(int id) mDrawImage->decRef(); ResourceManager *resman = ResourceManager::getInstance(); - SpriteDisplay display = getInfo().getDisplay(); + ItemInfo info = getInfo(); + mTags = info.getTags(); + logger->log("tag0=" + toString(mTags[1])); + +// for (int f = 0; f < mTags->size(); f ++) +// logger->log("tag: %d", (*mTags)[f]); + + SpriteDisplay display = info.getDisplay(); std::string imagePath = paths.getStringValue("itemIcons") + display.image; mImage = resman->getImage(imagePath); @@ -81,6 +88,13 @@ void Item::setId(int id) } } +bool Item::isHaveTag(int tagId) +{ + if (mTags.find(tagId) == mTags.end()) + return false; + return mTags[tagId] > 0; +} + Image *Item::getImage(int id) { ResourceManager *resman = ResourceManager::getInstance(); |