Skip to content

Commit

Permalink
SCI: Fixed fading-related bugs #3267956 and #3041738
Browse files Browse the repository at this point in the history
  • Loading branch information
bluegr committed Apr 3, 2011
1 parent 6d90b07 commit bfef0f5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions engines/sci/sound/soundcmd.cpp
Expand Up @@ -325,6 +325,14 @@ reg_t SoundCommandParser::kDoSoundFade(int argc, reg_t *argv, reg_t acc) {
return acc;
}

// If the current volume of the slot is the same as the target volume,
// return without performing any fading. This fixes the music in room
// 406 in KQ6 (bug #3267956), where the game scripts ask for the background
// music to be played, and then faded to volume 127 (but the music is
// already at volume 127) and subsequently stopped.
if (argc >= 4 && musicSlot->volume == CLIP<uint16>(argv[1].toUint16(), 0, MUSIC_VOLUME_MAX))
return acc;

switch (argc) {
case 1: // SCI0
// SCI0 fades out all the time and when fadeout is done it will also
Expand Down

0 comments on commit bfef0f5

Please sign in to comment.