aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/sci.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2010-06-09 21:41:20 +0000
committerFilippos Karapetis2010-06-09 21:41:20 +0000
commit14437e6394172dcabd0f5255b724c38f5b862332 (patch)
tree4fa7a88376923968f0e4bea516d102b6274df6ee /engines/sci/sci.cpp
parentd44efa817fd997f336ac83f0490212fb21e9bf02 (diff)
downloadscummvm-rg350-14437e6394172dcabd0f5255b724c38f5b862332.tar.gz
scummvm-rg350-14437e6394172dcabd0f5255b724c38f5b862332.tar.bz2
scummvm-rg350-14437e6394172dcabd0f5255b724c38f5b862332.zip
The segment manager is now initialized before the graphics subsystem. Fixes the detection of the fastCast object on startup, and hence fixes LSL1VGA
svn-id: r49553
Diffstat (limited to 'engines/sci/sci.cpp')
-rw-r--r--engines/sci/sci.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index 1d0bbadd63..d5cab1adc9 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -44,6 +44,7 @@
#include "sci/sound/soundcmd.h"
#include "sci/graphics/gui.h"
#include "sci/graphics/maciconbar.h"
+#include "sci/graphics/menu.h"
#include "sci/graphics/ports.h"
#include "sci/graphics/palette.h"
#include "sci/graphics/cursor.h"
@@ -193,6 +194,15 @@ Common::Error SciEngine::run() {
_gamestate = new EngineState(segMan);
_eventMan = new EventManager(_resMan);
+ // The game needs to be initialized before the graphics system is initialized, as
+ // the graphics code checks parts of the seg manager upon initialization (e.g. for
+ // the presence of the fastCast object)
+ if (game_init(_gamestate)) { /* Initialize */
+ warning("Game initialization failed: Aborting...");
+ // TODO: Add an "init failed" error?
+ return Common::kUnknownError;
+ }
+
#ifdef ENABLE_SCI32
if (getSciVersion() >= SCI_VERSION_2) {
_gfxAnimate = 0;
@@ -209,15 +219,11 @@ Common::Error SciEngine::run() {
#ifdef ENABLE_SCI32
_gui32 = 0;
_gfxFrameout = 0;
- }
-#endif
- if (game_init(_gamestate)) { /* Initialize */
- warning("Game initialization failed: Aborting...");
- // TODO: Add an "init failed" error?
- return Common::kUnknownError;
+ g_sci->_gfxMenu->reset();
}
-
+#endif
+
_kernel->loadKernelNames(_features); // Must be called after game_init()
script_adjust_opcode_formats(_gamestate);