aboutsummaryrefslogtreecommitdiff
path: root/engines/director/score.cpp
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/director/score.cpp
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/director/score.cpp')
-rw-r--r--engines/director/score.cpp14
1 files changed, 11 insertions, 3 deletions
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