[Scummvm-cvs-logs] scummvm master -> 1d5536da02c20c5c635e02dd19aa38fb3b1128ec

bluegr bluegr at gmail.com
Sun Oct 19 15:53:52 CEST 2014


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:
1d5536da02 SCI: Enable some menus in Jones after restoring (bugs #6537 and #6723)


Commit: 1d5536da02c20c5c635e02dd19aa38fb3b1128ec
    https://github.com/scummvm/scummvm/commit/1d5536da02c20c5c635e02dd19aa38fb3b1128ec
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2014-10-19T16:52:00+03:00

Commit Message:
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.

Changed paths:
    engines/sci/engine/kfile.cpp



diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp
index 61fb717..cb8ba7a 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;
 			}






More information about the Scummvm-git-logs mailing list