[Scummvm-cvs-logs] scummvm master -> 1dcce4445c28720cd093b6a36b376a36758138eb

bluegr md5 at scummvm.org
Mon Feb 28 00:07:43 CET 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:
1dcce4445c SCI: Reverted rc7bfbc3 and fixed the actual cause of bug #3106107


Commit: 1dcce4445c28720cd093b6a36b376a36758138eb
    https://github.com/scummvm/scummvm/commit/1dcce4445c28720cd093b6a36b376a36758138eb
Author: md5 (md5 at scummvm.org)
Date: 2011-02-27T15:06:29-08:00

Commit Message:
SCI: Reverted rc7bfbc3 and fixed the actual cause of bug #3106107

While fast forwarding a song, disable its hold value together with any possible
sound looping, so that the song won't loop forever.

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



diff --git a/engines/sci/sound/music.cpp b/engines/sci/sound/music.cpp
index a08525d..2331f2f 100644
--- a/engines/sci/sound/music.cpp
+++ b/engines/sci/sound/music.cpp
@@ -441,10 +441,15 @@ void SciMusic::soundPlay(MusicEntry *pSnd) {
 				// when loading a saved game. Fixes bug #3083151.
 				uint16 prevLoop = pSnd->loop;
 				pSnd->loop = 0;
+				// Same for hold. Fixes bug #3106107.
+				int16 prevHold = pSnd->hold;
+				pSnd->hold = -1;
 				// Fast forward to the last position and perform associated events when loading
 				pSnd->pMidiParser->jumpToTick(pSnd->ticker, true, true, true);
 				// Restore looping
 				pSnd->loop = prevLoop;
+				// Restore hold
+				pSnd->hold = prevHold;
 			}
 			pSnd->pMidiParser->mainThreadEnd();
 			_mutex.unlock();
diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp
index 33be8f4..1e6d0ae 100644
--- a/engines/sci/sound/soundcmd.cpp
+++ b/engines/sci/sound/soundcmd.cpp
@@ -318,9 +318,6 @@ reg_t SoundCommandParser::kDoSoundFade(int argc, reg_t *argv, reg_t acc) {
 
 	int volume = musicSlot->volume;
 
-	// Reset hold so that the song can actually stop
-	musicSlot->hold = -1;
-
 	// If sound is not playing currently, set signal directly
 	if (musicSlot->status != kSoundPlaying) {
 		debugC(kDebugLevelSound, "kDoSound(fade): %04x:%04x fading requested, but sound is currently not playing", PRINT_REG(obj));
@@ -534,12 +531,6 @@ reg_t SoundCommandParser::kDoSoundSetHold(int argc, reg_t *argv, reg_t acc) {
 		return acc;
 	}
 
-	// Is the song being faded? If yes, don't set a hold value, otherwise the
-	// song will never actually stop. Fixes bug #3106107.
-	if (musicSlot->fadeStep && argv[1].toSint16() != -1) {
-		warning("kDoSound(setHold): Attempt to set a hold value (%d) to a song being faded, ignoring", argv[1].toSint16());
-		return acc;
-	}
 	// Set the special hold marker ID where the song should be looped at.
 	musicSlot->hold = argv[1].toSint16();
 	return acc;






More information about the Scummvm-git-logs mailing list