aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEugene Sandulenko2017-02-20 19:11:38 +0100
committerEugene Sandulenko2017-02-20 19:12:15 +0100
commit30de1272b7c6b50475270aa2882841f65ee7a5e0 (patch)
tree93b7a601244caa6fa663822c33826bf7da083017 /engines
parenteffd93aaf4ee9fbac0140cb0027c734fd704b0b4 (diff)
downloadscummvm-rg350-30de1272b7c6b50475270aa2882841f65ee7a5e0.tar.gz
scummvm-rg350-30de1272b7c6b50475270aa2882841f65ee7a5e0.tar.bz2
scummvm-rg350-30de1272b7c6b50475270aa2882841f65ee7a5e0.zip
DIRECTOR: Added more debug output for score
Diffstat (limited to 'engines')
-rw-r--r--engines/director/lingo/lingo.cpp3
-rw-r--r--engines/director/score.cpp14
2 files changed, 13 insertions, 4 deletions
diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp
index 759d40e819..4cfdc3fd82 100644
--- a/engines/director/lingo/lingo.cpp
+++ b/engines/director/lingo/lingo.cpp
@@ -158,7 +158,8 @@ const char *Lingo::findNextDefinition(const char *s) {
}
void Lingo::addCode(const char *code, ScriptType type, uint16 id) {
- debugC(2, kDebugLingoCompile, "Add code \"%s\" for type %d with id %d", code, type, id);
+ debugC(2, kDebugLingoCompile, "Add code \"%s\" for type %s with id %d", code, scriptType2str(type), id);
+ warning("Add code \"%s\" for type %s with id %d", code, scriptType2str(type), id);
if (_scripts[type].contains(id)) {
delete _scripts[type][id];
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 2544a612c0..b8e601eccd 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -260,6 +260,7 @@ void Score::loadFrames(Common::SeekableSubReadStreamEndian &stream) {
Common::MemoryReadStreamEndian *str = new Common::MemoryReadStreamEndian(channelData, ARRAYSIZE(channelData), stream.isBE());
//Common::hexdump(channelData, ARRAYSIZE(channelData));
frame->readChannels(str);
+ warning("Frame %d actionId: %d", _frames.size(), frame->_actionId);
delete str;
@@ -502,17 +503,22 @@ void Score::loadActions(Common::SeekableSubReadStreamEndian &stream) {
uint16 offset = count * 4 + 2;
byte id = stream.readByte();
+
/*byte subId = */ stream.readByte(); // I couldn't find how it used in continuity (except print). Frame actionId = 1 byte.
uint16 stringPos = stream.readUint16() + offset;
for (uint16 i = 0; i < count; i++) {
uint16 nextId = stream.readByte();
- /*byte subId = */ stream.readByte();
+ byte subId = stream.readByte();
uint16 nextStringPos = stream.readUint16() + offset;
uint16 streamPos = stream.pos();
stream.seek(stringPos);
+ if (_vm->getVersion() == 3) {
+ id -= 1;
+ }
+
for (uint16 j = stringPos; j < nextStringPos; j++) {
byte ch = stream.readByte();
if (ch == 0x0d) {
@@ -521,6 +527,8 @@ void Score::loadActions(Common::SeekableSubReadStreamEndian &stream) {
_actions[id] += ch;
}
+ warning("id: %d nextId: %d subId: %d, code: %s", id, nextId, subId, _actions[id].c_str());
+
stream.seek(streamPos);
id = nextId;
@@ -881,8 +889,8 @@ void Score::update() {
_surface->copyFrom(*_trailSurface);
// Enter and exit from previous frame (Director 4)
- _lingo->processEvent(kEventEnterFrame, kFrameScript, _frames[_currentFrame]->_actionId - 1);
- _lingo->processEvent(kEventExitFrame, kFrameScript, _frames[_currentFrame]->_actionId - 1);
+ _lingo->processEvent(kEventEnterFrame, kFrameScript, _frames[_currentFrame]->_actionId);
+ _lingo->processEvent(kEventExitFrame, kFrameScript, _frames[_currentFrame]->_actionId);
// TODO Director 6 - another order
// TODO Director 6 step: send beginSprite event to any sprites whose span begin in the upcoming frame