summaryrefslogtreecommitdiff
path: root/src/resources/itemdb.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-03-12 23:59:10 +0300
committerAndrei Karas <akaras@inbox.ru>2012-03-13 00:04:53 +0300
commit0a7725600eecd8491f3c814110bb434824e71252 (patch)
tree05df7742a9697f394a9478082fdeb15a46d4bbb4 /src/resources/itemdb.cpp
parent9e53440cb2dbcfd4311ce2566eb98839383738c7 (diff)
downloadmanaplus-0a7725600eecd8491f3c814110bb434824e71252.tar.gz
manaplus-0a7725600eecd8491f3c814110bb434824e71252.tar.bz2
manaplus-0a7725600eecd8491f3c814110bb434824e71252.tar.xz
manaplus-0a7725600eecd8491f3c814110bb434824e71252.zip
Use per race equipment sprites.
Example: <sprite gender="male" race="4">...</sprite>
Diffstat (limited to 'src/resources/itemdb.cpp')
-rw-r--r--src/resources/itemdb.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp
index e81700ecc..3aadc662e 100644
--- a/src/resources/itemdb.cpp
+++ b/src/resources/itemdb.cpp
@@ -167,8 +167,8 @@ void ItemDB::load()
mUnknown->setName(_("Unknown item"));
mUnknown->setDisplay(SpriteDisplay());
std::string errFile = paths.getStringValue("spriteErrorFile");
- mUnknown->setSprite(errFile, GENDER_MALE);
- mUnknown->setSprite(errFile, GENDER_FEMALE);
+ mUnknown->setSprite(errFile, GENDER_MALE, 0);
+ mUnknown->setSprite(errFile, GENDER_FEMALE, 0);
mUnknown->addTag(mTags["All"]);
XML::Document doc("items.xml");
@@ -595,14 +595,15 @@ int parseDirectionName(std::string name)
void loadSpriteRef(ItemInfo *itemInfo, XmlNodePtr node)
{
- std::string gender = XML::getProperty(node, "gender", "unisex");
- std::string filename = reinterpret_cast<const char*>(
+ const std::string gender = XML::getProperty(node, "gender", "unisex");
+ const std::string filename = reinterpret_cast<const char*>(
node->xmlChildrenNode->content);
+ const int race = XML::getProperty(node, "race", 0);
if (gender == "male" || gender == "unisex")
- itemInfo->setSprite(filename, GENDER_MALE);
+ itemInfo->setSprite(filename, GENDER_MALE, race);
if (gender == "female" || gender == "unisex")
- itemInfo->setSprite(filename, GENDER_FEMALE);
+ itemInfo->setSprite(filename, GENDER_FEMALE, race);
}
void loadSoundRef(ItemInfo *itemInfo, XmlNodePtr node)