aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorMartin Kiewitz2010-02-01 09:53:42 +0000
committerMartin Kiewitz2010-02-01 09:53:42 +0000
commit845c245ff37fc5f269a26a6f57eb55e66b6f1530 (patch)
tree9dfd49dd69e8086aefc230d6a1e1c4135f13fee5 /engines/sci/engine
parentc72c2ff71109544ca48d2cfabf1ff735363795c3 (diff)
downloadscummvm-rg350-845c245ff37fc5f269a26a6f57eb55e66b6f1530.tar.gz
scummvm-rg350-845c245ff37fc5f269a26a6f57eb55e66b6f1530.tar.bz2
scummvm-rg350-845c245ff37fc5f269a26a6f57eb55e66b6f1530.zip
SCI: class menu renamed to GfxMenu - now getting called directly, also fix for loading savedgames
svn-id: r47792
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/kmenu.cpp9
-rw-r--r--engines/sci/engine/savegame.cpp8
-rw-r--r--engines/sci/engine/state.h3
3 files changed, 15 insertions, 5 deletions
diff --git a/engines/sci/engine/kmenu.cpp b/engines/sci/engine/kmenu.cpp
index 90cd2adbe9..2f08e63e63 100644
--- a/engines/sci/engine/kmenu.cpp
+++ b/engines/sci/engine/kmenu.cpp
@@ -29,6 +29,7 @@
#include "sci/engine/kernel.h"
#include "sci/graphics/gui.h"
#include "sci/graphics/cursor.h"
+#include "sci/graphics/menu.h"
namespace Sci {
@@ -36,7 +37,7 @@ reg_t kAddMenu(EngineState *s, int argc, reg_t *argv) {
Common::String title = s->strSplit(s->_segMan->getString(argv[0]).c_str());
Common::String content = s->_segMan->getString(argv[1]);
- s->_gui->menuAdd(title, content, argv[1]);
+ s->_gfxMenu->kernelAddEntry(title, content, argv[1]);
return s->r_acc;
}
@@ -51,7 +52,7 @@ reg_t kSetMenu(EngineState *s, int argc, reg_t *argv) {
attributeId = argv[argPos].toUint16();
if ((argPos + 1) >= argc)
error("Too few parameters for kSetMenu");
- s->_gui->menuSet(menuId, itemId, attributeId, argv[argPos + 1]);
+ s->_gfxMenu->kernelSetAttribute(menuId, itemId, attributeId, argv[argPos + 1]);
argPos += 2;
}
return s->r_acc;
@@ -62,7 +63,7 @@ reg_t kGetMenu(EngineState *s, int argc, reg_t *argv) {
uint16 itemId = argv[0].toUint16() & 0xFF;
uint16 attributeId = argv[1].toUint16();
- return s->_gui->menuGet(menuId, itemId, attributeId);
+ return s->_gfxMenu->kernelGetAttribute(menuId, itemId, attributeId);
}
@@ -93,7 +94,7 @@ reg_t kMenuSelect(EngineState *s, int argc, reg_t *argv) {
//bool pauseSound = argc > 1 ? (argv[1].isNull() ? false : true) : false;
// TODO: pauseSound implementation
- return s->_gui->menuSelect(eventObject);
+ return s->_gfxMenu->kernelSelect(eventObject);
}
} // End of namespace Sci
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp
index 9d36914c4a..00b3fcf242 100644
--- a/engines/sci/engine/savegame.cpp
+++ b/engines/sci/engine/savegame.cpp
@@ -943,6 +943,14 @@ void gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) {
// Create a new EngineState object
retval = new EngineState(s->resMan, s->_kernel, s->_voc, s->_segMan, s->_gui, s->_audio);
retval->_event = new SciEvent();
+
+ retval->_gfxAnimate = s->_gfxAnimate;
+ retval->_gfxCache = s->_gfxCache;
+ retval->_gfxControls = s->_gfxControls;
+ retval->_gfxMenu = s->_gfxMenu;
+ retval->_gfxPalette = s->_gfxPalette;
+ retval->_gfxPorts = s->_gfxPorts;
+ retval->_gfxScreen = s->_gfxScreen;
#ifdef ENABLE_SCI32
// Copy the Gui32 pointer over to the new EngineState, if it exists
diff --git a/engines/sci/engine/state.h b/engines/sci/engine/state.h
index 1acee49dba..98f072a645 100644
--- a/engines/sci/engine/state.h
+++ b/engines/sci/engine/state.h
@@ -50,10 +50,10 @@ namespace Common {
namespace Sci {
class SciEvent;
-class Menubar;
class GfxAnimate;
class GfxCache;
class GfxControls;
+class GfxMenu;
class GfxPalette;
class GfxPorts;
class GfxScreen;
@@ -160,6 +160,7 @@ public:
GfxAnimate *_gfxAnimate; // Animate for 16-bit gfx
GfxCache *_gfxCache;
GfxControls *_gfxControls; // Controls for 16-bit gfx
+ GfxMenu *_gfxMenu; // Menu for 16-bit gfx
GfxPalette *_gfxPalette;
GfxPorts *_gfxPorts; // Port managment for 16-bit gfx
GfxScreen *_gfxScreen;