diff options
author | Scott Percival | 2019-11-10 22:30:48 +0800 |
---|---|---|
committer | Eugene Sandulenko | 2019-11-17 22:31:54 +0100 |
commit | 2a8019be316ca5d57af2f5742f452d1ca338f8e2 (patch) | |
tree | 957b0781ca976cf2db207b4bcd16751ae59878fa /engines/director/lingo/lingo-bytecode.cpp | |
parent | caf2a2301c9d14347442b9738e801cd0c171b580 (diff) | |
download | scummvm-rg350-2a8019be316ca5d57af2f5742f452d1ca338f8e2.tar.gz scummvm-rg350-2a8019be316ca5d57af2f5742f452d1ca338f8e2.tar.bz2 scummvm-rg350-2a8019be316ca5d57af2f5742f452d1ca338f8e2.zip |
DIRECTOR: Add loader for Lingo name section.
Diffstat (limited to 'engines/director/lingo/lingo-bytecode.cpp')
-rw-r--r-- | engines/director/lingo/lingo-bytecode.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/engines/director/lingo/lingo-bytecode.cpp b/engines/director/lingo/lingo-bytecode.cpp index af3ae68efe..fcc2236a67 100644 --- a/engines/director/lingo/lingo-bytecode.cpp +++ b/engines/director/lingo/lingo-bytecode.cpp @@ -68,6 +68,8 @@ void Lingo::initBytecode() { } + + void Lingo::addCodeV4(Common::SeekableSubReadStreamEndian &stream, ScriptType type, uint16 id) { debugC(1, kDebugLingoCompile, "Add V4 bytecode for type %s with id %d", scriptType2str(type), id); @@ -278,4 +280,36 @@ void Lingo::addCodeV4(Common::SeekableSubReadStreamEndian &stream, ScriptType ty free(code_store); } + +void Lingo::addNamesV4(Common::SeekableSubReadStreamEndian &stream) { + debugC(1, kDebugLingoCompile, "Add V4 script name index"); + + // read the Lnam header! + stream.readUint16(); + stream.readUint16(); + stream.readUint16(); + stream.readUint16(); + stream.readUint16(); + stream.readUint16(); + stream.readUint16(); + stream.readUint16(); + uint16 offset = stream.readUint16(); + uint16 count = stream.readUint16(); + + stream.seek(offset); + + _namelist.clear(); + + Common::Array<Common::String> names; + for (uint32 i = 0; i < count; i++) { + uint8 size = stream.readByte(); + Common::String name; + for (uint8 j = 0; j < size; j++) { + name += stream.readByte(); + } + _namelist.push_back(name); + } + +} + } |