diff options
author | Scott Percival | 2019-11-17 13:18:52 +0800 |
---|---|---|
committer | Eugene Sandulenko | 2019-11-17 22:31:54 +0100 |
commit | 25c8d3a57c6839f8a5bde2f9026d66331d19c7a6 (patch) | |
tree | d2438ee4db5749b9a815be78e167b78a2f7c5aa3 /engines | |
parent | e727264b7dc433a27cd6907333775cd798d3a24b (diff) | |
download | scummvm-rg350-25c8d3a57c6839f8a5bde2f9026d66331d19c7a6.tar.gz scummvm-rg350-25c8d3a57c6839f8a5bde2f9026d66331d19c7a6.tar.bz2 scummvm-rg350-25c8d3a57c6839f8a5bde2f9026d66331d19c7a6.zip |
DIRECTOR: Attempt to load Lingo bytecode for v4 and above
Diffstat (limited to 'engines')
-rw-r--r-- | engines/director/lingo/lingo-bytecode.cpp | 7 | ||||
-rw-r--r-- | engines/director/score.cpp | 8 |
2 files changed, 10 insertions, 5 deletions
diff --git a/engines/director/lingo/lingo-bytecode.cpp b/engines/director/lingo/lingo-bytecode.cpp index 2fc0655e72..64fc354cb5 100644 --- a/engines/director/lingo/lingo-bytecode.cpp +++ b/engines/director/lingo/lingo-bytecode.cpp @@ -126,7 +126,12 @@ void Lingo::addCodeV4(Common::SeekableSubReadStreamEndian &stream, ScriptType ty stream.seek(constsOffset); for (uint16 i = 0; i < constsCount; i++) { Datum constant; - uint16 constType = stream.readUint16(); + uint32 constType = 0; + if (_vm->getVersion() >= 5) { + constType = stream.readUint32(); + } else { + constType = (uint32)stream.readUint16(); + } uint32 value = stream.readUint32(); switch (constType) { case 1: // String type diff --git a/engines/director/score.cpp b/engines/director/score.cpp index cc33d470b4..e593f87c44 100644 --- a/engines/director/score.cpp +++ b/engines/director/score.cpp @@ -181,7 +181,7 @@ void Score::loadArchive() { loadSpriteImages(false); // Try to load script name lists - if (_vm->getVersion() == 4) { + if (_vm->getVersion() >= 4) { Common::Array<uint16> lnam = _movieArchive->getResourceIDList(MKTAG('L','n','a','m')); if (lnam.size() > 0) { debugC(2, kDebugLoading, "****** Loading %d Lnam resources", lnam.size()); @@ -193,7 +193,7 @@ void Score::loadArchive() { } // Try to load compiled Lingo scripts - if (_vm->getVersion() == 4) { + if (_vm->getVersion() >= 4) { Common::Array<uint16> lscr = _movieArchive->getResourceIDList(MKTAG('L','s','c','r')); if (lscr.size() > 0) { debugC(2, kDebugLoading, "****** Loading %d Lscr resources", lscr.size()); @@ -897,7 +897,7 @@ bool Score::processImmediateFrameScript(Common::String s, int id) { } void Score::loadLingoNames(Common::SeekableSubReadStreamEndian &stream) { - if (_vm->getVersion() == 4) { + if (_vm->getVersion() >= 4) { _lingo->addNamesV4(stream); } else { error("Score::loadLingoNames: unsuported Director version (%d)", _vm->getVersion()); @@ -905,7 +905,7 @@ void Score::loadLingoNames(Common::SeekableSubReadStreamEndian &stream) { } void Score::loadLingoScript(Common::SeekableSubReadStreamEndian &stream) { - if (_vm->getVersion() == 4) { + if (_vm->getVersion() >= 4) { _lingo->addCodeV4(stream, kMovieScript, _movieScriptCount); } else { error("Score::loadLingoScript: unsuported Director version (%d)", _vm->getVersion()); |