Skip to content

Commit

Permalink
Refactor|Audio|Client: Use de::String to concatenate base path and mu…
Browse files Browse the repository at this point in the history
…sic/sfx paths
  • Loading branch information
danij-deng committed Jun 17, 2014
1 parent 776c891 commit 8d91617
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
6 changes: 2 additions & 4 deletions doomsday/client/src/audio/s_cache.cpp
Expand Up @@ -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.
Expand Down
8 changes: 3 additions & 5 deletions doomsday/client/src/audio/s_mus.cpp
Expand Up @@ -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;
}

Expand Down

0 comments on commit 8d91617

Please sign in to comment.