diff options
| author | Colin Snover | 2017-05-20 20:59:16 -0500 | 
|---|---|---|
| committer | Colin Snover | 2017-05-20 21:14:18 -0500 | 
| commit | 1f29e6f241f77e028b31d72d6d4adaf8ce1b29ae (patch) | |
| tree | d6a9012388ffe213d8e8e85ba102fa12231b4e13 /engines/sci/engine/kscripts.cpp | |
| parent | d09ae57fd8a22e3b0a3946a028a500c15f05aa0a (diff) | |
| download | scummvm-rg350-1f29e6f241f77e028b31d72d6d4adaf8ce1b29ae.tar.gz scummvm-rg350-1f29e6f241f77e028b31d72d6d4adaf8ce1b29ae.tar.bz2 scummvm-rg350-1f29e6f241f77e028b31d72d6d4adaf8ce1b29ae.zip | |
SCI: Refactor relocation code
This groundwork enables an object to look up its static name
separately from the normal process that is used to populate
Object::_variables when an object is first constructed.
(The static name property needs to be able to be retrieved from
objects inside of earlier save games whose name properties may
have already been modified at runtime, so the code cannot simply
pluck the value out of Object::_variables when they are first
initialised and then persisted into the save game, as nice and
easy as that would have been.)
This commit also helps to clarify the situation with relocation
tables in SCI1 games that start with a zero entry.
Refs Trac#9780.
Diffstat (limited to 'engines/sci/engine/kscripts.cpp')
| -rw-r--r-- | engines/sci/engine/kscripts.cpp | 6 | 
1 files changed, 1 insertions, 5 deletions
| diff --git a/engines/sci/engine/kscripts.cpp b/engines/sci/engine/kscripts.cpp index af4b8ff081..75f905e81a 100644 --- a/engines/sci/engine/kscripts.cpp +++ b/engines/sci/engine/kscripts.cpp @@ -246,11 +246,7 @@ reg_t kScriptID(EngineState *s, int argc, reg_t *argv) {  		return NULL_REG;  	} -	uint32 address = scr->validateExportFunc(index, true); - -	// Point to the heap for SCI1.1 - SCI2.1 games -	if (getSciVersion() >= SCI_VERSION_1_1 && getSciVersion() <= SCI_VERSION_2_1_LATE) -		address += scr->getScriptSize(); +	const uint32 address = scr->validateExportFunc(index, true) + scr->getHeapOffset();  	// Bugfix for the intro speed in PQ2 version 1.002.011.  	// This is taken from the patch by NewRisingSun(NRS) / Belzorash. Global 3 | 
