From 2b1c0dcf269d617de1f6c203df547166661f089e Mon Sep 17 00:00:00 2001 From: Yohann Ferreira Date: Wed, 28 Jul 2010 19:57:31 +0200 Subject: 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. --- src/resources/spritedef.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/resources/spritedef.cpp') 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 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")) -- cgit v1.2.3-70-g09d2