[Scummvm-git-logs] scummvm master -> 5848462bdbd0884bb4e2d85ad8f4e51e84a44955

rvanlaar roland at rolandvanlaar.nl
Mon Aug 17 19:04:53 UTC 2020


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:
5848462bdb DIRECTOR:LINGO: Specify arg names on dump scripts


Commit: 5848462bdbd0884bb4e2d85ad8f4e51e84a44955
    https://github.com/scummvm/scummvm/commit/5848462bdbd0884bb4e2d85ad8f4e51e84a44955
Author: Roland van Laar (roland at rolandvanlaar.nl)
Date: 2020-08-17T21:04:09+02:00

Commit Message:
DIRECTOR:LINGO: Specify arg names on dump scripts

Dumped lingo (lscr) files now contain the argument names on functions.

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 33e1bfc65a..86bed0113c 100644
--- a/engines/director/lingo/lingo-bytecode.cpp
+++ b/engines/director/lingo/lingo-bytecode.cpp
@@ -1456,11 +1456,20 @@ ScriptContext *Lingo::compileLingoV4(Common::SeekableReadStreamEndian &stream, L
 		}
 
 		if (!skipdump && ConfMan.getBool("dump_scripts")) {
-			if (0 <= nameIndex && nameIndex < (int16)archive->names.size())
-				out.writeString(Common::String::format("function %s, %d args\n", archive->names[nameIndex].c_str(), argCount));
-			else
+			if (0 <= nameIndex && nameIndex < (int16)archive->names.size()) {
+				Common::String res = Common::String::format("function %s, %d args", archive->names[nameIndex].c_str(), argCount);
+				if (argCount != 0)
+					res += ": ";
+				for (int argIndex = 0;  argIndex < argCount; argIndex++) {
+					res += (*argNames)[argIndex].c_str();
+					if (argIndex < (argCount - 1))
+						res += ", ";
+				}
+				res += "\n";
+				out.writeString(res.c_str());
+			} else {
 				out.writeString(Common::String::format("<noname>, %d args\n", argCount));
-
+			}
 			uint pc = 0;
 			while (pc < _currentAssembly->size()) {
 				uint spc = pc;




More information about the Scummvm-git-logs mailing list