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/sound.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/sound.cpp') diff --git a/src/sound.cpp b/src/sound.cpp index 95860992..241e25e4 100644 --- a/src/sound.cpp +++ b/src/sound.cpp @@ -27,6 +27,8 @@ #include "resources/resourcemanager.h" #include "resources/soundeffect.h" +#include "configuration.h" + Sound::Sound(): mInstalled(false), mSfxVolume(100), @@ -149,7 +151,9 @@ static Mix_Music *loadMusic(const std::string &filename) // it to a temporary physical file so that SDL_mixer can stream it. logger->log("Loading music \"%s\" from temporary file tempMusic.ogg", path.c_str()); - bool success = resman->copyFile("music/" + filename, "tempMusic.ogg"); + bool success = resman->copyFile( + paths.getValue("music", "music/") + + filename, "tempMusic.ogg"); if (success) path = resman->getPath("tempMusic.ogg"); else @@ -235,7 +239,8 @@ void Sound::playSfx(const std::string &path) return; ResourceManager *resman = ResourceManager::getInstance(); - SoundEffect *sample = resman->getSoundEffect(path); + SoundEffect *sample = resman->getSoundEffect( + paths.getValue("sfx", "sfx/") + path); if (sample) { logger->log("Sound::playSfx() Playing: %s", path.c_str()); -- cgit v1.2.3-60-g2f50