From abde0f51b3062c158fb52e9dfff23d21d3be03d1 Mon Sep 17 00:00:00 2001 From: Yohann Ferreira Date: Sun, 11 Jul 2010 20:05:44 +0200 Subject: 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. --- src/resources/spritedef.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/resources/spritedef.cpp') diff --git a/src/resources/spritedef.cpp b/src/resources/spritedef.cpp index 55b38546..c524c43c 100644 --- a/src/resources/spritedef.cpp +++ b/src/resources/spritedef.cpp @@ -30,6 +30,8 @@ #include "resources/imageset.h" #include "resources/resourcemanager.h" +#include "configuration.h" + #include "utils/xml.h" #include @@ -61,9 +63,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 { @@ -278,7 +283,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")) -- cgit v1.2.3-60-g2f50