aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kiewitz2010-08-04 09:15:37 +0000
committerMartin Kiewitz2010-08-04 09:15:37 +0000
commitb45f2fcb972d18808db80c51280f2f132150ef06 (patch)
treea610b329a1d0ae10b5be8107bae4a0ef6c414590
parentfcf3ea61fef643231076ce9b3d6e160f74015477 (diff)
downloadscummvm-rg350-b45f2fcb972d18808db80c51280f2f132150ef06.tar.gz
scummvm-rg350-b45f2fcb972d18808db80c51280f2f132150ef06.tar.bz2
scummvm-rg350-b45f2fcb972d18808db80c51280f2f132150ef06.zip
SCI: fix fadeout on workarounds
svn-id: r51728
-rw-r--r--engines/sci/sound/soundcmd.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp
index 52c97eba90..7a01b91e44 100644
--- a/engines/sci/sound/soundcmd.cpp
+++ b/engines/sci/sound/soundcmd.cpp
@@ -324,7 +324,11 @@ reg_t SoundCommandParser::kDoSoundFade(int argc, reg_t *argv, reg_t acc) {
case 4: // SCI01+
case 5: // SCI1+ (SCI1 late sound scheme), with fade and continue
musicSlot->fadeTo = CLIP<uint16>(argv[1].toUint16(), 0, MUSIC_VOLUME_MAX);
- musicSlot->fadeStep = volume > argv[1].toUint16() ? -argv[3].toUint16() : argv[3].toUint16();
+ // sometimes we get objects in that position, fix it up (ffs. workarounds)
+ if (!argv[1].segment)
+ musicSlot->fadeStep = volume > musicSlot->fadeTo ? -argv[3].toUint16() : argv[3].toUint16();
+ else
+ musicSlot->fadeStep = volume > musicSlot->fadeTo ? -5 : 5;
musicSlot->fadeTickerStep = argv[2].toUint16() * 16667 / _music->soundGetTempo();
musicSlot->fadeTicker = 0;
musicSlot->stopAfterFading = (argc == 5) ? (argv[4].toUint16() != 0) : false;