[Scummvm-cvs-logs] scummvm master -> 858859294733f080ea2902469dfd392635464a21

m-kiewitz m_kiewitz at users.sourceforge.net
Wed Mar 2 19:34:10 CET 2016


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:
8588592947 SCI32: Don't do a syncWithScripts on restore from launcher


Commit: 858859294733f080ea2902469dfd392635464a21
    https://github.com/scummvm/scummvm/commit/858859294733f080ea2902469dfd392635464a21
Author: Martin Kiewitz (m_kiewitz at users.sourceforge.net)
Date: 2016-03-02T19:34:40+01:00

Commit Message:
SCI32: Don't do a syncWithScripts on restore from launcher

Causes issues in at least gk1 (option + inventory plane are shown)
Game::restore is not called, when doing restores from launcher,
so in the original interpreter this script code wasn't called
either.

Fixes option + inventory planes etc. being shown right after
restoring via launcher, when original save/load dialogs were
disabled.

Changed paths:
    engines/sci/engine/savegame.cpp
    engines/sci/engine/state.cpp
    engines/sci/engine/state.h
    engines/sci/sci.cpp



diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp
index 18cee33..ae7ab43 100644
--- a/engines/sci/engine/savegame.cpp
+++ b/engines/sci/engine/savegame.cpp
@@ -1081,8 +1081,13 @@ void gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) {
 	// We MUST NOT delete all planes/screen items. At least Space Quest 6 has a few in memory like for example
 	// the options plane, which are not re-added and are in memory all the time right from the start of the
 	// game. Sierra SCI32 did not clear planes, only scripts cleared the ones inside planes::elements.
-	if (getSciVersion() >= SCI_VERSION_2)
-		g_sci->_gfxFrameout->syncWithScripts(false);
+	if (getSciVersion() >= SCI_VERSION_2) {
+		if (!s->_delayedRestoreFromLauncher) {
+			// Only do it, when we are restoring regulary and not from launcher
+			// As it could result in option planes etc. on the screen (happens in gk1)
+			g_sci->_gfxFrameout->syncWithScripts(false);
+		}
+	}
 #endif
 
 	s->reset(true);
@@ -1131,6 +1136,8 @@ void gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) {
 
 	// signal restored game to game scripts
 	s->gameIsRestarting = GAMEISRESTARTING_RESTORE;
+
+	s->_delayedRestoreFromLauncher = false;
 }
 
 bool get_savegame_metadata(Common::SeekableReadStream *stream, SavegameMetadata *meta) {
diff --git a/engines/sci/engine/state.cpp b/engines/sci/engine/state.cpp
index d53e6b4..fda7831 100644
--- a/engines/sci/engine/state.cpp
+++ b/engines/sci/engine/state.cpp
@@ -95,6 +95,7 @@ void EngineState::reset(bool isRestoring) {
 	// reset delayed restore game functionality
 	_delayedRestoreGame = false;
 	_delayedRestoreGameId = 0;
+	_delayedRestoreFromLauncher = false;
 
 	executionStackBase = 0;
 	_executionStackPosChanged = false;
diff --git a/engines/sci/engine/state.h b/engines/sci/engine/state.h
index 0f04e32..6efc56e 100644
--- a/engines/sci/engine/state.h
+++ b/engines/sci/engine/state.h
@@ -138,6 +138,7 @@ public:
 	// see detection.cpp / SciEngine::loadGameState()
 	bool _delayedRestoreGame;  // boolean, that triggers delayed restore (triggered by ScummVM menu)
 	int _delayedRestoreGameId; // the saved game id, that it supposed to get restored (triggered by ScummVM menu)
+	bool _delayedRestoreFromLauncher; // is set, when the the delayed restore game was triggered from launcher
 
 	uint _chosenQfGImportItem; // Remembers the item selected in QfG import rooms
 
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index 6d36fab..52188db 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -316,6 +316,7 @@ Common::Error SciEngine::run() {
 	if (directSaveSlotLoading >= 0) {
 		_gamestate->_delayedRestoreGame = true;
 		_gamestate->_delayedRestoreGameId = directSaveSlotLoading;
+		_gamestate->_delayedRestoreFromLauncher = true;
 
 		// Jones only initializes its menus when restarting/restoring, thus set
 		// the gameIsRestarting flag here before initializing. Fixes bug #6536.






More information about the Scummvm-git-logs mailing list