diff options
author | Adrian Frühwirth | 2018-03-14 19:20:57 +0100 |
---|---|---|
committer | Adrian Frühwirth | 2018-03-14 19:26:30 +0100 |
commit | 3de75901c3826ad64c7d80f0d1c870bd6055e54f (patch) | |
tree | 295a1fa3e0002a4a7eb3977894f1f94948af62cd /engines/tucker | |
parent | b4a9093d759257dd8a1138059fe5d404c4ed902c (diff) | |
download | scummvm-rg350-3de75901c3826ad64c7d80f0d1c870bd6055e54f.tar.gz scummvm-rg350-3de75901c3826ad64c7d80f0d1c870bd6055e54f.tar.bz2 scummvm-rg350-3de75901c3826ad64c7d80f0d1c870bd6055e54f.zip |
TUCKER: Fix wrong sound effects being played
Fixes Trac#6376, Trac#6377 and probably many more unreported instances
of wrong audio samples being played.
Diffstat (limited to 'engines/tucker')
-rw-r--r-- | engines/tucker/resource.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/engines/tucker/resource.cpp b/engines/tucker/resource.cpp index cab26a0636..0ea24adf2d 100644 --- a/engines/tucker/resource.cpp +++ b/engines/tucker/resource.cpp @@ -900,6 +900,21 @@ void TuckerEngine::loadFx() { break; } if (s->_type == 8) { + // type 8 is basically a pointer to another type 6 sample + + // WORKAROUND + // There is at least one instance (namely in location 40) where the reference + // is to another sample which has not yet been read in. + // It seems that the original doesn't properly handle this case which + // results in the sample not being played at all. + // We just ignore and hop over these. + if (s->_num >= i) { + --i; + continue; + } + + assert(s->_num >= 0 && s ->_num < i); + s->_num = _locationSoundsTable[s->_num]._num; s->_type = 6; } } @@ -924,6 +939,7 @@ void TuckerEngine::loadFx() { } else { error("loadFx() - Index not found for location %d", _locationNum); } + } void TuckerEngine::loadSound(Audio::Mixer::SoundType type, int num, int volume, bool loop, Audio::SoundHandle *handle) { |