aboutsummaryrefslogtreecommitdiff
path: root/engines/director/score.cpp
diff options
context:
space:
mode:
authorScott Percival2019-11-10 22:30:48 +0800
committerEugene Sandulenko2019-11-17 22:31:54 +0100
commit2a8019be316ca5d57af2f5742f452d1ca338f8e2 (patch)
tree957b0781ca976cf2db207b4bcd16751ae59878fa /engines/director/score.cpp
parentcaf2a2301c9d14347442b9738e801cd0c171b580 (diff)
downloadscummvm-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/score.cpp')
-rw-r--r--engines/director/score.cpp53
1 files changed, 35 insertions, 18 deletions
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index f0b6d39c11..cc33d470b4 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -180,18 +180,29 @@ void Score::loadArchive() {
setSpriteCasts();
loadSpriteImages(false);
- // Try to load compiled Lingo scripts
- 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());
-
- for (Common::Array<uint16>::iterator iterator = lscr.begin(); iterator != lscr.end(); ++iterator) {
- loadLingoScript(*_movieArchive->getResource(MKTAG('L','s','c','r'), *iterator));
+ // Try to load script name lists
+ 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());
+
+ for (Common::Array<uint16>::iterator iterator = lnam.begin(); iterator != lnam.end(); ++iterator) {
+ loadLingoNames(*_movieArchive->getResource(MKTAG('L','n','a','m'), *iterator));
}
- }
+ }
+ }
- }
+ // Try to load compiled Lingo scripts
+ 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());
+
+ for (Common::Array<uint16>::iterator iterator = lscr.begin(); iterator != lscr.end(); ++iterator) {
+ loadLingoScript(*_movieArchive->getResource(MKTAG('L','s','c','r'), *iterator));
+ }
+ }
+ }
// Try to load movie script, it sits in resource A11
if (_vm->getVersion() <= 3) {
@@ -885,15 +896,21 @@ bool Score::processImmediateFrameScript(Common::String s, int id) {
return false;
}
+void Score::loadLingoNames(Common::SeekableSubReadStreamEndian &stream) {
+ if (_vm->getVersion() == 4) {
+ _lingo->addNamesV4(stream);
+ } else {
+ error("Score::loadLingoNames: unsuported Director version (%d)", _vm->getVersion());
+ }
+}
+
void Score::loadLingoScript(Common::SeekableSubReadStreamEndian &stream) {
- if (_vm->getVersion() == 4) {
-
- _lingo->addCodeV4(stream, kMovieScript, _movieScriptCount);
-
- } else {
- error("Score::loadLingoScript: unsuported Director version (%d)", _vm->getVersion());
- }
- _movieScriptCount++;
+ if (_vm->getVersion() == 4) {
+ _lingo->addCodeV4(stream, kMovieScript, _movieScriptCount);
+ } else {
+ error("Score::loadLingoScript: unsuported Director version (%d)", _vm->getVersion());
+ }
+ _movieScriptCount++;
}
void Score::loadScriptText(Common::SeekableSubReadStreamEndian &stream) {