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/sound.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/sound.cpp')
-rw-r--r-- | src/sound.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
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()); |