[Scummvm-cvs-logs] scummvm master -> 23db3cd9f225d40ff1900dd806630800ecf54aeb

bluegr bluegr at gmail.com
Mon Aug 20 02:29:24 CEST 2012


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

Summary:
8524ebd699 SCI: Fix script bug #3555404 - "SCI: KQ6 Spider Scene Game Freeze"
b19ccb9d1e SCI: Set the correct audio type for SCI1.1 sound effects, fixing bug #3554709
23db3cd9f2 SAGA: Remove incorrect free() in loadShortenFromStream()


Commit: 8524ebd699254a6786033f0e41b9a45c563feb11
    https://github.com/scummvm/scummvm/commit/8524ebd699254a6786033f0e41b9a45c563feb11
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2012-08-19T16:58:37-07:00

Commit Message:
SCI: Fix script bug #3555404 - "SCI: KQ6 Spider Scene Game Freeze"

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



diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp
index cbb5cab..1570e36 100644
--- a/engines/sci/sound/soundcmd.cpp
+++ b/engines/sci/sound/soundcmd.cpp
@@ -367,29 +367,36 @@ 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);
-		// Check if the song is already at the requested volume. If it is, don't
-		// perform any fading. Happens for example during the intro of Longbow.
-		if (musicSlot->fadeTo == musicSlot->volume)
-			return acc;
-
-		// sometimes we get objects in that position, fix it up (ffs. workarounds)
-		if (!argv[1].getSegment())
-			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;
-
 		if (argc == 5) {
 			// TODO: We currently treat this argument as a boolean, but may
 			// have to handle different non-zero values differently. (e.g.,
-			// some KQ6 scripts pass 3 here)
-			musicSlot->stopAfterFading = (argv[4].toUint16() != 0);
+			// some KQ6 scripts pass 3 here).
+			// There is a script bug in KQ6, room 460 (the room with the flying
+			// books). An object is passed here, which should not be treated as
+			// a true flag. Fixes bugs #3555404 and #3291115.
+			musicSlot->stopAfterFading = (argv[4].isNumber() && argv[4].toUint16() != 0);
 		} else {
 			musicSlot->stopAfterFading = false;
 		}
 
+		musicSlot->fadeTo = CLIP<uint16>(argv[1].toUint16(), 0, MUSIC_VOLUME_MAX);
+		// Check if the song is already at the requested volume. If it is, don't
+		// perform any fading. Happens for example during the intro of Longbow.
+		if (musicSlot->fadeTo != musicSlot->volume) {
+			// sometimes we get objects in that position, fix it up (ffs. workarounds)
+			if (!argv[1].getSegment())
+				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();
+		} else {
+			// Stop the music, if requested. Fixes bug #3555404.
+			if (musicSlot->stopAfterFading)
+				processStopSound(obj, false);
+		}
+
+		musicSlot->fadeTicker = 0;
+
 		// 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


Commit: b19ccb9d1edcdf238727f0c3b0a731b2f00e9d3d
    https://github.com/scummvm/scummvm/commit/b19ccb9d1edcdf238727f0c3b0a731b2f00e9d3d
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2012-08-19T17:22:56-07:00

Commit Message:
SCI: Set the correct audio type for SCI1.1 sound effects, fixing bug #3554709

Now, sound effects in SCI1.1 games will no longer be incorrectly using the speech
sound volume. This avoids them being silenced in floppy games that are flagged
as not having speech. Fixes bug #3554709 - "SCI: Digital SFX don't play when
Override Global Audio set"

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



diff --git a/engines/sci/sound/audio.cpp b/engines/sci/sound/audio.cpp
index 123dd21..528bb51 100644
--- a/engines/sci/sound/audio.cpp
+++ b/engines/sci/sound/audio.cpp
@@ -67,7 +67,8 @@ int AudioPlayer::startAudio(uint16 module, uint32 number) {
 
 	if (audioStream) {
 		_wPlayFlag = false;
-		_mixer->playStream(Audio::Mixer::kSpeechSoundType, &_audioHandle, audioStream);
+		Audio::Mixer::SoundType soundType = (module == 65535) ? Audio::Mixer::kSFXSoundType : Audio::Mixer::kSpeechSoundType;
+		_mixer->playStream(soundType, &_audioHandle, audioStream);
 		return sampleLen;
 	} else {
 		// Don't throw a warning in this case. getAudioStream() already has. Some games
diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp
index 1570e36..5d32f40 100644
--- a/engines/sci/sound/soundcmd.cpp
+++ b/engines/sci/sound/soundcmd.cpp
@@ -96,7 +96,7 @@ void SoundCommandParser::initSoundResource(MusicEntry *newSound) {
 		if (_useDigitalSFX || !newSound->soundRes) {
 			int sampleLen;
 			newSound->pStreamAud = _audio->getAudioStream(newSound->resourceId, 65535, &sampleLen);
-			newSound->soundType = Audio::Mixer::kSpeechSoundType;
+			newSound->soundType = Audio::Mixer::kSFXSoundType;
 		}
 	}
 


Commit: 23db3cd9f225d40ff1900dd806630800ecf54aeb
    https://github.com/scummvm/scummvm/commit/23db3cd9f225d40ff1900dd806630800ecf54aeb
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2012-08-19T17:28:02-07:00

Commit Message:
SAGA: Remove incorrect free() in loadShortenFromStream()

This removes a warning and fixes bug #3558052 - "SAGA: use-after-free warning"

Changed paths:
    engines/saga/shorten.cpp



diff --git a/engines/saga/shorten.cpp b/engines/saga/shorten.cpp
index 5efc8d1..69c27b6 100644
--- a/engines/saga/shorten.cpp
+++ b/engines/saga/shorten.cpp
@@ -519,9 +519,6 @@ byte *loadShortenFromStream(Common::ReadStream &stream, int &size, int &rate, by
 	if (maxLPC > 0)
 		free(lpc);
 
-	if (size > 0)
-		free(unpackedBuffer);
-
 	delete gReader;
 	return unpackedBuffer;
 }






More information about the Scummvm-git-logs mailing list