From 9907ebed0a81c0e8af377edac0f3c3653ffbe024 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 21 Aug 2019 19:25:49 +0200 Subject: HDB: Simplified sound loading code --- engines/hdb/sound.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'engines/hdb') 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); -- cgit v1.2.3