[Scummvm-git-logs] scummvm master -> bf2843007411e58c516ef79b2b89262eceb57913

sev- sev at scummvm.org
Fri Jun 5 21:37:24 UTC 2020


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

Summary:
ecf09c214c DIRECTOR: LINGO: Skip garbage before macro in D2-3
bf28430074 DIRECTOR: LINGO: Don't check for \n in script text


Commit: ecf09c214c2538ee8419704b9caac1eaca5cbb50
    https://github.com/scummvm/scummvm/commit/ecf09c214c2538ee8419704b9caac1eaca5cbb50
Author: djsrv (dservilla at gmail.com)
Date: 2020-06-05T23:37:19+02:00

Commit Message:
DIRECTOR: LINGO: Skip garbage before macro in D2-3

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


diff --git a/engines/director/lingo/lingo-preprocessor.cpp b/engines/director/lingo/lingo-preprocessor.cpp
index e0e9a98c7b..f3ac3f62c1 100644
--- a/engines/director/lingo/lingo-preprocessor.cpp
+++ b/engines/director/lingo/lingo-preprocessor.cpp
@@ -165,6 +165,7 @@ Common::String Lingo::codePreprocessor(const char *s, ScriptType type, uint16 id
 	const char *lineStart, *prevEnd;
 	int iflevel = 0;
 	int linenumber = 1;
+	bool defFound = false;
 
 	while (*s) {
 		line.clear();
@@ -180,6 +181,19 @@ Common::String Lingo::codePreprocessor(const char *s, ScriptType type, uint16 id
 		}
 		debugC(2, kDebugLingoParse, "line: %d                         '%s'", iflevel, line.c_str());
 
+		if (type == kMovieScript && _vm->getVersion() <= 3 && !defFound) {
+			tok = nexttok(line.c_str());
+			if (tok.equals("macro") || tok.equals("factory") || tok.equals("on")) {
+				defFound = true;
+			} else {
+				debugC(2, kDebugLingoParse, "skipping line before first definition");
+				linenumber++;
+				if (*s)	// copy newline symbol
+					res += *s++;
+				continue;
+			}
+		}
+
 		res1 = patchLingoCode(res1, type, id, linenumber);
 
 		bool changed = false;


Commit: bf2843007411e58c516ef79b2b89262eceb57913
    https://github.com/scummvm/scummvm/commit/bf2843007411e58c516ef79b2b89262eceb57913
Author: djsrv (dservilla at gmail.com)
Date: 2020-06-05T23:37:19+02:00

Commit Message:
DIRECTOR: LINGO: Don't check for \n in script text

Script text only needs to start with "--", no newline necessary.

Changed paths:
    engines/director/score-loading.cpp


diff --git a/engines/director/score-loading.cpp b/engines/director/score-loading.cpp
index ff5ec7eb77..92aaf61e6b 100644
--- a/engines/director/score-loading.cpp
+++ b/engines/director/score-loading.cpp
@@ -1073,18 +1073,11 @@ void Score::loadScriptText(Common::SeekableSubReadStreamEndian &stream) {
 		script += ch;
 	}
 
-	// Check if the script has macro. They must start with a comment.
+	// Check if this is a script. It must start with a comment.
 	// See D2 Interactivity Manual pp.46-47 (Ch.2.11. Using a macro)
 	if (script.empty() || !script.hasPrefix("--"))
 		return;
 
-	int pos = 2;
-	while (script[pos] == ' ' || script[pos] == '\t')
-		pos++;
-
-	if (script[pos] != '\n')
-		return;
-
 	if (ConfMan.getBool("dump_scripts"))
 		dumpScript(script.c_str(), kMovieScript, _movieScriptCount);
 




More information about the Scummvm-git-logs mailing list