diff options
author | Marisa-Chan | 2014-12-19 17:14:13 +0600 |
---|---|---|
committer | Marisa-Chan | 2014-12-19 17:14:13 +0600 |
commit | ee7ba1bbaf4a17104f8a61be0218f9793b0b9cf6 (patch) | |
tree | 09495179508a69d672ced9173ceabb95fd2864e1 /engines | |
parent | 169bed1e5e8364875f68a66e7576c6947a11903b (diff) | |
download | scummvm-rg350-ee7ba1bbaf4a17104f8a61be0218f9793b0b9cf6.tar.gz scummvm-rg350-ee7ba1bbaf4a17104f8a61be0218f9793b0b9cf6.tar.bz2 scummvm-rg350-ee7ba1bbaf4a17104f8a61be0218f9793b0b9cf6.zip |
ZVISION: Fix zork raw soundParams handling
Diffstat (limited to 'engines')
-rw-r--r-- | engines/zvision/sound/zork_raw.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/engines/zvision/sound/zork_raw.cpp b/engines/zvision/sound/zork_raw.cpp index 393f2eb6a9..8688039325 100644 --- a/engines/zvision/sound/zork_raw.cpp +++ b/engines/zvision/sound/zork_raw.cpp @@ -264,30 +264,33 @@ Audio::RewindableAudioStream *makeRawZorkStream(const Common::String &filePath, fileName.toLowercase(); - SoundParams soundParams = {}; + const SoundParams *soundParams = NULL; if (engine->getGameId() == GID_NEMESIS) { for (int i = 0; i < 32; ++i) { if (RawZorkStream::_zNemSoundParamLookupTable[i].identifier == (fileName[6])) - soundParams = RawZorkStream::_zNemSoundParamLookupTable[i]; + soundParams = &RawZorkStream::_zNemSoundParamLookupTable[i]; } } else if (engine->getGameId() == GID_GRANDINQUISITOR) { for (int i = 0; i < 24; ++i) { if (RawZorkStream::_zgiSoundParamLookupTable[i].identifier == (fileName[7])) - soundParams = RawZorkStream::_zgiSoundParamLookupTable[i]; + soundParams = &RawZorkStream::_zgiSoundParamLookupTable[i]; } } - if (soundParams.packed) { - return makeRawZorkStream(wrapBufferedSeekableReadStream(file, 2048, DisposeAfterUse::YES), soundParams.rate, soundParams.stereo, DisposeAfterUse::YES); + if (soundParams == NULL) + return NULL; + + if (soundParams->packed) { + return makeRawZorkStream(wrapBufferedSeekableReadStream(file, 2048, DisposeAfterUse::YES), soundParams->rate, soundParams->stereo, DisposeAfterUse::YES); } else { byte flags = 0; - if (soundParams.bits16) + if (soundParams->bits16) flags |= Audio::FLAG_16BITS | Audio::FLAG_LITTLE_ENDIAN; - if (soundParams.stereo) + if (soundParams->stereo) flags |= Audio::FLAG_STEREO; - return Audio::makeRawStream(file, soundParams.rate, flags, DisposeAfterUse::YES); + return Audio::makeRawStream(file, soundParams->rate, flags, DisposeAfterUse::YES); } } |