diff options
Diffstat (limited to 'engines')
-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? |