[Scummvm-git-logs] scummvm master -> 30de1272b7c6b50475270aa2882841f65ee7a5e0

sev- sev at scummvm.org
Mon Feb 20 19:12:26 CET 2017


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
30de1272b7 DIRECTOR: Added more debug output for score


Commit: 30de1272b7c6b50475270aa2882841f65ee7a5e0
    https://github.com/scummvm/scummvm/commit/30de1272b7c6b50475270aa2882841f65ee7a5e0
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2017-02-20T19:12:15+01:00

Commit Message:
DIRECTOR: Added more debug output for score

Changed paths:
    engines/director/lingo/lingo.cpp
    engines/director/score.cpp


diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp
index 759d40e..4cfdc3f 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 2544a61..b8e601e 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





More information about the Scummvm-git-logs mailing list