[Scummvm-git-logs] scummvm master -> 97d3cc093fd904a13ad6c906a4404565c6e88ede

bluegr noreply at scummvm.org
Mon Sep 16 07:21:10 UTC 2024


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

Summary:
2234d2d74f MYST3: Ignore slot 0 when assigning slots to save files
44fc3315a4 MYST3: Convert selected slot to assigned save file
99f3465f68 MYST3: Remove unnecessary dummy autosave from Save List
97d3cc093f MYST3: Use English default if autosave name is invalid


Commit: 2234d2d74f2ea78c764a2deae7ced71bc3b45c59
    https://github.com/scummvm/scummvm/commit/2234d2d74f2ea78c764a2deae7ced71bc3b45c59
Author: macca8 (brubask6 at yahoo.com)
Date: 2024-09-16T10:21:06+03:00

Commit Message:
MYST3: Ignore slot 0 when assigning slots to save files

Changed paths:
    engines/myst3/metaengine.cpp


diff --git a/engines/myst3/metaengine.cpp b/engines/myst3/metaengine.cpp
index 69e4b65747e..7e73959834e 100644
--- a/engines/myst3/metaengine.cpp
+++ b/engines/myst3/metaengine.cpp
@@ -75,7 +75,9 @@ public:
 
 		SaveStateList saveList;
 		for (uint32 i = 0; i < filenames.size(); i++)
-			saveList.push_back(SaveStateDescriptor(this, i, filenames[i]));
+			// Since slots are ignored when saving, we always return slot 0
+			// as an unused slot to optimise the autosave process
+			saveList.push_back(SaveStateDescriptor(this, i + 1, filenames[i]));
 
 		return saveList;
 	}


Commit: 44fc3315a4461c1a98a50b53f333ccb182034dfa
    https://github.com/scummvm/scummvm/commit/44fc3315a4461c1a98a50b53f333ccb182034dfa
Author: macca8 (brubask6 at yahoo.com)
Date: 2024-09-16T10:21:06+03:00

Commit Message:
MYST3: Convert selected slot to assigned save file

Changed paths:
    engines/myst3/myst3.cpp


diff --git a/engines/myst3/myst3.cpp b/engines/myst3/myst3.cpp
index 061048b0393..9a171652e81 100644
--- a/engines/myst3/myst3.cpp
+++ b/engines/myst3/myst3.cpp
@@ -1513,7 +1513,15 @@ bool Myst3Engine::canLoadGameStateCurrently(Common::U32String *msg) {
 
 Common::Error Myst3Engine::loadGameState(int slot) {
 	Common::StringArray filenames = Saves::list(_saveFileMan, getPlatform());
-	return loadGameState(filenames[slot], kTransitionNone);
+
+	// Slots are assigned consecutively, starting from slot 1
+	// Get the Save List index for the selected slot
+	int listIndex = (slot == 0) ? slot : slot - 1;
+	if (!listIndex < filenames.size()) {
+		return Common::kReadingFailed;
+	}
+
+	return loadGameState(filenames[listIndex], kTransitionNone);
 }
 
 Common::Error Myst3Engine::loadGameState(Common::String fileName, TransitionType transition) {


Commit: 99f3465f68082b13501220d62692c8ca47c87510
    https://github.com/scummvm/scummvm/commit/99f3465f68082b13501220d62692c8ca47c87510
Author: macca8 (brubask6 at yahoo.com)
Date: 2024-09-16T10:21:06+03:00

Commit Message:
MYST3: Remove unnecessary dummy autosave from Save List

Changed paths:
    engines/myst3/state.cpp


diff --git a/engines/myst3/state.cpp b/engines/myst3/state.cpp
index f9f0196ee0c..281605fe302 100644
--- a/engines/myst3/state.cpp
+++ b/engines/myst3/state.cpp
@@ -840,12 +840,6 @@ Common::StringArray Saves::list(Common::SaveFileManager *saveFileManager, Common
 	// The saves are sorted alphabetically
 	Common::sort(filenames.begin(), filenames.end(), AutosaveFirstComparator());
 
-	// The MetaEngine save system expects the Autosave to be in slot 0
-	// if we don't have an autosave (yet), insert a fake one.
-	if (!filenames.empty() && !filenames[0].hasPrefixIgnoreCase("autosave.")) {
-		filenames.insert_at(0, buildName("Autosave", platform));
-	}
-
 	return filenames;
 }
 


Commit: 97d3cc093fd904a13ad6c906a4404565c6e88ede
    https://github.com/scummvm/scummvm/commit/97d3cc093fd904a13ad6c906a4404565c6e88ede
Author: macca8 (brubask6 at yahoo.com)
Date: 2024-09-16T10:21:06+03:00

Commit Message:
MYST3: Use English default if autosave name is invalid

Changed paths:
    engines/myst3/myst3.cpp


diff --git a/engines/myst3/myst3.cpp b/engines/myst3/myst3.cpp
index 9a171652e81..60d2f3073b8 100644
--- a/engines/myst3/myst3.cpp
+++ b/engines/myst3/myst3.cpp
@@ -1581,8 +1581,14 @@ static bool isValidSaveFileName(const Common::String &desc) {
 Common::Error Myst3Engine::saveGameState(int slot, const Common::String &desc, bool isAutosave) {
 	assert(!desc.empty());
 
+	Common::String saveName = desc;
 	if (!isValidSaveFileName(desc)) {
-		return Common::Error(Common::kCreatingFileFailed, _("Invalid file name for saving"));
+		if (isAutosave) {
+			// Fall back to the expected English translation
+			saveName = "Autosave";
+		} else {
+			return Common::Error(Common::kCreatingFileFailed, _("Invalid file name for saving"));
+		}
 	}
 
 	// If autosaving, get a fresh thumbnail of the game screen
@@ -1593,7 +1599,7 @@ Common::Error Myst3Engine::saveGameState(int slot, const Common::String &desc, b
 	const Graphics::Surface *thumbnail = _menu->borrowSaveThumbnail();
 	assert(thumbnail);
 
-	return saveGameState(desc, thumbnail, isAutosave);
+	return saveGameState(saveName, thumbnail, isAutosave);
 }
 
 Common::Error Myst3Engine::saveGameState(const Common::String &desc, const Graphics::Surface *thumbnail, bool isAutosave) {




More information about the Scummvm-git-logs mailing list