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

sev- noreply at scummvm.org
Tue Jun 14 21:27:36 UTC 2022


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:
a2a37604ce DIRECTOR: LINGO: Implement setting of ForeColor and BackColor properties of CastMember


Commit: a2a37604ce60e8bffc85d04fea0149e8aa47db1a
    https://github.com/scummvm/scummvm/commit/a2a37604ce60e8bffc85d04fea0149e8aa47db1a
Author: Pragyansh Chaturvedi (r41k0u) (pragyanshchaturvedi18 at gmail.com)
Date: 2022-06-14T23:27:33+02:00

Commit Message:
DIRECTOR: LINGO: Implement setting of ForeColor and BackColor properties of CastMember

Changed paths:
    engines/director/castmember.cpp
    engines/director/castmember.h
    engines/director/lingo/lingo-object.cpp


diff --git a/engines/director/castmember.cpp b/engines/director/castmember.cpp
index bc7b8479287..ba34dd5f694 100644
--- a/engines/director/castmember.cpp
+++ b/engines/director/castmember.cpp
@@ -958,6 +958,16 @@ Graphics::TextAlign TextCastMember::getAlignment() {
 	}
 }
 
+void TextCastMember::setBackColor(uint32 bgCol) {
+	_bgcolor = bgCol;
+	_modified = true;
+}
+
+void TextCastMember::setForeColor(uint32 fgCol) {
+	_fgcolor = fgCol;
+	_modified = true;
+}
+
 void TextCastMember::importStxt(const Stxt *stxt) {
 	_fontId = stxt->_style.fontId;
 	_textSlant = stxt->_style.textSlant;
@@ -1144,6 +1154,16 @@ ShapeCastMember::ShapeCastMember(Cast *cast, uint16 castId, Common::SeekableRead
 		_initialRect.debugPrint(0, "ShapeCastMember: rect:");
 }
 
+void ShapeCastMember::setBackColor(uint32 bgCol) {
+	_bgCol = bgCol;
+	_modified = true;
+}
+
+void ShapeCastMember::setForeColor(uint32 fgCol) {
+	_fgCol = fgCol;
+	_modified = true;
+}
+
 
 /////////////////////////////////////
 // Script
diff --git a/engines/director/castmember.h b/engines/director/castmember.h
index 27ee98750b2..20379449306 100644
--- a/engines/director/castmember.h
+++ b/engines/director/castmember.h
@@ -81,7 +81,9 @@ public:
 
 	virtual void setColors(uint32 *fgcolor, uint32 *bgcolor) { return; }
 	virtual uint32 getForeColor() { return 0; }
+	virtual void setForeColor(uint32 fgCol) { return; }
 	virtual uint32 getBackColor() { return 0; }
+	virtual void setBackColor(uint32 bgCol) { return; }
 
 	bool hasProp(const Common::String &propName) override;
 	Datum getProp(const Common::String &propName) override;
@@ -231,6 +233,8 @@ public:
 	ShapeCastMember(Cast *cast, uint16 castId, Common::SeekableReadStreamEndian &stream, uint16 version);
 	uint32 getForeColor() override { return _fgCol; }
 	uint32 getBackColor() override { return _bgCol; }
+	void setBackColor(uint32 bgCol) override;
+	void setForeColor(uint32 fgCol) override;
 
 	ShapeType _shapeType;
 	uint16 _pattern;
@@ -258,7 +262,9 @@ public:
 	Graphics::TextAlign getAlignment();
 
 	uint32 getBackColor() override { return _bgcolor; }
+	void setBackColor(uint32 bgCol) override;
 	uint32 getForeColor() override { return _fgcolor; }
+	void setForeColor(uint32 fgCol) override;
 
 	bool hasField(int field) override;
 	Datum getField(int field) override;
diff --git a/engines/director/lingo/lingo-object.cpp b/engines/director/lingo/lingo-object.cpp
index 1ddbd5ea4e7..98d9503bc11 100644
--- a/engines/director/lingo/lingo-object.cpp
+++ b/engines/director/lingo/lingo-object.cpp
@@ -700,8 +700,8 @@ bool CastMember::setField(int field, const Datum &d) {
 
 	switch (field) {
 	case kTheBackColor:
-		warning("STUB: CastMember::setField(): Unprocessed setting field \"%s\" of cast %d", g_lingo->field2str(field), _castId);
-		return false;
+		_cast->getCastMember(_castId)->setBackColor(d.asInt());
+		return true;
 	case kTheCastType:
 		warning("BUILDBOT: CastMember::setField(): Attempt to set read-only field %s of cast %d", g_lingo->entity2str(field), _castId);
 		return false;
@@ -713,8 +713,8 @@ bool CastMember::setField(int field, const Datum &d) {
 		castInfo->fileName = d.asString();
 		return true;
 	case kTheForeColor:
-		warning("STUB: CastMember::setField(): Unprocessed setting field \"%s\" of cast %d", g_lingo->field2str(field), _castId);
-		return false;
+		_cast->getCastMember(_castId)->setForeColor(d.asInt());
+		return true;
 	case kTheHeight:
 		warning("BUILDBOT: CastMember::setField(): Attempt to set read-only field \"%s\" of cast %d", g_lingo->field2str(field), _castId);
 		return false;




More information about the Scummvm-git-logs mailing list