mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-15 06:08:35 +00:00
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:
parent
7ee2af4198
commit
8588592947
@ -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
|
// 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
|
// 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.
|
// 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) {
|
||||||
g_sci->_gfxFrameout->syncWithScripts(false);
|
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
|
#endif
|
||||||
|
|
||||||
s->reset(true);
|
s->reset(true);
|
||||||
@ -1131,6 +1136,8 @@ void gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) {
|
|||||||
|
|
||||||
// signal restored game to game scripts
|
// signal restored game to game scripts
|
||||||
s->gameIsRestarting = GAMEISRESTARTING_RESTORE;
|
s->gameIsRestarting = GAMEISRESTARTING_RESTORE;
|
||||||
|
|
||||||
|
s->_delayedRestoreFromLauncher = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool get_savegame_metadata(Common::SeekableReadStream *stream, SavegameMetadata *meta) {
|
bool get_savegame_metadata(Common::SeekableReadStream *stream, SavegameMetadata *meta) {
|
||||||
|
@ -95,6 +95,7 @@ void EngineState::reset(bool isRestoring) {
|
|||||||
// reset delayed restore game functionality
|
// reset delayed restore game functionality
|
||||||
_delayedRestoreGame = false;
|
_delayedRestoreGame = false;
|
||||||
_delayedRestoreGameId = 0;
|
_delayedRestoreGameId = 0;
|
||||||
|
_delayedRestoreFromLauncher = false;
|
||||||
|
|
||||||
executionStackBase = 0;
|
executionStackBase = 0;
|
||||||
_executionStackPosChanged = false;
|
_executionStackPosChanged = false;
|
||||||
|
@ -138,6 +138,7 @@ public:
|
|||||||
// see detection.cpp / SciEngine::loadGameState()
|
// see detection.cpp / SciEngine::loadGameState()
|
||||||
bool _delayedRestoreGame; // boolean, that triggers delayed restore (triggered by ScummVM menu)
|
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)
|
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
|
uint _chosenQfGImportItem; // Remembers the item selected in QfG import rooms
|
||||||
|
|
||||||
|
@ -316,6 +316,7 @@ Common::Error SciEngine::run() {
|
|||||||
if (directSaveSlotLoading >= 0) {
|
if (directSaveSlotLoading >= 0) {
|
||||||
_gamestate->_delayedRestoreGame = true;
|
_gamestate->_delayedRestoreGame = true;
|
||||||
_gamestate->_delayedRestoreGameId = directSaveSlotLoading;
|
_gamestate->_delayedRestoreGameId = directSaveSlotLoading;
|
||||||
|
_gamestate->_delayedRestoreFromLauncher = true;
|
||||||
|
|
||||||
// Jones only initializes its menus when restarting/restoring, thus set
|
// Jones only initializes its menus when restarting/restoring, thus set
|
||||||
// the gameIsRestarting flag here before initializing. Fixes bug #6536.
|
// the gameIsRestarting flag here before initializing. Fixes bug #6536.
|
||||||
|
Loading…
Reference in New Issue
Block a user