[Scummvm-git-logs] scummvm master -> ec9921c63a6c69631f514d8f267333a666481943

athrxx noreply at scummvm.org
Thu Nov 14 18:44:11 UTC 2024


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:
ec9921c63a SCUMM: limit save/load sound driver warning to DOS versions


Commit: ec9921c63a6c69631f514d8f267333a666481943
    https://github.com/scummvm/scummvm/commit/ec9921c63a6c69631f514d8f267333a666481943
Author: athrxx (athrxx at scummvm.org)
Date: 2024-11-14T19:43:44+01:00

Commit Message:
SCUMM: limit save/load sound driver warning to DOS versions

This came up for Mac versions whenever the sound quality setting was
changed. However, the savegames made with different quality settings
are 100% compatible, so that is not an appropriate use for this dialog.

Changed paths:
    engines/scumm/saveload.cpp


diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp
index 78c9c9bf1a9..0425a08d23a 100644
--- a/engines/scumm/saveload.cpp
+++ b/engines/scumm/saveload.cpp
@@ -1927,10 +1927,6 @@ void ScummEngine::saveLoadWithSerializer(Common::Serializer &s) {
 	s.syncArray(_roomVars, _numRoomVariables, Common::Serializer::Sint32LE, VER(38));
 
 	int currentSoundCard = VAR_SOUNDCARD != 0xFF ? VAR(VAR_SOUNDCARD) : -1;
-	bool isMonkey1MacDefaultSoundCardValue =
-		(_game.id == GID_MONKEY &&
-		(_sound->_musicType & MidiDriverFlags::MDT_MACINTOSH) &&
-		currentSoundCard == 0xFFFF);
 
 	// The variables grew from 16 to 32 bit.
 	if (s.getVersion() < VER(15))
@@ -1938,11 +1934,10 @@ void ScummEngine::saveLoadWithSerializer(Common::Serializer &s) {
 	else
 		s.syncArray(_scummVars, _numVariables, Common::Serializer::Sint32LE);
 
-	if (s.isLoading() && VAR_SOUNDCARD != 0xFF && (_game.heversion < 70 && _game.version <= 6)) {
-		if (currentSoundCard != VAR(VAR_SOUNDCARD) && !isMonkey1MacDefaultSoundCardValue) {
-			Common::String soundCards[] = {
+	if (_game.platform == Common::kPlatformDOS && s.isLoading() && VAR_SOUNDCARD != 0xFF && (_game.heversion < 70 && _game.version <= 6)) {
+		if (currentSoundCard != VAR(VAR_SOUNDCARD)) {
+			const char *soundCards[] = {
 				"PC Speaker", "IBM PCjr/Tandy", "Creative Music System", "AdLib", "Roland MT-32/CM-32L"
-				"", "", "", "", "", "", "Macintosh Low Quality Sound", "Macintosh High Quality Sound"
 			};
 			
 			GUI::MessageDialog dialog(
@@ -1950,7 +1945,8 @@ void ScummEngine::saveLoadWithSerializer(Common::Serializer &s) {
 					"Current music device: %s (id %d)\nSave file music device: %s (id %d)\n\n"
 					"Loading will be attempted, but the game may behave incorrectly or crash.\n"
 					"Please change the audio configuration accordingly in order to properly load this save file."),
-					soundCards[currentSoundCard].c_str(), currentSoundCard, soundCards[VAR(VAR_SOUNDCARD)].c_str(), VAR(VAR_SOUNDCARD))
+					currentSoundCard < ARRAYSIZE(soundCards) ? soundCards[currentSoundCard] : "invalid", currentSoundCard,
+					VAR(VAR_SOUNDCARD) < ARRAYSIZE(soundCards) ? soundCards[VAR(VAR_SOUNDCARD)] : "invalid", VAR(VAR_SOUNDCARD))
 			);
 			runDialog(dialog);
 		}




More information about the Scummvm-git-logs mailing list