diff options
author | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2010-07-19 20:22:59 +0200 |
---|---|---|
committer | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2010-07-19 20:22:59 +0200 |
commit | 86eb0c08d233636cd4647649c6542d3cf410e3ab (patch) | |
tree | 9721759b41f0256f15c3786c357448a93215440e /src/resources/spritedef.cpp | |
parent | 335eec717f6189c01d8217dd2c4f4e74a171d9a5 (diff) | |
parent | 2d584d7e8aaeacbcb1036bae5c8deca9b810fe60 (diff) | |
download | mana-86eb0c08d233636cd4647649c6542d3cf410e3ab.tar.gz mana-86eb0c08d233636cd4647649c6542d3cf410e3ab.tar.bz2 mana-86eb0c08d233636cd4647649c6542d3cf410e3ab.tar.xz mana-86eb0c08d233636cd4647649c6542d3cf410e3ab.zip |
Merge branch '1.0'
Conflicts:
src/gui/itempopup.cpp
src/item.cpp
src/monster.cpp
src/net/manaserv/playerhandler.cpp
src/net/tmwa/partyhandler.cpp
src/npc.cpp
src/player.cpp
src/resources/itemdb.cpp
src/resources/monsterdb.cpp
src/resources/monsterinfo.cpp
src/resources/npcdb.cpp
src/resources/spritedef.cpp
Diffstat (limited to 'src/resources/spritedef.cpp')
-rw-r--r-- | src/resources/spritedef.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/resources/spritedef.cpp b/src/resources/spritedef.cpp index 03787569..383e8a27 100644 --- a/src/resources/spritedef.cpp +++ b/src/resources/spritedef.cpp @@ -30,12 +30,15 @@ #include "resources/imageset.h" #include "resources/resourcemanager.h" -#include "utils/dtor.h" +#include "configuration.h" + #include "utils/xml.h" #include <set> -SpriteReference *SpriteReference::Empty = new SpriteReference("error.xml", 0); +SpriteReference *SpriteReference::Empty = new SpriteReference( + paths.getValue("spriteErrorFile", "error.xml"), + 0); Action *SpriteDef::getAction(SpriteAction action) const { @@ -64,9 +67,12 @@ SpriteDef *SpriteDef::load(const std::string &animationFile, int variant) { logger->log("Error, failed to parse %s", animationFile.c_str()); - if (animationFile != "graphics/sprites/error.xml") + std::string errorFile = paths.getValue("sprites", "graphics/sprites") + + paths.getValue("spriteErrorFile", + "error.xml"); + if (animationFile != errorFile) { - return load("graphics/sprites/error.xml", 0); + return load(errorFile, 0); } else { @@ -281,7 +287,8 @@ void SpriteDef::includeSprite(xmlNodePtr includeNode) if (filename.empty()) return; - XML::Document doc("graphics/sprites/" + filename); + XML::Document doc(paths.getValue("sprites", "graphics/sprites/") + + filename); xmlNodePtr rootNode = doc.rootNode(); if (!rootNode || !xmlStrEqual(rootNode->name, BAD_CAST "sprite")) |