[Scummvm-git-logs] scummvm master -> 039d2b3fd6793d62923ab449b9b8efd584193d32

djsrv dservilla at gmail.com
Wed Jul 29 15:26:05 UTC 2020


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

Summary:
b278579353 DIRECTOR: Clean up action loading
908f381ac1 DIRECTOR: LINGO: Fix D4 generic events
039d2b3fd6 DIRECTOR: LINGO: Remove "maybe" in Lscr debug


Commit: b2785793534cbb4bed9738d39c77515d86f8a82c
    https://github.com/scummvm/scummvm/commit/b2785793534cbb4bed9738d39c77515d86f8a82c
Author: djsrv (dservilla at gmail.com)
Date: 2020-07-29T11:25:07-04:00

Commit Message:
DIRECTOR: Clean up action loading

Changed paths:
    engines/director/score.cpp


diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index b503352ce0..b6f8d4ab1e 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -782,7 +782,7 @@ void Score::loadActions(Common::SeekableSubReadStreamEndian &stream) {
 	byte subId = stream.readByte(); // I couldn't find how it used in continuity (except print). Frame actionId = 1 byte.
 	uint32 stringPos = stream.readUint16() + offset;
 
-	for (uint16 i = 0; i < count; i++) {
+	for (uint16 i = 1; i <= count; i++) {
 		uint16 nextId = stream.readByte();
 		byte nextSubId = stream.readByte();
 		uint32 nextStringPos = stream.readUint16() + offset;
@@ -790,15 +790,17 @@ void Score::loadActions(Common::SeekableSubReadStreamEndian &stream) {
 
 		stream.seek(stringPos);
 
+		Common::String script;
 		for (uint16 j = stringPos; j < nextStringPos; j++) {
 			byte ch = stream.readByte();
 			if (ch == 0x0d) {
 				ch = '\n';
 			}
-			_actions[i + 1] += ch;
+			script += ch;
 		}
+		_actions[i] = script;
 
-		debugC(3, kDebugLoading, "Action id: %d nextId: %d subId: %d, code: %s", id, nextId, subId, _actions[id].c_str());
+		debugC(3, kDebugLoading, "Action index: %d id: %d nextId: %d subId: %d, code: %s", i, id, nextId, subId, _actions[i].c_str());
 
 		stream.seek(streamPos);
 
@@ -810,7 +812,7 @@ void Score::loadActions(Common::SeekableSubReadStreamEndian &stream) {
 			break;
 	}
 
-	bool *scriptRefs = (bool *)calloc(_actions.size() + 1, sizeof(int));
+	bool *scriptRefs = (bool *)calloc(_actions.size() + 1, sizeof(bool));
 
 	// Now let's scan which scripts are actually referenced
 	for (uint i = 0; i < _frames.size(); i++) {


Commit: 908f381ac1d16cc0b1fcb69096a61ac8ca2ce2f7
    https://github.com/scummvm/scummvm/commit/908f381ac1d16cc0b1fcb69096a61ac8ca2ce2f7
Author: djsrv (dservilla at gmail.com)
Date: 2020-07-29T11:25:07-04:00

Commit Message:
DIRECTOR: LINGO: Fix D4 generic events

Changed paths:
    engines/director/lingo/lingo-bytecode.cpp


diff --git a/engines/director/lingo/lingo-bytecode.cpp b/engines/director/lingo/lingo-bytecode.cpp
index cf9244ef29..d3f6694aa8 100644
--- a/engines/director/lingo/lingo-bytecode.cpp
+++ b/engines/director/lingo/lingo-bytecode.cpp
@@ -1425,7 +1425,7 @@ ScriptContext *Lingo::compileLingoV4(Common::SeekableSubReadStreamEndian &stream
 			functionName = archive->names[nameIndex];
 		} else if (i == 0 && (scriptFlags & kScriptFlagEventScript)) {
 			// event script (lingo not contained within a handler)
-			functionName = "scummvm_script";
+			functionName = _eventHandlerTypes[kEventGeneric];
 		}
 
 		Symbol sym;


Commit: 039d2b3fd6793d62923ab449b9b8efd584193d32
    https://github.com/scummvm/scummvm/commit/039d2b3fd6793d62923ab449b9b8efd584193d32
Author: djsrv (dservilla at gmail.com)
Date: 2020-07-29T11:25:07-04:00

Commit Message:
DIRECTOR: LINGO: Remove "maybe" in Lscr debug

We know the script type/cast member id for sure now.

Changed paths:
    engines/director/lingo/lingo-bytecode.cpp


diff --git a/engines/director/lingo/lingo-bytecode.cpp b/engines/director/lingo/lingo-bytecode.cpp
index d3f6694aa8..0fefa4bb7a 100644
--- a/engines/director/lingo/lingo-bytecode.cpp
+++ b/engines/director/lingo/lingo-bytecode.cpp
@@ -945,7 +945,7 @@ ScriptContext *Lingo::compileLingoV4(Common::SeekableSubReadStreamEndian &stream
 		sc = _assemblyContext = new ScriptContext(factoryName, _assemblyArchive, scriptType, castId);
 		codeFactory(factoryName);
 	} else {
-		debugC(1, kDebugCompile, "Add V4 script %d: maybe %s %d", lctxIndex, scriptType2str(scriptType), castId);
+		debugC(1, kDebugCompile, "Add V4 script %d: %s %d", lctxIndex, scriptType2str(scriptType), castId);
 
 		sc = _assemblyContext = new ScriptContext(!castName.empty() ? castName : Common::String::format("%d", castId), _assemblyArchive, scriptType, castId);
 	}




More information about the Scummvm-git-logs mailing list