[Scummvm-cvs-logs] scummvm master -> 5654e1257551bf176c7fd06c756612bec3d79033

bluegr md5 at scummvm.org
Thu Apr 28 03:16:48 CEST 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
5654e12575 SCI: Added a more specific workaround for bug #3267956. This fixes bug #3291115 - "KQ6: Game freezes when getting paper 


Commit: 5654e1257551bf176c7fd06c756612bec3d79033
    https://github.com/scummvm/scummvm/commit/5654e1257551bf176c7fd06c756612bec3d79033
Author: md5 (md5 at scummvm.org)
Date: 2011-04-27T18:14:54-07:00

Commit Message:
SCI: Added a more specific workaround for bug #3267956. This fixes bug #3291115 - "KQ6: Game freezes when getting paper from web"

Changed paths:
    engines/sci/sound/soundcmd.cpp



diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp
index 9ad964b..c6a7fec 100644
--- a/engines/sci/sound/soundcmd.cpp
+++ b/engines/sci/sound/soundcmd.cpp
@@ -325,14 +325,6 @@ 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
@@ -353,7 +345,19 @@ reg_t SoundCommandParser::kDoSoundFade(int argc, reg_t *argv, reg_t acc) {
 			musicSlot->fadeStep = volume > musicSlot->fadeTo ? -5 : 5;
 		musicSlot->fadeTickerStep = argv[2].toUint16() * 16667 / _music->soundGetTempo();
 		musicSlot->fadeTicker = 0;
+		// TODO: We only handle zero and non-zero parameters, but this parameter
+		// can have other values as well (e.g. it's 3 in KQ6).
 		musicSlot->stopAfterFading = (argc == 5) ? (argv[4].toUint16() != 0) : false;
+
+		// WORKAROUND/HACK: In the labyrinth in KQ6, when falling in the pit and
+		// lighting the lantern, the game scripts perform a fade in of the game
+		// music, but set it to stop after fading. Remove that flag here. This is
+		// marked as both a workaround and a hack because this issue could be a
+		// problem with our fading code and an incorrect handling of that
+		// parameter, or a script bug in that scene. Fixes bug #3267956.
+		if (g_sci->getGameId() == GID_KQ6 && g_sci->getEngineState()->currentRoomNumber() == 406 &&
+			musicSlot->resourceId == 400)
+			musicSlot->stopAfterFading = false;
 		break;
 
 	default:






More information about the Scummvm-git-logs mailing list