[Scummvm-git-logs] scummvm master -> 9bcda8ee1beb4a7c47e0f5c69157f5652c630bfa

NMIError noreply at scummvm.org
Fri Nov 19 20:06:48 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:
9bcda8ee1b GROOVIE: Fix intro music and move autosave slot


Commit: 9bcda8ee1beb4a7c47e0f5c69157f5652c630bfa
    https://github.com/scummvm/scummvm/commit/9bcda8ee1beb4a7c47e0f5c69157f5652c630bfa
Author: Coen Rampen (crampen at gmail.com)
Date: 2021-11-19T21:06:43+01:00

Commit Message:
GROOVIE: Fix intro music and move autosave slot

This commit fixes problems with commit acad766 which disabled the open house
savegame in The 7th Guest and The 11th Hour. These games use slot 0 to write a
special savegame when the game has been completed. This conflicts with ScummVM
autosave functionality, which also uses slot 0 by default. To fix this, the
autosave slot has been moved to slot 24, the last available save slot. The
workaround from commit acad766 for saving in slot 0 has been removed.
The intro music is now fixed by checking for a load of slot 0 and not stopping
the music in this case.

Changed paths:
    engines/groovie/groovie.cpp
    engines/groovie/groovie.h
    engines/groovie/metaengine.cpp
    engines/groovie/script.cpp


diff --git a/engines/groovie/groovie.cpp b/engines/groovie/groovie.cpp
index 11d36261de..d70c70e049 100644
--- a/engines/groovie/groovie.cpp
+++ b/engines/groovie/groovie.cpp
@@ -48,6 +48,8 @@
 
 namespace Groovie {
 
+const int GroovieEngine::AUTOSAVE_SLOT = MAX_SAVES - 1;
+
 GroovieEngine::GroovieEngine(OSystem *syst, const GroovieGameDescription *gd) :
 	Engine(syst), _gameDescription(gd), _script(nullptr),
 	_resMan(nullptr), _grvCursorMan(nullptr), _videoPlayer(nullptr), _musicPlayer(nullptr),
@@ -408,6 +410,10 @@ Common::Error GroovieEngine::saveGameState(int slot, const Common::String &desc,
 	return Common::kNoError;
 }
 
+int GroovieEngine::getAutosaveSlot() const {
+	return AUTOSAVE_SLOT;
+}
+
 void GroovieEngine::waitForInput() {
 	_waitingForInput = true;
 }
diff --git a/engines/groovie/groovie.h b/engines/groovie/groovie.h
index 77b546e2db..f52c162389 100644
--- a/engines/groovie/groovie.h
+++ b/engines/groovie/groovie.h
@@ -113,12 +113,16 @@ protected:
 
 class GroovieEngine : public Engine {
 public:
+	static const int AUTOSAVE_SLOT;
+
 	GroovieEngine(OSystem *syst, const GroovieGameDescription *gd);
 	~GroovieEngine() override;
 
 	Common::Platform getPlatform() const;
 	EngineVersion getEngineVersion() const;
 
+	int getAutosaveSlot() const override;
+
 protected:
 
 	// Engine APIs
diff --git a/engines/groovie/metaengine.cpp b/engines/groovie/metaengine.cpp
index 4c3453f0b9..21778ef5d1 100644
--- a/engines/groovie/metaengine.cpp
+++ b/engines/groovie/metaengine.cpp
@@ -44,6 +44,7 @@ public:
 	int getMaximumSaveSlot() const override;
 	void removeSaveState(const char *target, int slot) const override;
 	SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const override;
+	int getAutosaveSlot() const override;
 };
 
 Common::Error GroovieMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *gd) const {
@@ -92,6 +93,10 @@ SaveStateDescriptor GroovieMetaEngine::querySaveMetaInfos(const char *target, in
 	return desc;
 }
 
+int GroovieMetaEngine::getAutosaveSlot() const {
+	return GroovieEngine::AUTOSAVE_SLOT;
+}
+
 } // End of namespace Groovie
 
 #if PLUGIN_ENABLED_DYNAMIC(GROOVIE)
diff --git a/engines/groovie/script.cpp b/engines/groovie/script.cpp
index 543c7e80f4..0f7a524841 100644
--- a/engines/groovie/script.cpp
+++ b/engines/groovie/script.cpp
@@ -244,14 +244,7 @@ void Script::directGameLoad(int slot) {
 			midiInitScriptSize = sizeof(t7gMidiInitScript);
 		}
 	} else if (_version == kGroovieT11H) {
-		// WORKAROUND Slot 0 is sometimes loaded by scripts (f.e. showing the
-		// load/restart dialog during the intro). The intention is not clear to
-		// me, but it is not for loading a savegame (only slots 1-9 can be used
-		// in the original UI). In order to be able to distinguish this case
-		// from the case where the slot 0 savegame is loaded from the ScummVM
-		// UI, the slot variable is set to 0xFF here. This means that the slot
-		// 0 savegame should actually be loaded.
-		setVariable(0xF, slot == 0 ? 0xFF : slot);
+		setVariable(0xF, slot);
 		_currentInstruction = 0xE78D;
 		return;
 	} else if (_version == kGroovieCDY) {
@@ -482,24 +475,11 @@ bool Script::hotspot(Common::Rect rect, uint16 address, uint8 cursor) {
 }
 
 void Script::loadgame(uint slot) {
-	// WORKAROUND The game scripts sometimes call loadgame with slot 0 (f.e.
-	// during the intro when showing the load/restart dialog). The meaning of
-	// this is not clear to me, but it is not for loading a savegame, because
-	// only slots 1-9 are usable with the original UI.
-	// In case slot 0 is loaded from the ScummVM UI, the slot parameter has
-	// been set to 0xFF.
-	if (_vm->getEngineVersion() == kGroovieT11H) {
-		if (slot == 0) {
-			// Loadgame slot 0 has been called by the game scripts.
-			// TODO Figure out if anything needs to be done.
-			return;
-		} else if (slot == 0xFF) {
-			// Slot 0 has been loaded from the ScummVM UI.
-			slot = 0;
-		}
-	}
-
-	_vm->_musicPlayer->stop();
+	// The 11th Hour uses slot 0 for the Open House savegame. It loads this
+	// savegame before showing the load/restart dialog during the intro. The
+	// music should not be stopped in this case.
+	if (!(_vm->getEngineVersion() == kGroovieT11H && slot == 0))
+		_vm->_musicPlayer->stop();
 
 	Common::InSaveFile *file = SaveLoad::openForLoading(ConfMan.getActiveDomainName(), slot);
 




More information about the Scummvm-git-logs mailing list