aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorFilippos Karapetis2010-05-29 15:27:27 +0000
committerFilippos Karapetis2010-05-29 15:27:27 +0000
commit3d09af03773d353e73b61197befa63031e99d096 (patch)
treef25a3ba0bb5c728905827170580f53574797916c /engines/sci/engine
parent708b37898c17ca520e8b3ae92a2e458665c7bd81 (diff)
downloadscummvm-rg350-3d09af03773d353e73b61197befa63031e99d096.tar.gz
scummvm-rg350-3d09af03773d353e73b61197befa63031e99d096.tar.bz2
scummvm-rg350-3d09af03773d353e73b61197befa63031e99d096.zip
Removed the hack inside findGameObject(), and replaced it with code from the segment manager, till we find out why the segment is sometimes off by 1 (note that findGameObject() works fine for finding the game ID itself)
svn-id: r49310
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/game.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/engines/sci/engine/game.cpp b/engines/sci/engine/game.cpp
index 232e0eca55..241df94316 100644
--- a/engines/sci/engine/game.cpp
+++ b/engines/sci/engine/game.cpp
@@ -127,7 +127,13 @@ int game_init(EngineState *s) {
srand(g_system->getMillis()); // Initialize random number generator
- s->_gameObj = g_sci->getResMan()->findGameObject();
+ // TODO: This is sometimes off by 1... find out why
+ //s->_gameObj = g_sci->getResMan()->findGameObject();
+ // Replaced by the code below for now
+ Script *scr000 = s->_segMan->getScript(1);
+ s->_gameObj = make_reg(1, scr000->validateExportFunc(0));
+ if (getSciVersion() >= SCI_VERSION_1_1)
+ s->_gameObj.offset += scr000->_scriptSize;
#ifdef USE_OLD_MUSIC_FUNCTIONS
if (s->sfx_init_flags & SFX_STATE_FLAG_NOSOUND)