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.
This commit is contained in:
Martin Kiewitz 2016-03-02 19:34:40 +01:00
parent 7ee2af4198
commit 8588592947
4 changed files with 12 additions and 2 deletions

View File

@ -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)
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) {

View File

@ -95,6 +95,7 @@ void EngineState::reset(bool isRestoring) {
// reset delayed restore game functionality
_delayedRestoreGame = false;
_delayedRestoreGameId = 0;
_delayedRestoreFromLauncher = false;
executionStackBase = 0;
_executionStackPosChanged = false;

View File

@ -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

View File

@ -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.