[Scummvm-git-logs] scummvm master -> 2ecdfd2979603250ed2ac70e5cbf2b0dfed8dee4

djsrv dservilla at gmail.com
Fri Aug 14 04:42:35 UTC 2020


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

Summary:
e1e7801f80 DIRECTOR: LINGO: Fix the entity fields
465281569a DIRECTOR: LINGO: Add missing V4 the entity fields
31458389f7 JANITORIAL: Remove extra newline
e5815a874f DIRECTOR: LINGO: Allow cast refs in castIdFetch
2ecdfd2979 DIRECTOR: LINGO: Fix castrefs in get/setObjectProp


Commit: e1e7801f80c49ab75d73e6f72dad4100c431823c
    https://github.com/scummvm/scummvm/commit/e1e7801f80c49ab75d73e6f72dad4100c431823c
Author: djsrv (dservilla at gmail.com)
Date: 2020-08-14T00:15:15-04:00

Commit Message:
DIRECTOR: LINGO: Fix the entity fields

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


diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp
index a3a64ca227..ccb69bccc3 100644
--- a/engines/director/lingo/lingo-the.cpp
+++ b/engines/director/lingo/lingo-the.cpp
@@ -190,8 +190,10 @@ TheEntityField fields[] = {
 	{ kTheSprite,	"width",		kTheWidth,		200 },// D2 p
 
 	// Common cast fields
+	{ kTheCast,		"backColor",	kTheBackColor,	400 },//				D4 p
 	{ kTheCast,		"castType",		kTheCastType,	400 },//				D4 p
 	{ kTheCast,		"filename",		kTheFileName,	400 },//				D4 p
+	{ kTheCast,		"foreColor",	kTheForeColor,	400 },//				D4 p
 	{ kTheCast,		"height",		kTheHeight,		400 },//				D4 p
 	{ kTheCast,		"loaded",		kTheLoaded,		400 },//				D4 p
 	{ kTheCast,		"modified",		kTheModified,	400 },//				D4 p
@@ -200,12 +202,9 @@ TheEntityField fields[] = {
 	{ kTheCast,		"rect",			kTheRect,		400 },//				D4 p
 	{ kTheCast,		"purgePriority",kThePurgePriority,400 },//				D4 p // 0 Never purge, 1 Purge Last, 2 Purge next, 2 Purge normal
 	{ kTheCast,		"scriptText",	kTheScriptText,	400 },//				D4 p
+	{ kTheCast,		"size",			kTheSize,		300 },//		D3.1 p
 	{ kTheCast,		"width",		kTheWidth,		400 },//				D4 p
 
-	// Shape fields
-	{ kTheCast,		"backColor",	kTheBackColor,	400 },//				D4 p
-	{ kTheCast,		"foreColor",	kTheForeColor,	400 },//				D4 p
-
 	// Digital video fields
 	{ kTheCast,		"center",		kTheCenter,		400 },//				D4 p
 	{ kTheCast,		"controller",	kTheController,	300 },//		D3.1 p
@@ -232,11 +231,18 @@ TheEntityField fields[] = {
 
 	// TextCastMember fields
 	{ kTheCast,		"hilite",		kTheHilite,		200 },// D2 p
-	{ kTheCast,		"size",			kTheSize,		300 },//		D3.1 p
 	{ kTheCast,		"text",			kTheText,		200 },// D2 p
+	{ kTheCast,		"textAlign",	kTheTextAlign,	300 },//		D3 p
+	{ kTheCast,		"textFont",		kTheTextFont,	300 },//		D3 p
+	{ kTheCast,		"textHeight",	kTheTextHeight,	300 },//		D3 p
+	{ kTheCast,		"textSize",		kTheTextSize,	300 },//		D3 p
+	{ kTheCast,		"textStyle",	kTheTextStyle,	300 },//		D3 p
 
 	// Field fields
-	{ kTheField,	"text",			kTheText,		300 },// 		D3 p undocumented
+	{ kTheField,	"foreColor",	kTheForeColor,	400 },//				D4 p
+	{ kTheField,	"hilite",		kTheHilite,		200 },// D2 p
+	{ kTheField,	"name",			kTheName,		300 },//		D3 p
+	{ kTheField,	"text",			kTheText,		200 },// D2 p
 	{ kTheField,	"textAlign",	kTheTextAlign,	300 },//		D3 p
 	{ kTheField,	"textFont",		kTheTextFont,	300 },//		D3 p
 	{ kTheField,	"textHeight",	kTheTextHeight,	300 },//		D3 p


Commit: 465281569a18876ea14f5b42624e7fe0f077fa29
    https://github.com/scummvm/scummvm/commit/465281569a18876ea14f5b42624e7fe0f077fa29
Author: djsrv (dservilla at gmail.com)
Date: 2020-08-14T00:15:54-04:00

Commit Message:
DIRECTOR: LINGO: Add missing V4 the entity fields

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 8995423f12..e7bfd54a6c 100644
--- a/engines/director/lingo/lingo-bytecode.cpp
+++ b/engines/director/lingo/lingo-bytecode.cpp
@@ -257,14 +257,19 @@ static LingoV4TheEntity lingoV4TheEntity[] = {
 	{ 0x09, 0x11, kTheCast,				kTheForeColor,		true, kTEAItemId },
 	{ 0x09, 0x12, kTheCast,				kTheBackColor,		true, kTEAItemId },
 
+	{ 0x09, 0x01, kTheField,			kTheName,			true, kTEAItemId },
+	{ 0x09, 0x02, kTheField,			kTheText,			true, kTEAItemId },
+	{ 0x09, 0x09, kTheField,			kTheHilite,			true, kTEAItemId },
 	{ 0x0b, 0x03, kTheField,			kTheTextStyle,		true, kTEAItemId },
 	{ 0x0b, 0x04, kTheField,			kTheTextFont,		true, kTEAItemId },
 	{ 0x0b, 0x05, kTheField,			kTheTextHeight,		true, kTEAItemId },
 	{ 0x0b, 0x06, kTheField,			kTheTextAlign,		true, kTEAItemId },
 	{ 0x0b, 0x07, kTheField,			kTheTextSize,		true, kTEAItemId },
+	{ 0x09, 0x11, kTheCast,				kTheForeColor,		true, kTEAItemId },
 
 	{ 0x0d, 0x0c, kTheCast,				kTheLoop,			true, kTEAItemId },
 	{ 0x0d, 0x0d, kTheCast,				kTheDuration,		true, kTEAItemId },
+	{ 0x0d, 0x0e, kTheCast,				kTheController,		true, kTEAItemId },
 	{ 0x0d, 0x0f, kTheCast,				kTheDirectToStage,	true, kTEAItemId },
 	{ 0x0d, 0x10, kTheCast,				kTheSound,			true, kTEAItemId },
 


Commit: 31458389f74288b405076aef3cdbfb8c731387fa
    https://github.com/scummvm/scummvm/commit/31458389f74288b405076aef3cdbfb8c731387fa
Author: djsrv (dservilla at gmail.com)
Date: 2020-08-14T00:22:10-04:00

Commit Message:
JANITORIAL: Remove extra newline

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


diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp
index ccb69bccc3..5b811e3b1e 100644
--- a/engines/director/lingo/lingo-the.cpp
+++ b/engines/director/lingo/lingo-the.cpp
@@ -1516,7 +1516,6 @@ Datum Lingo::getTheField(Datum &id1, int field) {
 		return d;
 	}
 
-
 	if (!member->hasField(field)) {
 		warning("Lingo::getTheField(): CastMember %d has no property '%s'", id, field2str(field));
 		return d;


Commit: e5815a874f253383d955ff78036f8540f14685c5
    https://github.com/scummvm/scummvm/commit/e5815a874f253383d955ff78036f8540f14685c5
Author: djsrv (dservilla at gmail.com)
Date: 2020-08-14T00:31:58-04:00

Commit Message:
DIRECTOR: LINGO: Allow cast refs in castIdFetch

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


diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp
index 979e0e91ed..4e9521b074 100644
--- a/engines/director/lingo/lingo.cpp
+++ b/engines/director/lingo/lingo.cpp
@@ -1232,7 +1232,7 @@ int Lingo::castIdFetch(Datum &var) {
 			id = member->getID();
 		else
 			warning("castIdFetch: reference to non-existent cast member: %s", var.u.s->c_str());
-	} else if (var.type == INT || var.type == FLOAT) {
+	} else if (var.type == INT || var.type == FLOAT || var.type == CASTREF || var.type == FIELDREF) {
 		int castId = var.asInt();
 		if (!_vm->getCurrentMovie()->getCastMember(castId))
 			warning("castIdFetch: reference to non-existent cast ID: %d", castId);


Commit: 2ecdfd2979603250ed2ac70e5cbf2b0dfed8dee4
    https://github.com/scummvm/scummvm/commit/2ecdfd2979603250ed2ac70e5cbf2b0dfed8dee4
Author: djsrv (dservilla at gmail.com)
Date: 2020-08-14T00:41:22-04:00

Commit Message:
DIRECTOR: LINGO: Fix castrefs in get/setObjectProp

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


diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp
index 5b811e3b1e..f8138927ca 100644
--- a/engines/director/lingo/lingo-the.cpp
+++ b/engines/director/lingo/lingo-the.cpp
@@ -1567,14 +1567,29 @@ Datum Lingo::getObjectProp(Datum &obj, Common::String &propName) {
 			d = obj.u.parr->operator[](index - 1).v;
 		}
 		return d;
-	} else if (obj.type == CASTREF) {
-		// WORKAROUND: Until CastMembers are made Lingo objects
-		if (propName.equalsIgnoreCase("palette")) {
-			d.type = INT;
-			CastMember *member = _vm->getCurrentMovie()->getCastMember(obj.u.i);
+	} else if (obj.type == CASTREF || obj.type == FIELDREF) {
+		Movie *movie = _vm->getCurrentMovie();
+		if (!movie) {
+			warning("Lingo::getObjectProp(): No movie loaded");
+			return d;
+		}
 
-			if (member && member->_type == kCastBitmap)
-				d.u.i = ((BitmapCastMember *)member)->_clut + 1;
+		int id = g_lingo->castIdFetch(obj);
+
+		CastMember *member = movie->getCastMember(id);
+		if (!member) {
+			warning("Lingo::getObjectProp(): CastMember %d not found", id);
+			return d;
+		}
+		if (obj.type == FIELDREF && member->_type != kCastText) {
+			warning("Lingo::getObjectProp(): CastMember %d is not a field", id);
+			return d;
+		}
+
+		if (member->hasProp(propName)) {
+			return member->getProp(propName);
+		} else {
+			warning("Lingo::getObjectProp(): CastMember %d has no property '%s'", id, propName.c_str());
 		}
 	} else {
 		warning("Lingo::getObjectProp: Invalid object: %s", obj.asString(true).c_str());
@@ -1597,13 +1612,29 @@ void Lingo::setObjectProp(Datum &obj, Common::String &propName, Datum &val) {
 			PCell cell = PCell(propName, val);
 			obj.u.parr->push_back(cell);
 		}
-	} else if (obj.type == CASTREF) {
-		// WORKAROUND: Until CastMembers are made Lingo objects
-		if (propName.equalsIgnoreCase("palette")) {
-			CastMember *member = _vm->getCurrentMovie()->getCastMember(obj.u.i);
+	} else if (obj.type == CASTREF || obj.type == FIELDREF) {
+		Movie *movie = _vm->getCurrentMovie();
+		if (!movie) {
+			warning("Lingo::setObjectProp(): No movie loaded");
+			return;
+		}
+
+		int id = g_lingo->castIdFetch(obj);
+
+		CastMember *member = movie->getCastMember(id);
+		if (!member) {
+			warning("Lingo::setObjectProp(): CastMember %d not found", id);
+			return;
+		}
+		if (obj.type == FIELDREF && member->_type != kCastText) {
+			warning("Lingo::setObjectProp(): CastMember %d is not a field", id);
+			return;
+		}
 
-			if (member && member->_type == kCastBitmap)
-				((BitmapCastMember *)member)->_clut = val.asInt();
+		if (member->hasProp(propName)) {
+			member->setProp(propName, val);
+		} else {
+			warning("Lingo::setObjectProp(): CastMember %d has no property '%s'", id, propName.c_str());
 		}
 	} else {
 		warning("Lingo::setObjectProp: Invalid object: %s", obj.asString(true).c_str());




More information about the Scummvm-git-logs mailing list