aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2019-08-21 19:25:49 +0200
committerEugene Sandulenko2019-09-03 17:17:34 +0200
commit9907ebed0a81c0e8af377edac0f3c3653ffbe024 (patch)
tree646919526ce342452bd463fe2e5d99305f9384ef
parentcf3c1f099759df4e6c6787949bffbd707bad328b (diff)
downloadscummvm-rg350-9907ebed0a81c0e8af377edac0f3c3653ffbe024.tar.gz
scummvm-rg350-9907ebed0a81c0e8af377edac0f3c3653ffbe024.tar.bz2
scummvm-rg350-9907ebed0a81c0e8af377edac0f3c3653ffbe024.zip
HDB: Simplified sound loading code
-rw-r--r--engines/hdb/sound.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/engines/hdb/sound.cpp b/engines/hdb/sound.cpp
index d1dc45b737..b2c3602509 100644
--- a/engines/hdb/sound.cpp
+++ b/engines/hdb/sound.cpp
@@ -1488,14 +1488,12 @@ void Sound::playSound(int index) {
// is sound marked as cached?
if (_soundCache[index].loaded == SNDMEM_NOTCACHED) {
+ Common::String updatedName(_soundCache[index].name);
- if (g_hdb->getPlatform() == Common::kPlatformLinux) {
- Common::String updatedName(_soundCache[index].name);
+ if (g_hdb->getPlatform() == Common::kPlatformLinux)
updatedName.replace(updatedName.begin() + updatedName.size() - 4, updatedName.end(), "_OGG");
- _soundCache[index].data = g_hdb->_fileMan->findFirstData(updatedName.c_str(), TYPE_BINARY);
- } else
- _soundCache[index].data = g_hdb->_fileMan->findFirstData(_soundCache[index].name, TYPE_BINARY);
+ _soundCache[index].data = g_hdb->_fileMan->findFirstData(updatedName.c_str(), TYPE_BINARY);
_soundCache[index].loaded = SNDMEM_LOADED;
} else {
_soundCache[index].data->seek(0);