diff options
author | Filippos Karapetis | 2014-10-19 16:52:00 +0300 |
---|---|---|
committer | Filippos Karapetis | 2014-10-19 16:52:00 +0300 |
commit | 1d5536da02c20c5c635e02dd19aa38fb3b1128ec (patch) | |
tree | 9935bba0cd7261ed2abba98d82d5c1a8ca6f6304 /engines/sci | |
parent | e06327e81aee35b9a523122637f79c9d0530c0bc (diff) | |
download | scummvm-rg350-1d5536da02c20c5c635e02dd19aa38fb3b1128ec.tar.gz scummvm-rg350-1d5536da02c20c5c635e02dd19aa38fb3b1128ec.tar.bz2 scummvm-rg350-1d5536da02c20c5c635e02dd19aa38fb3b1128ec.zip |
SCI: Enable some menus in Jones after restoring (bugs #6537 and #6723)
The code path that is supposed to enable these never gets called when
restoring from the main menu, or from the ScummVM launcher. Since the
logic on when and what to enable is quite complex, the easiest thing
to do is enable these entries manually after a game is loaded.
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/engine/kfile.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp index 61fb717567..cb8ba7a565 100644 --- a/engines/sci/engine/kfile.cpp +++ b/engines/sci/engine/kfile.cpp @@ -37,6 +37,7 @@ #include "sci/engine/state.h" #include "sci/engine/kernel.h" #include "sci/engine/savegame.h" +#include "sci/graphics/menu.h" #include "sci/sound/audio.h" #include "sci/console.h" @@ -913,6 +914,23 @@ reg_t kRestoreGame(EngineState *s, int argc, reg_t *argv) { // code concerning this via script patch. s->variables[VAR_GLOBAL][0xB3].setOffset(SAVEGAMEID_OFFICIALRANGE_START + savegameId); break; + case GID_JONES: + // HACK: The code that enables certain menu items isn't called when a game is restored from the + // launcher, or the "Restore game" option in the game's main menu - bugs #6537 and #6723. + // These menu entries are disabled when the game is launched, and are enabled when a new game is + // started. The code for enabling these entries is is all in script 1, room1::init, but that code + // path is never followed in these two cases (restoring game from the menu, or restoring a game + // from the ScummVM launcher). Thus, we perform the calls to enable the menus ourselves here. + // These two are needed when restoring from the launcher + g_sci->_gfxMenu->kernelSetAttribute(257 >> 8, 257 & 0xFF, SCI_MENU_ATTRIBUTE_ENABLED, TRUE_REG); // Sierra -> About Jones + g_sci->_gfxMenu->kernelSetAttribute(258 >> 8, 258 & 0xFF, SCI_MENU_ATTRIBUTE_ENABLED, TRUE_REG); // Sierra -> Help + // The rest are normally enabled from room1::init + g_sci->_gfxMenu->kernelSetAttribute(769 >> 8, 769 & 0xFF, SCI_MENU_ATTRIBUTE_ENABLED, TRUE_REG); // Options -> Delete current player + g_sci->_gfxMenu->kernelSetAttribute(513 >> 8, 513 & 0xFF, SCI_MENU_ATTRIBUTE_ENABLED, TRUE_REG); // Game -> Save Game + g_sci->_gfxMenu->kernelSetAttribute(515 >> 8, 515 & 0xFF, SCI_MENU_ATTRIBUTE_ENABLED, TRUE_REG); // Game -> Restore Game + g_sci->_gfxMenu->kernelSetAttribute(1025 >> 8, 1025 & 0xFF, SCI_MENU_ATTRIBUTE_ENABLED, TRUE_REG); // Status -> Statistics + g_sci->_gfxMenu->kernelSetAttribute(1026 >> 8, 1026 & 0xFF, SCI_MENU_ATTRIBUTE_ENABLED, TRUE_REG); // Status -> Goals + break; default: break; } |