aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorDmitry Iskrich2016-06-16 15:17:28 +0300
committerEugene Sandulenko2016-08-03 23:40:36 +0200
commit511c0d9f7b39964c683a5a071e6e2f44da105fa7 (patch)
tree62b8939c1aee67b07f55683c461e97208d3e4f18 /engines
parentddcaad4a11b8b9d542a01d2544283416a03ea80a (diff)
downloadscummvm-rg350-511c0d9f7b39964c683a5a071e6e2f44da105fa7.tar.gz
scummvm-rg350-511c0d9f7b39964c683a5a071e6e2f44da105fa7.tar.bz2
scummvm-rg350-511c0d9f7b39964c683a5a071e6e2f44da105fa7.zip
DIRECTOR: Dump movie scripts, and scripts from cast info
Diffstat (limited to 'engines')
-rw-r--r--engines/director/score.cpp18
-rw-r--r--engines/director/score.h1
2 files changed, 16 insertions, 3 deletions
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 16f85fc02f..1240e9ec9c 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -47,7 +47,7 @@ Score::Score(Archive &movie, Lingo &lingo, DirectorSound &soundManager) {
_lingo = &lingo;
_soundManager = &soundManager;
_lingo->processEvent(kEventPrepareMovie, 0);
-
+ _movieScriptCount = 0;
assert(_movieArchive->hasResource(MKTAG('V','W','S','C'), 1024));
assert(_movieArchive->hasResource(MKTAG('V','W','C','F'), 1024));
assert(_movieArchive->hasResource(MKTAG('V','W','C','R'), 1024));
@@ -284,7 +284,11 @@ void Score::loadScriptText(Common::SeekableReadStream &stream) {
}
script += ch;
}
- _lingo->addCode(script, kMovieScript, 0);
+ _lingo->addCode(script, kMovieScript, _movieScriptCount);
+ if (ConfMan.getBool("dump_scripts")) {
+ dumpScript(_movieScriptCount, kMovieScript, script);
+ }
+ _movieScriptCount++;
}
void Score::dumpScript(uint16 id, ScriptType type, Common::String script) {
@@ -324,6 +328,10 @@ void Score::loadCastInfo(Common::SeekableReadStream &stream, uint16 id) {
if (ci->script != "") {
_lingo->addCode(ci->script, kSpriteScript, id);
}
+ if (!ConfMan.getBool("dump_scripts")) {
+ dumpScript(id, kSpriteScript, ci->script);
+ }
+
ci->name = getString(castStrings[1]);
ci->directory = getString(castStrings[2]);
ci->fileName = getString(castStrings[3]);
@@ -351,8 +359,12 @@ void Score::loadFileInfo(Common::SeekableReadStream &stream) {
Common::Array<Common::String> fileInfoStrings = loadStrings(stream, _flags);
_script = fileInfoStrings[0];
if (_script != "") {
- _lingo->addCode(_script, kMovieScript, 0);
+ _lingo->addCode(_script, kMovieScript, _movieScriptCount);
+ }
+ if (!ConfMan.getBool("dump_scripts")) {
+ dumpScript(_movieScriptCount, kMovieScript, _script);
}
+ _movieScriptCount++;
_changedBy = fileInfoStrings[1];
_createdBy = fileInfoStrings[2];
_directory = fileInfoStrings[3];
diff --git a/engines/director/score.h b/engines/director/score.h
index 6156194df4..ea2402823d 100644
--- a/engines/director/score.h
+++ b/engines/director/score.h
@@ -323,6 +323,7 @@ private:
uint32 _flags;
bool _stopPlay;
uint16 _castArrayEnd;
+ uint16 _movieScriptCount;
uint16 _stageColor;
Lingo *_lingo;
DirectorSound *_soundManager;