From 311783bebbe2bed366dca5097697ce34c690292d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 4 Jan 2011 00:31:44 +0200 Subject: Add draw filter (incomplete) --- src/item.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/item.cpp') 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(); -- cgit v1.2.3-70-g09d2