[Scummvm-git-logs] scummvm master -> 69b2acfe05aa0073e36273c0be65bc74b5cc26a0

dreammaster noreply at scummvm.org
Mon Dec 27 02:45:03 UTC 2021


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:
69b2acfe05 SHERLOCK: Creates an autosave immediately when the game first starts


Commit: 69b2acfe05aa0073e36273c0be65bc74b5cc26a0
    https://github.com/scummvm/scummvm/commit/69b2acfe05aa0073e36273c0be65bc74b5cc26a0
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2021-12-26T18:44:48-08:00

Commit Message:
SHERLOCK: Creates an autosave immediately when the game first starts

Changed paths:
    engines/sherlock/sherlock.cpp
    engines/sherlock/sherlock.h


diff --git a/engines/sherlock/sherlock.cpp b/engines/sherlock/sherlock.cpp
index 485e0c83f9d..07ea8f9378e 100644
--- a/engines/sherlock/sherlock.cpp
+++ b/engines/sherlock/sherlock.cpp
@@ -51,6 +51,7 @@ SherlockEngine::SherlockEngine(OSystem *syst, const SherlockGameDescription *gam
 	_showOriginalSavesDialog = false;
 	_interactiveFl = true;
 	_isScreenDoubled = false;
+	_startupAutosave = false;
 }
 
 SherlockEngine::~SherlockEngine() {
@@ -135,6 +136,9 @@ Common::Error SherlockEngine::run() {
 		do {
 			showOpening();
 		} while (!shouldQuit() && !_interactiveFl);
+
+		// Signal startup autosave
+		_startupAutosave = true;
 	}
 
 	while (!shouldQuit()) {
@@ -178,6 +182,15 @@ void SherlockEngine::sceneLoop() {
 		if (_people->_savedPos.x == -1) {
 			_canLoadSave = true;
 			_scene->doBgAnim();
+
+			if (_startupAutosave) {
+				// When the game is first started, create an autosave.
+				// This helps with the save dialog to prevent users
+				// accidentally saving in the autosave slot
+				_startupAutosave = false;
+				saveAutosaveIfEnabled();
+			}
+
 			_canLoadSave = false;
 		}
 	}
diff --git a/engines/sherlock/sherlock.h b/engines/sherlock/sherlock.h
index 6e349346ec6..2ba9acbf360 100644
--- a/engines/sherlock/sherlock.h
+++ b/engines/sherlock/sherlock.h
@@ -75,7 +75,6 @@ class Resource;
 
 class SherlockEngine : public Engine {
 private:
-\
 	/**
 	 * Main loop for displaying a scene and handling all that occurs within it
 	 */
@@ -130,6 +129,7 @@ public:
 	bool _showOriginalSavesDialog;
 	bool _interactiveFl;
 	bool _isScreenDoubled;
+	bool _startupAutosave;
 public:
 	SherlockEngine(OSystem *syst, const SherlockGameDescription *gameDesc);
 	~SherlockEngine() override;




More information about the Scummvm-git-logs mailing list