[Scummvm-git-logs] scummvm master -> 6c9aefe5ae4a6db45a6b08fa606a0921de240218

sev- sev at scummvm.org
Sat Feb 15 21:04:53 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:
90020ebdef DIRECTOR: LINGO: Implemented ARRAY variable.
cac2124dd5 DIRECTOR: LINGO: Pass by reference.
6c9aefe5ae DIRECTOR: LINGO: Remove ARRAY from print


Commit: 90020ebdef41ddffe3f4acd3bcb5c55cc6f4a676
    https://github.com/scummvm/scummvm/commit/90020ebdef41ddffe3f4acd3bcb5c55cc6f4a676
Author: Roland van Laar (roland at rolandvanlaar.nl)
Date: 2020-02-15T22:04:48+01:00

Commit Message:
DIRECTOR: LINGO: Implemented ARRAY variable.

Arrays can be assigned to variables and those variables can be fetched.
Includes implementation to `put` the array.

Changed paths:
    engines/director/lingo/lingo-code.cpp
    engines/director/lingo/lingo-codegen.cpp


diff --git a/engines/director/lingo/lingo-code.cpp b/engines/director/lingo/lingo-code.cpp
index e8605db..94e5acc 100644
--- a/engines/director/lingo/lingo-code.cpp
+++ b/engines/director/lingo/lingo-code.cpp
@@ -226,6 +226,9 @@ void LC::c_printtop(void) {
 	case OBJECT:
 		warning("#%s", d.u.s->c_str());
 		break;
+	case ARRAY:
+		warning("ARRAY: %s", d.toString()->c_str());
+		break;
 	default:
 		warning("--unknown--");
 	}
@@ -373,7 +376,7 @@ void LC::c_assign() {
 }
 
 bool LC::verify(Symbol *s) {
-	if (s->type != INT && s->type != VOID && s->type != FLOAT && s->type != STRING && s->type != POINT && s->type != SYMBOL) {
+	if (s->type != INT && s->type != VOID && s->type != FLOAT && s->type != STRING && s->type != POINT && s->type != SYMBOL && s->type != ARRAY) {
 		warning("attempt to evaluate non-variable '%s'", s->name.c_str());
 
 		return false;
diff --git a/engines/director/lingo/lingo-codegen.cpp b/engines/director/lingo/lingo-codegen.cpp
index 27b0a25..c3b63fe 100644
--- a/engines/director/lingo/lingo-codegen.cpp
+++ b/engines/director/lingo/lingo-codegen.cpp
@@ -527,6 +527,8 @@ void Lingo::varAssign(Datum &var, Datum &value) {
 			sym->u.s = value.u.s;
 		} else if (value.type == VOID) {
 			sym->u.i = 0;
+		} else if (value.type == ARRAY) {
+			sym->u.farr = new DatumArray(*value.u.farr);
 		} else {
 			warning("varAssign: unhandled type: %s", value.type2str());
 			sym->u.s = value.u.s;
@@ -586,7 +588,9 @@ Datum Lingo::varFetch(Datum &var) {
 			result.u.i = var.u.sym->u.i;
 		else if (sym->type == VOID)
 			result.u.i = 0;
-		else {
+		else if (sym->type == ARRAY) {
+			result.u.farr = sym->u.farr;
+		} else {
 			warning("varFetch: unhandled type: %s", var.type2str());
 			result.type = VOID;
 		}


Commit: cac2124dd5a94e9c6a6b29f7fb1fc3095d81cea3
    https://github.com/scummvm/scummvm/commit/cac2124dd5a94e9c6a6b29f7fb1fc3095d81cea3
Author: Roland van Laar (roland at rolandvanlaar.nl)
Date: 2020-02-15T22:04:48+01:00

Commit Message:
DIRECTOR: LINGO: Pass by reference.

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


diff --git a/engines/director/lingo/lingo-codegen.cpp b/engines/director/lingo/lingo-codegen.cpp
index c3b63fe..6a00eba 100644
--- a/engines/director/lingo/lingo-codegen.cpp
+++ b/engines/director/lingo/lingo-codegen.cpp
@@ -528,7 +528,7 @@ void Lingo::varAssign(Datum &var, Datum &value) {
 		} else if (value.type == VOID) {
 			sym->u.i = 0;
 		} else if (value.type == ARRAY) {
-			sym->u.farr = new DatumArray(*value.u.farr);
+			sym->u.farr = value.u.farr;
 		} else {
 			warning("varAssign: unhandled type: %s", value.type2str());
 			sym->u.s = value.u.s;


Commit: 6c9aefe5ae4a6db45a6b08fa606a0921de240218
    https://github.com/scummvm/scummvm/commit/6c9aefe5ae4a6db45a6b08fa606a0921de240218
Author: Roland van Laar (roland at rolandvanlaar.nl)
Date: 2020-02-15T22:04:48+01:00

Commit Message:
DIRECTOR: LINGO: Remove ARRAY from print

Adviced by Sev in the pullrequest.

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


diff --git a/engines/director/lingo/lingo-code.cpp b/engines/director/lingo/lingo-code.cpp
index 94e5acc..5c4e44b 100644
--- a/engines/director/lingo/lingo-code.cpp
+++ b/engines/director/lingo/lingo-code.cpp
@@ -227,7 +227,7 @@ void LC::c_printtop(void) {
 		warning("#%s", d.u.s->c_str());
 		break;
 	case ARRAY:
-		warning("ARRAY: %s", d.toString()->c_str());
+		warning("%s", d.toString()->c_str());
 		break;
 	default:
 		warning("--unknown--");




More information about the Scummvm-git-logs mailing list