diff options
author | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2010-07-11 20:05:44 +0200 |
---|---|---|
committer | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2010-07-11 20:05:44 +0200 |
commit | abde0f51b3062c158fb52e9dfff23d21d3be03d1 (patch) | |
tree | 4af561ea9e8cd3f7f981cce9817cf57f3e353787 /src/monster.cpp | |
parent | 93e1a2a9e5f379945a6efb24598319b605be1dfa (diff) | |
download | mana-abde0f51b3062c158fb52e9dfff23d21d3be03d1.tar.gz mana-abde0f51b3062c158fb52e9dfff23d21d3be03d1.tar.bz2 mana-abde0f51b3062c158fb52e9dfff23d21d3be03d1.tar.xz mana-abde0f51b3062c158fb52e9dfff23d21d3be03d1.zip |
Made the different hard-coded paths and files be now taken from the
data/paths.xml configuration file.
Also added default gui theme path in branding and default wallpaper path
and file searched respectively in the branding and paths.xml files.
Hard-coded values are still used as fallbacks.
Resolves: Manasource Mantis #148.
Reviewed-by: jaxad0127.
Diffstat (limited to 'src/monster.cpp')
-rw-r--r-- | src/monster.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/monster.cpp b/src/monster.cpp index d25c6c90..ca156821 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -34,6 +34,7 @@ #include "resources/monsterdb.h" #include "resources/monsterinfo.h" +#include "configuration.h" Monster::Monster(int id, int subtype, Map *map): Being(id, subtype, map), @@ -132,14 +133,17 @@ void Monster::setSubtype(Uint16 subtype) for (std::list<std::string>::const_iterator i = sprites.begin(); i != sprites.end(); i++) { - std::string file = "graphics/sprites/" + *i; + std::string file = paths.getValue("sprites", + "graphics/sprites/") + *i; mSprites.push_back(AnimatedSprite::load(file)); } // Ensure that something is shown if (mSprites.size() == 0) { - mSprites.push_back(AnimatedSprite::load("graphics/sprites/error.xml")); + mSprites.push_back(AnimatedSprite::load( + paths.getValue("sprites", "graphics/sprites/") + + paths.getValue("spriteErrorFile", "error.xml") )); } if (Particle::enabled) |