diff options
author | Eugene Sandulenko | 2017-02-20 20:27:45 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2017-02-20 20:27:45 +0100 |
commit | 71ce7292f0ae07af5eaa54919f78db160337659e (patch) | |
tree | 22d02b976a07c6a043b6c90594eb66a97d5bab98 /engines/director | |
parent | 30de1272b7c6b50475270aa2882841f65ee7a5e0 (diff) | |
download | scummvm-rg350-71ce7292f0ae07af5eaa54919f78db160337659e.tar.gz scummvm-rg350-71ce7292f0ae07af5eaa54919f78db160337659e.tar.bz2 scummvm-rg350-71ce7292f0ae07af5eaa54919f78db160337659e.zip |
DIRECTOR: Fix event processing
Diffstat (limited to 'engines/director')
-rw-r--r-- | engines/director/score.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/engines/director/score.cpp b/engines/director/score.cpp index b8e601eccd..4376ca5011 100644 --- a/engines/director/score.cpp +++ b/engines/director/score.cpp @@ -504,34 +504,31 @@ void Score::loadActions(Common::SeekableSubReadStreamEndian &stream) { byte id = stream.readByte(); - /*byte subId = */ stream.readByte(); // I couldn't find how it used in continuity (except print). Frame actionId = 1 byte. + 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 nextSubId = 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) { ch = '\n'; } - _actions[id] += ch; + _actions[i + 1] += ch; } - warning("id: %d nextId: %d subId: %d, code: %s", id, nextId, subId, _actions[id].c_str()); + debugC(3, kDebugLoading, "id: %d nextId: %d subId: %d, code: %s", id, nextId, subId, _actions[id].c_str()); stream.seek(streamPos); id = nextId; + subId = nextSubId; stringPos = nextStringPos; if (stringPos == stream.size()) @@ -997,7 +994,7 @@ void Score::processEvents() { _lingo->processEvent(kEventMouseUp, kSpriteScript, _frames[_currentFrame]->_sprites[spriteId]->_scriptId); } else { // D3 doesn't have cast member or sprite scripts. Just Frame Scripts. - _lingo->processEvent(kEventMouseUp, kFrameScript, _frames[_currentFrame]->_sprites[spriteId]->_scriptId + 1); + _lingo->processEvent(kEventMouseUp, kFrameScript, _frames[_currentFrame]->_sprites[spriteId]->_scriptId); } } |