[Scummvm-git-logs] scummvm master -> 41e1053898c771355179a2960cb405365407c429

bluegr bluegr at gmail.com
Sat Mar 21 16:38:16 UTC 2020


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

Summary:
41dbcb6e64 SCI: Remove dead code
41e1053898 SCI: Stop any currently playing audio when loading. Fixes bug #9953.


Commit: 41dbcb6e6443cd3e1b25cc1d31d1967761f56920
    https://github.com/scummvm/scummvm/commit/41dbcb6e6443cd3e1b25cc1d31d1967761f56920
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2020-03-21T18:35:27+02:00

Commit Message:
SCI: Remove dead code

Changed paths:
    engines/sci/engine/ksound.cpp


diff --git a/engines/sci/engine/ksound.cpp b/engines/sci/engine/ksound.cpp
index 62fbf13ef0..4c8e9759ac 100644
--- a/engines/sci/engine/ksound.cpp
+++ b/engines/sci/engine/ksound.cpp
@@ -188,14 +188,6 @@ reg_t kDoAudio(EngineState *s, int argc, reg_t *argv) {
 			         ((argv[3].toUint16() & 0xff) << 16) |
 			         ((argv[4].toUint16() & 0xff) <<  8) |
 			          (argv[5].toUint16() & 0xff);
-			// Removed warning because of the high amount of console spam
-			/*if (argc == 8) {
-				// TODO: Handle the extra 2 SCI21 params
-				// argv[6] is always 1
-				// argv[7] is the contents of global 229 (0xE5)
-				warning("kDoAudio: Play called with SCI2.1 extra parameters: %04x:%04x and %04x:%04x",
-						PRINT_REG(argv[6]), PRINT_REG(argv[7]));
-			}*/
 		} else {
 			warning("kDoAudio: Play called with an unknown number of parameters (%d)", argc);
 			return NULL_REG;
@@ -293,7 +285,6 @@ reg_t kDoAudio(EngineState *s, int argc, reg_t *argv) {
 		// more explicit.
 
 		return make_reg(0, 1);
-		break;
 	case 13:
 		// SSCI returns a serial number for the played audio
 		// here, used in the PointsSound class. The reason is severalfold:
@@ -308,7 +299,6 @@ reg_t kDoAudio(EngineState *s, int argc, reg_t *argv) {
 		// return a constant here. This is equivalent to the
 		// old behavior, as above.
 		return make_reg(0, 1);
-		break;
 	case 17:
 		// Seems to be some sort of audio sync, used in SQ6. Silenced the
 		// warning due to the high level of spam it produces. (takes no params)


Commit: 41e1053898c771355179a2960cb405365407c429
    https://github.com/scummvm/scummvm/commit/41e1053898c771355179a2960cb405365407c429
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2020-03-21T18:35:27+02:00

Commit Message:
SCI: Stop any currently playing audio when loading. Fixes bug #9953.

Loading is not normally allowed while audio is being played in SCI games.
Stopping sounds is needed in ScummVM, as the player may load via
Control-F5 at any point, even while a sound is playing.

Changed paths:
    engines/sci/engine/savegame.cpp


diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp
index f945097f8c..b9cd58581a 100644
--- a/engines/sci/engine/savegame.cpp
+++ b/engines/sci/engine/savegame.cpp
@@ -433,16 +433,31 @@ void EngineState::saveLoadWithSerializer(Common::Serializer &s) {
 
 	g_sci->_soundCmd->syncPlayList(s);
 
-#ifdef ENABLE_SCI32
 	if (getSciVersion() >= SCI_VERSION_2) {
+#ifdef ENABLE_SCI32
 		g_sci->_gfxPalette32->saveLoadWithSerializer(s);
 		g_sci->_gfxRemap32->saveLoadWithSerializer(s);
 		g_sci->_gfxCursor32->saveLoadWithSerializer(s);
 		g_sci->_audio32->saveLoadWithSerializer(s);
 		g_sci->_video32->saveLoadWithSerializer(s);
-	} else
 #endif
+	} else {
 		g_sci->_gfxPalette16->saveLoadWithSerializer(s);
+	}
+
+	// Stop any currently playing audio when loading.
+	// Loading is not normally allowed while audio is being played in SCI games.
+	// Stopping sounds is needed in ScummVM, as the player may load via
+	// Control - F5 at any point, even while a sound is playing.
+	if (s.isLoading()) {
+		if (getSciVersion() >= SCI_VERSION_2) {
+#ifdef ENABLE_SCI32
+			g_sci->_audio32->stop(kAllChannels);
+#endif
+		} else {
+			g_sci->_audio->stopAllAudio();
+		}
+	}
 }
 
 void Vocabulary::saveLoadWithSerializer(Common::Serializer &s) {




More information about the Scummvm-git-logs mailing list