[Scummvm-git-logs] scummvm master -> 98d78bcd433c7ab3e232cce75ce46748088bac9f

sev- noreply at scummvm.org
Sun Sep 7 23:28:03 UTC 2025


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

Summary:
9394209c9f DIRECTOR: Added Sprite flags hid in thickness
a150ea2e25 DIRECTOR: LINGO: Added D6 Sprite properties
98d78bcd43 DIRECTOR: LINGO: Added stubs for the rest of sprite thickness flags


Commit: 9394209c9fb410c35326673b507628d29e83d950
    https://github.com/scummvm/scummvm/commit/9394209c9fb410c35326673b507628d29e83d950
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-09-08T01:27:48+02:00

Commit Message:
DIRECTOR: Added Sprite flags hid in thickness

That byte contains bunch of flags. Processed few of them,
now the blend flag is followed.

Removed unused _blend Sprite variable

Changed paths:
    engines/director/channel.cpp
    engines/director/frame.cpp
    engines/director/lingo/lingo-the.cpp
    engines/director/sprite.cpp
    engines/director/sprite.h


diff --git a/engines/director/channel.cpp b/engines/director/channel.cpp
index 7dd15e0268e..6e6bd046ece 100644
--- a/engines/director/channel.cpp
+++ b/engines/director/channel.cpp
@@ -107,7 +107,8 @@ Channel::~Channel() {
 }
 
 DirectorPlotData Channel::getPlotData() {
-	DirectorPlotData pd(g_director, _sprite->_spriteType, _sprite->_ink, _sprite->_blendAmount, _sprite->getBackColor(), _sprite->getForeColor());
+	int blend = (_sprite->_thickness & kTHasBlend) || _sprite->_ink == kInkTypeBlend ? _sprite->_blendAmount : 0;
+	DirectorPlotData pd(g_director, _sprite->_spriteType, _sprite->_ink, blend, _sprite->getBackColor(), _sprite->getForeColor());
 	pd.colorWhite = g_director->getColorWhite();
 	pd.colorBlack = g_director->getColorBlack();
 	pd.dst = nullptr;
@@ -154,7 +155,7 @@ const Graphics::Surface *Channel::getMask(bool forceMatte) {
 		_sprite->_ink == kInkTypeLight ||
 		_sprite->_ink == kInkTypeSub ||
 		_sprite->_ink == kInkTypeDark ||
-		_sprite->_blendAmount > 0;
+		(((_sprite->_thickness & kTHasBlend) || _sprite->_ink == kInkTypeBlend) && _sprite->_blendAmount > 0);
 
 	Common::Rect bbox(getBbox());
 
@@ -253,7 +254,7 @@ bool Channel::isDirty(Sprite *nextSprite) {
 		// modified.
 		isDirtyFlag |= _sprite->_castId != nextSprite->_castId ||
 			_sprite->_ink != nextSprite->_ink || _sprite->_backColor != nextSprite->_backColor ||
-			_sprite->_foreColor != nextSprite->_foreColor || _sprite->_blend != nextSprite->_blend ||
+			_sprite->_foreColor != nextSprite->_foreColor ||
 			_sprite->_blendAmount != nextSprite->_blendAmount || _sprite->_thickness != nextSprite->_thickness;
 		if (!_sprite->_moveable)
 			isDirtyFlag |= _sprite->getPosition() != nextSprite->getPosition();
diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index a3a75f19cc5..557ac596117 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -688,7 +688,7 @@ void readSpriteDataD4(Common::SeekableReadStreamEndian &stream, Sprite &sprite,
 			if (sprite._puppet) {
 				stream.readByte();
 			} else {
-				sprite._thickness = stream.readByte() & 0x7f;
+				sprite._thickness = stream.readByte();
 			}
 			break;
 		case 5:
@@ -1142,7 +1142,7 @@ void readSpriteDataD5(Common::SeekableReadStreamEndian &stream, Sprite &sprite,
 			if (sprite._puppet) {
 				stream.readByte();
 			} else {
-				sprite._thickness = stream.readByte() & 0x7f;
+				sprite._thickness = stream.readByte();
 			}
 			break;
 		case 23:
@@ -1601,7 +1601,7 @@ void readSpriteDataD6(Common::SeekableReadStreamEndian &stream, Sprite &sprite,
 			if (sprite._puppet) {
 				stream.readByte();
 			} else {
-				sprite._thickness = stream.readByte() & 0x7f;
+				sprite._thickness = stream.readByte();
 			}
 			break;
 		case 23:
@@ -2054,7 +2054,7 @@ void readSpriteDataD7(Common::SeekableReadStreamEndian &stream, Sprite &sprite,
 			if (sprite._puppet) {
 				stream.readByte();
 			} else {
-				sprite._thickness = stream.readByte() & 0x7f;
+				sprite._thickness = stream.readByte();
 			}
 			break;
 		case 23:
@@ -2160,13 +2160,13 @@ Common::String Frame::formatChannelInfo() {
 	for (int i = 0; i < _numChannels; i++) {
 		Sprite &sprite = *_sprites[i + 1];
 		if (sprite._castId.member) {
-			result += Common::String::format("CH: %-3d castId: %s, [inkData: 0x%02x [ink: %d, trails: %d, stretch: %d, line: %d], %dx%d@%d,%d type: %d (%s) fg: %d bg: %d], script: %s, colorcode: 0x%x, blendAmount: 0x%x, blend: 0x%x, unk3: 0x%x\n",
+			result += Common::String::format("CH: %-3d castId: %s, [inkData: 0x%02x [ink: %d, trails: %d, stretch: %d, line: %d], %dx%d@%d,%d type: %d (%s) fg: %d bg: %d], script: %s, colorcode: 0x%x, blendAmount: 0x%x, unk3: 0x%x\n",
 				i + 1, sprite._castId.asString().c_str(), sprite._inkData,
 				sprite._ink, sprite._trails, sprite._stretch, sprite._thickness, sprite._width, sprite._height,
 				sprite._startPoint.x, sprite._startPoint.y,
 				sprite._spriteType, spriteType2str(sprite._spriteType), sprite._foreColor,
 				sprite._backColor, sprite._scriptId.asString().c_str(), sprite._colorcode,
-				sprite._blendAmount, sprite._blend, sprite._unk3);
+				sprite._blendAmount, sprite._unk3);
 		} else {
 			result += Common::String::format("CH: %-3d castId: 000\n", i + 1);
 		}
diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp
index ece1506faca..5cb6c09826b 100644
--- a/engines/director/lingo/lingo-the.cpp
+++ b/engines/director/lingo/lingo-the.cpp
@@ -1548,7 +1548,7 @@ Datum Lingo::getTheSprite(Datum &id1, int field) {
 		d = channel->getBbox().left;
 		break;
 	case kTheLineSize:
-		d = sprite->_thickness & 0x3;
+		d = (sprite->_thickness & kTThickness) - 1;
 		break;
 	case kTheLoc:
 		{
@@ -1690,8 +1690,14 @@ void Lingo::setTheSprite(Datum &id1, int field, Datum &d) {
 				channel->_dirty = true;
 			}
 
+			if (d.asInt() == 0)
+				sprite->_thickness &= ~kTHasBlend;
+			else
+				sprite->_thickness |= kTHasBlend;
+
 			// Based on Director in a Nutshell, page 15
 			sprite->setAutoPuppet(kAPBlend, true);
+			sprite->setAutoPuppet(kAPThickness, true);
 		}
 		break;
 	case kTheMember:
@@ -1816,10 +1822,10 @@ void Lingo::setTheSprite(Datum &id1, int field, Datum &d) {
 
 		break;
 	case kTheLineSize:
-		if (d.asInt() != sprite->_thickness) {
-			sprite->_thickness = d.asInt();
-			channel->_dirty = true;
-		}
+		sprite->_thickness = (sprite->_thickness & ~kTThickness) | ((d.asInt() + 1) & kTThickness);
+		channel->_dirty = true;
+
+		sprite->setAutoPuppet(kAPThickness, true);
 		break;
 	case kTheLoc:
 		if (channel->getPosition() != d.asPoint()) {
diff --git a/engines/director/sprite.cpp b/engines/director/sprite.cpp
index ee263c87d14..009cbf98bcd 100644
--- a/engines/director/sprite.cpp
+++ b/engines/director/sprite.cpp
@@ -71,8 +71,6 @@ void Sprite::reset() {
 	_backColor = g_director->_wm->_colorWhite;
 	_foreColor = g_director->_wm->_colorWhite;
 
-	_blend = 0;
-
 	_volume = 0;
 	_stretch = false;
 
@@ -126,8 +124,6 @@ Sprite& Sprite::operator=(const Sprite &sprite) {
 	_backColor = sprite._backColor;
 	_foreColor = sprite._foreColor;
 
-	_blend = sprite._blend;
-
 	_volume = sprite._volume;
 	_stretch = sprite._stretch;
 
@@ -155,7 +151,7 @@ bool Sprite::operator==(const Sprite &sprite) {
 		_backColor == sprite._backColor &&
 		_blendAmount == sprite._blendAmount &&
 		_ink == sprite._ink &&
-		_thickness == sprite._thickness;
+		(_thickness | kTTweened) == (sprite._thickness | kTTweened);
 }
 
 Sprite::Sprite(const Sprite &sprite) {
@@ -253,7 +249,7 @@ MacShape *Sprite::getShape() {
 	shape->spriteType = _spriteType;
 	shape->foreColor = _foreColor;
 	shape->backColor = _backColor;
-	shape->lineSize = _thickness & 0x3;
+	shape->lineSize = _thickness & kTThickness;
 	shape->pattern = getPattern();
 	shape->tile = nullptr;
 	shape->tileRect = nullptr;
diff --git a/engines/director/sprite.h b/engines/director/sprite.h
index b9d64a532d4..99f86104651 100644
--- a/engines/director/sprite.h
+++ b/engines/director/sprite.h
@@ -51,6 +51,16 @@ enum AutoPuppetProperty {
 	kAPMoveable,
 	kAPRect,
 	kAPWidth,
+	kAPThickness,
+};
+
+enum ThicknessFlags {
+	kTThickness = 0x0F,
+	kTHasBlend  = 0x10,
+	kTFlipH     = 0x20,
+	kTFlipV     = 0x40,
+	kTFlip      = (kTFlipH | kTFlipV),
+	kTTweened   = 0x80,
 };
 
 class Sprite {
@@ -135,8 +145,6 @@ public:
 	uint32 _backColor;
 	uint32 _foreColor;
 
-	byte _blend;
-
 	byte _volume;
 	bool _stretch;
 


Commit: a150ea2e2511117e29aa1d6f232fe4b504692265
    https://github.com/scummvm/scummvm/commit/a150ea2e2511117e29aa1d6f232fe4b504692265
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-09-08T01:27:48+02:00

Commit Message:
DIRECTOR: LINGO: Added D6 Sprite properties

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


diff --git a/engines/director/lingo/lingo-bytecode.cpp b/engines/director/lingo/lingo-bytecode.cpp
index 1945f171b69..f1ae36a75cf 100644
--- a/engines/director/lingo/lingo-bytecode.cpp
+++ b/engines/director/lingo/lingo-bytecode.cpp
@@ -214,11 +214,11 @@ static const LingoV4TheEntity lingoV4TheEntity[] = {
 	{ 0x06, 0x23, kTheSprite,			kTheMemberNum,		true, kTEAItemId }, // D5
 	{ 0x06, 0x24, kTheSprite, 			kTheCastLibNum, 	true, kTEAItemId }, // D5
 	{ 0x06, 0x25, kTheSprite,			kTheMember,			true, kTEAItemId }, // D5
-	// scriptInstanceList
-	// currentTime
-	// mostRecentCuePoint
-	// tweened
-	// name
+	{ 0x06, 0x26, kTheSprite,			kTheScriptInstanceList,	true, kTEAItemId }, // D6
+	{ 0x06, 0x27, kTheSprite,			kTheCurrentTime,	true, kTEAItemId }, // D6
+	{ 0x06, 0x28, kTheSprite,			kTheMostRecentCuePoint,	true, kTEAItemId }, // D6
+	{ 0x06, 0x29, kTheSprite,			kTheTweened,		true, kTEAItemId }, // D6
+	{ 0x06, 0x2a, kTheSprite,			kTheName,			true, kTEAItemId }, // D6
 
 	{ 0x07, 0x01, kTheBeepOn,			kTheNOField,		true, kTEANOArgs },
 	{ 0x07, 0x02, kTheButtonStyle,		kTheNOField,		true, kTEANOArgs },
diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp
index 5cb6c09826b..2658462844a 100644
--- a/engines/director/lingo/lingo-the.cpp
+++ b/engines/director/lingo/lingo-the.cpp
@@ -192,6 +192,7 @@ const TheEntityField fields[] = {
 	{ kTheSprite,	"castNum",		kTheCastNum,	200 },// D2 p
 	{ kTheSprite,	"castLibNum",	kTheCastLibNum,	500 },//					D5 p
 	{ kTheSprite,	"constraint",	kTheConstraint, 200 },// D2 p
+	{ kTheSprite,	"currentTime",	kTheCurrentTime,600 },//							D6 p
 	{ kTheSprite,	"cursor",		kTheCursor,		200 },// D2 p
 	{ kTheSprite,	"editableText", kTheEditableText,400 },//				D4 p
 	{ kTheSprite,	"foreColor",	kTheForeColor,	200 },// D2 p
@@ -203,17 +204,22 @@ const TheEntityField fields[] = {
 	{ kTheSprite,	"loc",			kTheLoc,		400 },//				D4 p ???
 	{ kTheSprite,	"locH",			kTheLocH,		200 },// D2 p
 	{ kTheSprite,	"locV",			kTheLocV,		200 },// D2 p
+	{ kTheSprite,	"member",		kTheMember,		500 },//					D5 p
 	{ kTheSprite,	"memberNum",	kTheMemberNum,	500 },//					D5 p
 	{ kTheSprite,	"moveableSprite",kTheMoveableSprite,400 },//			D4 p
+	{ kTheSprite,	"mostRecentCuePoint",kTheMostRecentCuePoint,600 },//				D6 p
+	{ kTheSprite,	"name",			kTheName,		600 },//							D6 p
 	{ kTheSprite,	"pattern",		kThePattern,	200 },// D2 p
 	{ kTheSprite,	"puppet",		kThePuppet,		200 },// D2 p
 	{ kTheSprite,	"rect",			kTheRect,		400 },//				D4 p ???
 	{ kTheSprite,	"right",		kTheRight,		200 },// D2 p
 	{ kTheSprite,	"scoreColor",	kTheScoreColor,	400 },//				D4 p
+	{ kTheSprite,	"scriptInstanceList",kTheScriptInstanceList,600 },//				D6 p
 	{ kTheSprite,	"scriptNum",	kTheScriptNum,	400 },//				D4 p
-	{ kTheSprite,	"stretch",		kTheStretch,		200 },// D2 p
+	{ kTheSprite,	"stretch",		kTheStretch,	200 },// D2 p
 	{ kTheSprite,	"top",			kTheTop,		200 },// D2 p
 	{ kTheSprite,	"trails",		kTheTrails,		300 },//		D3.1 p
+	{ kTheSprite,	"tweened",		kTheTweened,	600 },//							D6 p
 	{ kTheSprite,	"type",			kTheType,		200 },// D2 p
 	{ kTheSprite,	"visibility",	kTheVisibility,	300 },//		D3.1 p
 	{ kTheSprite,	"visible",		kTheVisible,	400 },//				D4 p
diff --git a/engines/director/lingo/lingo-the.h b/engines/director/lingo/lingo-the.h
index 8615559c1e1..caf684d1596 100644
--- a/engines/director/lingo/lingo-the.h
+++ b/engines/director/lingo/lingo-the.h
@@ -193,6 +193,7 @@ enum TheFieldType {
 	kTheConstraint,
 	kTheController,
 	kTheCrop,
+	kTheCurrentTime,
 	kTheCursor,
 	kTheDepth,
 	kTheDigitalVideoType,
@@ -227,6 +228,7 @@ enum TheFieldType {
 	kTheMemberNum,
 	kTheModal,
 	kTheModified,
+	kTheMostRecentCuePoint,
 	kTheMoveableSprite,
 	kTheMovieRate,
 	kTheMovieTime,
@@ -251,6 +253,7 @@ enum TheFieldType {
 	kTheScoreColor,
 	kTheScoreSelection,
 	kTheScript,
+	kTheScriptInstanceList,
 	kTheScriptNum,
 	kTheScriptText,
 	kTheScriptType,
@@ -283,6 +286,7 @@ enum TheFieldType {
 	kTheTrackText,
 	kTheTrails,
 	kTheTransitionType,
+	kTheTweened,
 	kTheType,
 	kTheUpdateLock,
 	kTheVideo,


Commit: 98d78bcd433c7ab3e232cce75ce46748088bac9f
    https://github.com/scummvm/scummvm/commit/98d78bcd433c7ab3e232cce75ce46748088bac9f
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-09-08T01:27:48+02:00

Commit Message:
DIRECTOR: LINGO: Added stubs for the rest of sprite thickness flags

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


diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp
index 2658462844a..ec2268f6545 100644
--- a/engines/director/lingo/lingo-the.cpp
+++ b/engines/director/lingo/lingo-the.cpp
@@ -195,6 +195,8 @@ const TheEntityField fields[] = {
 	{ kTheSprite,	"currentTime",	kTheCurrentTime,600 },//							D6 p
 	{ kTheSprite,	"cursor",		kTheCursor,		200 },// D2 p
 	{ kTheSprite,	"editableText", kTheEditableText,400 },//				D4 p
+	{ kTheSprite,	"flipH",		kTheFlipH,		700 },// 								D7 p
+	{ kTheSprite,	"flipV",		kTheFlipV,		700 },// 								D7 p
 	{ kTheSprite,	"foreColor",	kTheForeColor,	200 },// D2 p
 	{ kTheSprite,	"height",		kTheHeight,		200 },// D2 p
 	{ kTheSprite,	"immediate",	kTheImmediate,	200 },// D2 p
@@ -1537,6 +1539,12 @@ Datum Lingo::getTheSprite(Datum &id1, int field) {
 	case kTheEditableText:
 		d = sprite->_editable;
 		break;
+	case kTheFlipH: // D7
+		d = (sprite->_thickness & kTFlipH) ? 1 : 0;
+		break;
+	case kTheFlipV: // D7
+		d = (sprite->_thickness & kTFlipV) ? 1 : 0;
+		break;
 	case kTheForeColor:
 		// TODO: Provide proper reverse transform for non-indexed color
 		d = (int)g_director->transformColor(sprite->_foreColor);
@@ -1628,6 +1636,9 @@ Datum Lingo::getTheSprite(Datum &id1, int field) {
 	case kTheType:
 		d = sprite->_spriteType;
 		break;
+	case kTheTweened:	// D6
+		d = (sprite->_thickness & kTTweened) ? 1 : 0;
+		break;
 	case kTheVisibility:
 	case kTheVisible:
 		d = (channel->_visible ? 1 : 0);
@@ -1791,6 +1802,22 @@ void Lingo::setTheSprite(Datum &id1, int field, Datum &d) {
 	case kTheEditableText:
 		channel->_sprite->_editable = d.asInt();
 		break;
+	case kTheFlipH: // D7
+		sprite->_thickness = (sprite->_thickness & ~kTFlipH) | ((d.asInt() ? kTFlipH : 0));
+		channel->_dirty = true;
+
+		sprite->setAutoPuppet(kAPThickness, true);
+
+		warning("STUB: Sprite flipH was set to %d", d.asInt());
+		break;
+	case kTheFlipV: // D7
+		sprite->_thickness = (sprite->_thickness & ~kTFlipV) | ((d.asInt() ? kTFlipV : 0));
+		channel->_dirty = true;
+
+		sprite->setAutoPuppet(kAPThickness, true);
+
+		warning("STUB: Sprite flipV was set to %d", d.asInt());
+		break;
 	case kTheForeColor:
 		{
 			uint32 newColor = g_director->transformColor(d.asInt());
@@ -1942,6 +1969,14 @@ void Lingo::setTheSprite(Datum &id1, int field, Datum &d) {
 			channel->_dirty = true;
 		}
 		break;
+	case kTheTweened: // D6
+		sprite->_thickness = (sprite->_thickness & ~kTTweened) | ((d.asInt() ? kTTweened : 0));
+		channel->_dirty = true;
+
+		sprite->setAutoPuppet(kAPThickness, true);
+
+		warning("STUB: Sprite tweened was set to %d", d.asInt());
+		break;
 	case kTheVisibility:
 	case kTheVisible:
 		if ((bool)d.asInt() != channel->_visible) {
diff --git a/engines/director/lingo/lingo-the.h b/engines/director/lingo/lingo-the.h
index caf684d1596..25f6d5647da 100644
--- a/engines/director/lingo/lingo-the.h
+++ b/engines/director/lingo/lingo-the.h
@@ -206,6 +206,8 @@ enum TheFieldType {
 	kTheEnabled,
 	kTheFileName,
 	kTheFilled,
+	kTheFlipH,
+	kTheFlipV,
 	kTheForeColor,
 	kTheFrameRate,
 	kTheHeight,




More information about the Scummvm-git-logs mailing list