diff options
author | Filippos Karapetis | 2009-10-11 16:47:01 +0000 |
---|---|---|
committer | Filippos Karapetis | 2009-10-11 16:47:01 +0000 |
commit | 9b97f21486e7c84611140c05a1e8aa20df238777 (patch) | |
tree | 820c33d1471fda560639f97f356c2d0a26686134 /engines/sci | |
parent | 1d2031defd094f0b067634c42c864c2143a6b341 (diff) | |
download | scummvm-rg350-9b97f21486e7c84611140c05a1e8aa20df238777.tar.gz scummvm-rg350-9b97f21486e7c84611140c05a1e8aa20df238777.tar.bz2 scummvm-rg350-9b97f21486e7c84611140c05a1e8aa20df238777.zip |
Reset the EngineState pointer in the SciGuiGfx class when loading. Fixes loading with the new GUI
svn-id: r44934
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/gui/gui.cpp | 5 | ||||
-rw-r--r-- | engines/sci/gui/gui.h | 2 | ||||
-rw-r--r-- | engines/sci/gui/gui_gfx.h | 3 | ||||
-rw-r--r-- | engines/sci/sci.cpp | 6 |
4 files changed, 12 insertions, 4 deletions
diff --git a/engines/sci/gui/gui.cpp b/engines/sci/gui/gui.cpp index f1dfee166a..71df9eaab3 100644 --- a/engines/sci/gui/gui.cpp +++ b/engines/sci/gui/gui.cpp @@ -63,6 +63,11 @@ SciGui::SciGui() { SciGui::~SciGui() { } +void SciGui::resetEngineState(EngineState *s) { + _s = s; + _gfx->resetEngineState(s); +} + void SciGui::init(bool usesOldGfxFunctions) { // Initialize priority bands if (usesOldGfxFunctions) { diff --git a/engines/sci/gui/gui.h b/engines/sci/gui/gui.h index df8c3b09db..9aa1ea4308 100644 --- a/engines/sci/gui/gui.h +++ b/engines/sci/gui/gui.h @@ -107,7 +107,7 @@ public: virtual bool debugShowMap(int mapNo); // FIXME: Don't store EngineState - virtual void resetEngineState(EngineState *s) { _s = s; } + virtual void resetEngineState(EngineState *s); private: EngineState *_s; diff --git a/engines/sci/gui/gui_gfx.h b/engines/sci/gui/gui_gfx.h index 058b7d4659..019b5d3299 100644 --- a/engines/sci/gui/gui_gfx.h +++ b/engines/sci/gui/gui_gfx.h @@ -56,6 +56,9 @@ public: void init(void); + // FIXME: Don't store EngineState + void resetEngineState(EngineState *newState) { _s = newState; } + byte *GetSegment(byte seg); void ResetScreen(); diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp index 664cd5243b..55823fa9b4 100644 --- a/engines/sci/sci.cpp +++ b/engines/sci/sci.cpp @@ -134,13 +134,13 @@ Common::Error SciEngine::run() { // We'll set the GUI below _gamestate = new EngineState(_resMan, _kernel, _vocabulary, NULL, cursor); + if (script_init_engine(_gamestate)) + return Common::kUnknownError; + // Gui change //_gamestate->_gui = new SciGui(_gamestate, screen, palette, cursor); // new _gamestate->_gui = new SciGui32(_gamestate, screen, palette, cursor); // old - if (script_init_engine(_gamestate)) - return Common::kUnknownError; - if (game_init(_gamestate)) { /* Initialize */ warning("Game initialization failed: Aborting..."); // TODO: Add an "init failed" error? |