From 8d91617c5e2ecbba622f5008b62d430199dc401f Mon Sep 17 00:00:00 2001 From: danij Date: Tue, 17 Jun 2014 21:32:11 +0100 Subject: [PATCH] Refactor|Audio|Client: Use de::String to concatenate base path and music/sfx paths --- doomsday/client/src/audio/s_cache.cpp | 6 ++---- doomsday/client/src/audio/s_mus.cpp | 8 +++----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/doomsday/client/src/audio/s_cache.cpp b/doomsday/client/src/audio/s_cache.cpp index 4aa945bca3..d6f7b6e817 100644 --- a/doomsday/client/src/audio/s_cache.cpp +++ b/doomsday/client/src/audio/s_cache.cpp @@ -531,11 +531,9 @@ static sfxsample_t *cacheSample(int id, sfxinfo_t const *info) /// @note Path is relative to the base path. if(!Str_IsEmpty(&info->external)) { - AutoStr *searchPath = AutoStr_NewStd(); - F_PrependBasePath(searchPath, &info->external); - + String searchPath = App_BasePath() / String(Str_Text(&info->external)); // Try loading. - data = WAV_Load(Str_Text(searchPath), &bytesPer, &rate, &numSamples); + data = WAV_Load(searchPath.toUtf8().constData(), &bytesPer, &rate, &numSamples); if(data) { bytesPer /= 8; // Was returned as bits. diff --git a/doomsday/client/src/audio/s_mus.cpp b/doomsday/client/src/audio/s_mus.cpp index 9823e57250..42aa46628c 100644 --- a/doomsday/client/src/audio/s_mus.cpp +++ b/doomsday/client/src/audio/s_mus.cpp @@ -234,13 +234,11 @@ int Mus_GetExt(ded_music_t *def, ddstring_t *retPath) if(def->path && !def->path->path().isEmpty()) { // All external music files are specified relative to the base path. - AutoStr *fullPath = AutoStr_NewStd(); - F_PrependBasePath(fullPath, def->path->pathStr()); - F_FixSlashes(fullPath, fullPath); + String fullPath = App_BasePath() / def->path->path(); - if(F_Access(Str_Text(fullPath))) + if(F_Access(fullPath.toUtf8().constData())) { - if(retPath) Str_Set(retPath, Str_Text(fullPath)); + if(retPath) Str_Set(retPath, fullPath.toUtf8().constData()); return true; }