summaryrefslogtreecommitdiff
path: root/src/resources/spritedef.cpp
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2010-07-28 19:57:31 +0200
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2010-07-28 19:57:31 +0200
commit2b1c0dcf269d617de1f6c203df547166661f089e (patch)
tree5d247d694f28ddbeb6e2da26b9db02eeab5c7480 /src/resources/spritedef.cpp
parent44d8856c777790449df46e3b5348a6a7433a75d8 (diff)
downloadmana-client-2b1c0dcf269d617de1f6c203df547166661f089e.tar.gz
mana-client-2b1c0dcf269d617de1f6c203df547166661f089e.tar.bz2
mana-client-2b1c0dcf269d617de1f6c203df547166661f089e.tar.xz
mana-client-2b1c0dcf269d617de1f6c203df547166661f089e.zip
Centralized configuration default values using the VariableData system.
Please note that I didn't turned all the getValue() call into new ones, simply because I have to have config object initiated which is not forcefully the case the branding file. Resolves: Manasource Mantis #170.
Diffstat (limited to 'src/resources/spritedef.cpp')
-rw-r--r--src/resources/spritedef.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/resources/spritedef.cpp b/src/resources/spritedef.cpp
index 383e8a27..32fb5757 100644
--- a/src/resources/spritedef.cpp
+++ b/src/resources/spritedef.cpp
@@ -37,8 +37,7 @@
#include <set>
SpriteReference *SpriteReference::Empty = new SpriteReference(
- paths.getValue("spriteErrorFile", "error.xml"),
- 0);
+ paths.getStringValue("spriteErrorFile"), 0);
Action *SpriteDef::getAction(SpriteAction action) const
{
@@ -67,9 +66,8 @@ SpriteDef *SpriteDef::load(const std::string &animationFile, int variant)
{
logger->log("Error, failed to parse %s", animationFile.c_str());
- std::string errorFile = paths.getValue("sprites", "graphics/sprites")
- + paths.getValue("spriteErrorFile",
- "error.xml");
+ std::string errorFile = paths.getStringValue("sprites")
+ + paths.getStringValue("spriteErrorFile");
if (animationFile != errorFile)
{
return load(errorFile, 0);
@@ -287,8 +285,7 @@ void SpriteDef::includeSprite(xmlNodePtr includeNode)
if (filename.empty())
return;
- XML::Document doc(paths.getValue("sprites", "graphics/sprites/")
- + filename);
+ XML::Document doc(paths.getStringValue("sprites") + filename);
xmlNodePtr rootNode = doc.rootNode();
if (!rootNode || !xmlStrEqual(rootNode->name, BAD_CAST "sprite"))