aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2015-05-13 22:54:03 +0200
committerStrangerke2015-05-13 22:58:06 +0200
commitc6c056133c7720fc83de0513acbf4b0cc96bc50e (patch)
tree592b5e563cd8f700b5bc6869ce5e05a6ceab374b
parent187b5838533b0a182b8b44c4bfd513eeaae6aaa0 (diff)
downloadscummvm-rg350-c6c056133c7720fc83de0513acbf4b0cc96bc50e.tar.gz
scummvm-rg350-c6c056133c7720fc83de0513acbf4b0cc96bc50e.tar.bz2
scummvm-rg350-c6c056133c7720fc83de0513acbf4b0cc96bc50e.zip
SHERLOCK: Remove useless checks in playSound
-rw-r--r--engines/sherlock/sound.cpp28
1 files changed, 11 insertions, 17 deletions
diff --git a/engines/sherlock/sound.cpp b/engines/sherlock/sound.cpp
index 7b8d6c69c6..59098c32cc 100644
--- a/engines/sherlock/sound.cpp
+++ b/engines/sherlock/sound.cpp
@@ -95,17 +95,10 @@ bool Sound::playSound(const Common::String &name, WaitType waitType, int priorit
if (!filename.contains('.'))
filename += ".SND";
- Common::SeekableReadStream *stream = nullptr;
-
- if (_vm->_res->exists(filename))
- stream = _vm->_res->load(filename, "TITLE.SND");
- else if (_vm->_res->exists(filename))
- stream = _vm->_res->load(filename, "EPILOGUE.SND");
- else if (_vm->_res->exists(filename))
- stream = _vm->_res->load(filename, "SND.SND");
+ Common::SeekableReadStream *stream = _vm->_res->load(filename);
if (!stream)
- error("Unable to find sound file %s", filename.c_str());
+ error("Unable to find sound file '%s'", filename.c_str());
stream->skip(2);
int size = stream->readUint32BE();
@@ -128,6 +121,15 @@ bool Sound::playSound(const Common::String &name, WaitType waitType, int priorit
free(data);
+#if 0
+ // Debug : used to dump files
+ Common::DumpFile outFile;
+ outFile.open(filename);
+ outFile.write(decoded, (size - 2) * 2);
+ outFile.flush();
+ outFile.close();
+#endif
+
Audio::AudioStream *audioStream = Audio::makeRawStream(decoded, (size - 2) * 2, rate, Audio::FLAG_UNSIGNED, DisposeAfterUse::YES);
_mixer->playStream(Audio::Mixer::kPlainSoundType, &_effectsHandle, audioStream, -1, Audio::Mixer::kMaxChannelVolume);
_soundPlaying = true;
@@ -151,14 +153,6 @@ bool Sound::playSound(const Common::String &name, WaitType waitType, int priorit
_soundPlaying = false;
_mixer->stopHandle(_effectsHandle);
-#if 0
- // Debug : used to dump files
- Common::DumpFile outFile;
- outFile.open(filename);
- outFile.write(decoded, (size - 2) * 2);
- outFile.flush();
- outFile.close();
-#endif
return retval;
}