mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-08 11:57:25 +00:00
Fixed findGameObject() for SCI11 games
svn-id: r49326
This commit is contained in:
parent
ff3f0f5d65
commit
0276ec835e
@ -127,13 +127,7 @@ int game_init(EngineState *s) {
|
||||
|
||||
srand(g_system->getMillis()); // Initialize random number generator
|
||||
|
||||
// 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;
|
||||
s->_gameObj = g_sci->getResMan()->findGameObject();
|
||||
|
||||
#ifdef USE_OLD_MUSIC_FUNCTIONS
|
||||
if (s->sfx_init_flags & SFX_STATE_FLAG_NOSOUND)
|
||||
|
@ -1923,9 +1923,13 @@ reg_t ResourceManager::findGameObject(bool addSci11ScriptOffset) {
|
||||
|
||||
// In SCI1.1 and newer, the heap is appended at the end of the script,
|
||||
// so adjust the offset accordingly
|
||||
if (getSciVersion() >= SCI_VERSION_1_1 && addSci11ScriptOffset)
|
||||
if (getSciVersion() >= SCI_VERSION_1_1 && addSci11ScriptOffset) {
|
||||
offset += script->size;
|
||||
|
||||
if (script->size & 2)
|
||||
offset++;
|
||||
}
|
||||
|
||||
return make_reg(1, offset);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user