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

sluicebox 22204938+sluicebox at users.noreply.github.com
Tue Apr 21 19:13:03 UTC 2020


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:
b57c205e30 SCI: Add support for QFG3 automatic saves


Commit: b57c205e30f99a2a595a452c6952aa267304f539
    https://github.com/scummvm/scummvm/commit/b57c205e30f99a2a595a452c6952aa267304f539
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2020-04-21T12:10:09-07:00

Commit Message:
SCI: Add support for QFG3 automatic saves

Fixes bug #11421

Changed paths:
    engines/sci/engine/file.cpp
    engines/sci/engine/guest_additions.cpp
    engines/sci/engine/kfile.cpp


diff --git a/engines/sci/engine/file.cpp b/engines/sci/engine/file.cpp
index e1b727c521..96aa46b877 100644
--- a/engines/sci/engine/file.cpp
+++ b/engines/sci/engine/file.cpp
@@ -348,16 +348,15 @@ void listSavegames(Common::Array<SavegameDesc> &saves) {
 	for (Common::StringArray::const_iterator iter = saveNames.begin(); iter != saveNames.end(); ++iter) {
 		const Common::String &filename = *iter;
 
-#ifdef ENABLE_SCI32
-		// exclude new game and autosave slots, except for QFG4,
+		// exclude new game and autosave slots, except for QFG3/4,
 		//  whose autosave should appear as a normal saved game
-		if (g_sci->getGameId() != GID_QFG4) {
+		if (g_sci->getGameId() != GID_QFG3 && 
+			g_sci->getGameId() != GID_QFG4) {
 			const int id = strtol(filename.end() - 3, NULL, 10);
 			if (id == kNewGameId || id == kAutoSaveId) {
 				continue;
 			}
 		}
-#endif
 
 		SavegameDesc desc;
 		if (fillSavegameDesc(filename, desc)) {
diff --git a/engines/sci/engine/guest_additions.cpp b/engines/sci/engine/guest_additions.cpp
index 603afe6d26..0e26ee0c3c 100644
--- a/engines/sci/engine/guest_additions.cpp
+++ b/engines/sci/engine/guest_additions.cpp
@@ -403,7 +403,8 @@ void GuestAdditions::patchGameSaveRestoreSCI16() const {
 		uint16 selectorId = patchObjectSave->getFuncSelector(methodNr);
 		Common::String methodName = _kernel->getSelectorName(selectorId);
 		if (methodName == "save") {
-			if (g_sci->getGameId() != GID_FAIRYTALES) {	// Fairy Tales saves automatically without a dialog
+			if (g_sci->getGameId() != GID_FAIRYTALES &&  // Fairy Tales saves automatically without a dialog
+				g_sci->getGameId() != GID_QFG3) { // QFG3 does automatic saving in Glory:save
 					patchKSaveRestore(_segMan, patchObjectSave->getFunction(methodNr), kernelIdSave);
 			}
 			break;
diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp
index 7d36cdcd7c..3a60d64078 100644
--- a/engines/sci/engine/kfile.cpp
+++ b/engines/sci/engine/kfile.cpp
@@ -1105,6 +1105,20 @@ reg_t kSaveGame(EngineState *s, int argc, reg_t *argv) {
 				// Jones has one save slot only
 				savegameId = 0;
 				break;
+			case GID_QFG3: {
+				// Auto-save system used by QFG3
+				reg_t autoSaveNameId;
+				SciArray &autoSaveName = *s->_segMan->allocateArray(kArrayTypeString, kMaxSaveNameLength, &autoSaveNameId);
+				MessageTuple autoSaveNameTuple(0, 0, 16, 1);
+				s->_msgState->getMessage(0, autoSaveNameTuple, autoSaveNameId);
+
+				if (game_description == autoSaveName.toString()) {
+					savegameId = kAutoSaveId;
+				}
+
+				s->_segMan->freeArray(autoSaveNameId);
+				break;
+			}
 			case GID_FANMADE: {
 				// Fanmade game, try to identify the game
 				const char *gameName = g_sci->getGameObjectName();




More information about the Scummvm-git-logs mailing list