[Scummvm-cvs-logs] SF.net SVN: scummvm:[54302] scummvm/trunk/engines/sci/engine/script.cpp
lskovlun at users.sourceforge.net
lskovlun at users.sourceforge.net
Wed Nov 17 21:37:14 CET 2010
Revision: 54302
http://scummvm.svn.sourceforge.net/scummvm/?rev=54302&view=rev
Author: lskovlun
Date: 2010-11-17 20:37:13 +0000 (Wed, 17 Nov 2010)
Log Message:
-----------
SCI3: Handle script exports correctly
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/script.cpp
Modified: scummvm/trunk/engines/sci/engine/script.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/script.cpp 2010-11-17 20:29:10 UTC (rev 54301)
+++ scummvm/trunk/engines/sci/engine/script.cpp 2010-11-17 20:37:13 UTC (rev 54302)
@@ -169,6 +169,7 @@
_localsCount = READ_SCI11ENDIAN_UINT16(_buf + _localsOffset - 2);
} else if (getSciVersion() == SCI_VERSION_3) {
_localsCount = READ_LE_UINT16(_buf + 12);
+ _exportTable = (const uint16 *) _buf + 22;
_numExports = READ_LE_UINT16(_buf + 20);
// SCI3 local variables always start dword-aligned
if (_numExports % 2)
@@ -398,7 +399,8 @@
if (exportsAreWide)
pubfunct *= 2;
- uint16 offset = READ_SCI11ENDIAN_UINT16(_exportTable + pubfunct);
+ uint16 offset = getSciVersion() != SCI_VERSION_3 ? READ_SCI11ENDIAN_UINT16(_exportTable + pubfunct) :
+ relocateOffsetSci3(pubfunct * 2 + 22);
VERIFY(offset < _bufSize, "invalid export function pointer");
// Check if the offset found points to a second export table (e.g. script 912
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list