From 9e72886ee15acc39cbb6075ce32a60a5391ea9f3 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 3 Apr 2017 02:12:42 +0300 Subject: Replace string::append with pathJoin. --- src/soundmanager.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/soundmanager.cpp') diff --git a/src/soundmanager.cpp b/src/soundmanager.cpp index ba455f65f..7d085fff4 100644 --- a/src/soundmanager.cpp +++ b/src/soundmanager.cpp @@ -325,7 +325,8 @@ void SoundManager::setSfxVolume(const int volume) static SDLMusic *loadMusic(const std::string &fileName, const SkipError skipError) { - const std::string path = paths.getStringValue("music").append(fileName); + const std::string path = pathJoin(paths.getStringValue("music"), + fileName); if (!VirtFs::exists(path)) { if (skipError == SkipError_false) @@ -460,7 +461,7 @@ void SoundManager::playSfx(const std::string &path, } else { - tmpPath = paths.getValue("sfx", "sfx/").append(path); + tmpPath = pathJoin(paths.getValue("sfx", "sfx"), path); } SoundEffect *const sample = Loader::getSoundEffect(tmpPath); if (sample) @@ -493,8 +494,8 @@ void SoundManager::playGuiSound(const std::string &name) const std::string sound = config.getStringValue(name); if (sound == "(no sound)") return; - playGuiSfx(branding.getStringValue("systemsounds").append( - sound).append(".ogg")); + playGuiSfx(pathJoin(branding.getStringValue("systemsounds"), + std::string(sound).append(".ogg"))); } void SoundManager::playGuiSfx(const std::string &path) @@ -510,7 +511,7 @@ void SoundManager::playGuiSfx(const std::string &path) if (!path.compare(0, 4, "sfx/")) tmpPath = path; else - tmpPath = paths.getValue("sfx", "sfx/").append(path); + tmpPath = pathJoin(paths.getValue("sfx", "sfx"), path); SoundEffect *const sample = Loader::getSoundEffect(tmpPath); if (sample) { -- cgit v1.2.3-70-g09d2