[Scummvm-git-logs] scummvm master -> 5a5e205e0d0fb9226d88b92c2a26af5bc2c424e6

sev- noreply at scummvm.org
Sat Jun 10 14:18:38 UTC 2023


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

Summary:
bcd4a82075 DIRECTOR: remove puppet checks when setting sprite properties
5a5e205e0d DIRECTOR: Add _autoPuppet flag, initial work for D6 auto-puppeting


Commit: bcd4a82075e92ad29ea080ade28da45dfee48896
    https://github.com/scummvm/scummvm/commit/bcd4a82075e92ad29ea080ade28da45dfee48896
Author: Harishankar Kumar (hari01584 at gmail.com)
Date: 2023-06-10T16:18:34+02:00

Commit Message:
DIRECTOR: remove puppet checks when setting sprite properties

In original engine it is possible to set non-puppted sprite properties
like position, backcolor etc and then call updatestage to update the
screen according to property. This is undocumented behaviour
which is not present depicted in any books however with rigorous testing
it is found to be true. This change only persist for the current frame
and once the playback head is moving the change is lost.

`ATD\HD\bdDREAMA.DXR` of 'totaldistortion' used some of this quirk to
display moving bullets.

Changed paths:
    engines/director/channel.cpp


diff --git a/engines/director/channel.cpp b/engines/director/channel.cpp
index 2370268b403..58c6d010445 100644
--- a/engines/director/channel.cpp
+++ b/engines/director/channel.cpp
@@ -538,23 +538,19 @@ void Channel::replaceSprite(Sprite *nextSprite) {
 }
 
 void Channel::setWidth(int w) {
-	if (_sprite->_puppet) {
-		if (!(_sprite->_cast && _sprite->_cast->_type == kCastShape) && !_sprite->_stretch)
-			return;
-		_width = MAX<int>(w, 0);
-	}
+	if (!(_sprite->_cast && _sprite->_cast->_type == kCastShape) && !_sprite->_stretch)
+		return;
+	_width = MAX<int>(w, 0);
 }
 
 void Channel::setHeight(int h) {
-	if (_sprite->_puppet) {
-		if (!(_sprite->_cast && _sprite->_cast->_type == kCastShape) && !_sprite->_stretch)
-			return;
-		_height = MAX<int>(h, 0);
-	}
+	if (!(_sprite->_cast && _sprite->_cast->_type == kCastShape) && !_sprite->_stretch)
+		return;
+	_height = MAX<int>(h, 0);
 }
 
 void Channel::setBbox(int l, int t, int r, int b) {
-	if (_sprite->_puppet || _sprite->_stretch) {
+	if (_sprite->_stretch) {
 		if (!(_sprite->_cast && _sprite->_cast->_type == kCastShape) && !_sprite->_stretch)
 			return;
 		_width = r - l;
@@ -573,15 +569,13 @@ void Channel::setBbox(int l, int t, int r, int b) {
 }
 
 void Channel::setPosition(int x, int y, bool force) {
-	if (_sprite->_puppet || force) {
-		Common::Point newPos(x, y);
-		if (_constraint > 0 && _score && _constraint <= _score->_channels.size()) {
-			Common::Rect constraintBbox = _score->_channels[_constraint]->getBbox();
-			newPos.x = MIN(constraintBbox.right, MAX(constraintBbox.left, newPos.x));
-			newPos.y = MIN(constraintBbox.bottom, MAX(constraintBbox.top, newPos.y));
-		}
-		_currentPoint = newPos;
+	Common::Point newPos(x, y);
+	if (_constraint > 0 && _score && _constraint <= _score->_channels.size()) {
+		Common::Rect constraintBbox = _score->_channels[_constraint]->getBbox();
+		newPos.x = MIN(constraintBbox.right, MAX(constraintBbox.left, newPos.x));
+		newPos.y = MIN(constraintBbox.bottom, MAX(constraintBbox.top, newPos.y));
 	}
+	_currentPoint = newPos;
 }
 
 // here is the place for deciding whether the widget can be keep or not


Commit: 5a5e205e0d0fb9226d88b92c2a26af5bc2c424e6
    https://github.com/scummvm/scummvm/commit/5a5e205e0d0fb9226d88b92c2a26af5bc2c424e6
Author: Harishankar Kumar (hari01584 at gmail.com)
Date: 2023-06-10T16:18:34+02:00

Commit Message:
DIRECTOR: Add _autoPuppet flag, initial work for D6 auto-puppeting

[Based on Director in a Nutshell, page 15]
The following properties of a sprite are auto-puppeted whenever
the property is set: backColor, blend, editable, foreColor, height,
ink, loc, locH, locV, member, moveable, rect and width. Auto-puppeting
of individual properties has no effect on the puppet of sprite property

['Lingo Dictionary' 601 Fixes]
Sprites now have a duration as specified in the (new) score view.
When lingo modifies any of the sprite properties that property
will be auto-puppeted, i.e. the value set will stick for the
duration of that sprite despite any values recorded in the score.
This can cause existing lingo which relied on setting the property
of a sprite without the use of 'puppet' to behave differently.
Calling 'puppetSprite spriteNumber, FALSE' will also clear any
currently auto-puppeted properties.

Changed paths:
    engines/director/channel.cpp
    engines/director/sprite.cpp
    engines/director/sprite.h


diff --git a/engines/director/channel.cpp b/engines/director/channel.cpp
index 58c6d010445..08847f34f3d 100644
--- a/engines/director/channel.cpp
+++ b/engines/director/channel.cpp
@@ -364,6 +364,11 @@ void Channel::setCast(CastMemberID memberID) {
 	_width = _sprite->_width;
 	_height = _sprite->_height;
 	replaceWidget();
+
+	if (!_sprite->_puppet && g_director->getVersion() >= 600) {
+		// Based on Director in a Nutshell, page 15
+		_sprite->_autoPuppet = true;
+	}
 }
 
 void Channel::setClean(Sprite *nextSprite, int spriteId, bool partial) {
@@ -541,12 +546,22 @@ void Channel::setWidth(int w) {
 	if (!(_sprite->_cast && _sprite->_cast->_type == kCastShape) && !_sprite->_stretch)
 		return;
 	_width = MAX<int>(w, 0);
+
+	if (!_sprite->_puppet && g_director->getVersion() >= 600) {
+		// Based on Director in a Nutshell, page 15
+		_sprite->_autoPuppet = true;
+	}
 }
 
 void Channel::setHeight(int h) {
 	if (!(_sprite->_cast && _sprite->_cast->_type == kCastShape) && !_sprite->_stretch)
 		return;
 	_height = MAX<int>(h, 0);
+
+	if (!_sprite->_puppet && g_director->getVersion() >= 600) {
+		// Based on Director in a Nutshell, page 15
+		_sprite->_autoPuppet = true;
+	}
 }
 
 void Channel::setBbox(int l, int t, int r, int b) {
@@ -566,6 +581,11 @@ void Channel::setBbox(int l, int t, int r, int b) {
 		if (_width <= 0 || _height <= 0)
 			_width = _height = 0;
 	}
+
+	if (!_sprite->_puppet && g_director->getVersion() >= 600) {
+		// Based on Director in a Nutshell, page 15
+		_sprite->_autoPuppet = true;
+	}
 }
 
 void Channel::setPosition(int x, int y, bool force) {
@@ -576,6 +596,11 @@ void Channel::setPosition(int x, int y, bool force) {
 		newPos.y = MIN(constraintBbox.bottom, MAX(constraintBbox.top, newPos.y));
 	}
 	_currentPoint = newPos;
+
+	if (!_sprite->_puppet && g_director->getVersion() >= 600) {
+		// Based on Director in a Nutshell, page 15
+		_sprite->_autoPuppet = true;
+	}
 }
 
 // here is the place for deciding whether the widget can be keep or not
diff --git a/engines/director/sprite.cpp b/engines/director/sprite.cpp
index 39d92e59be2..5fe5c01af7e 100644
--- a/engines/director/sprite.cpp
+++ b/engines/director/sprite.cpp
@@ -62,6 +62,7 @@ Sprite::Sprite(Frame *frame) {
 	_moveable = false;
 	_editable = false;
 	_puppet = false;
+	_autoPuppet = false; // Based on Director in a Nutshell, page 15
 	_immediate = false;
 	_backColor = g_director->_wm->_colorWhite;
 	_foreColor = g_director->_wm->_colorBlack;
@@ -105,6 +106,7 @@ Sprite& Sprite::operator=(const Sprite &sprite) {
 	_moveable = sprite._moveable;
 	_editable = sprite._editable;
 	_puppet = sprite._puppet;
+	_autoPuppet = sprite._autoPuppet;
 	_immediate = sprite._immediate;
 	_backColor = sprite._backColor;
 	_foreColor = sprite._foreColor;
diff --git a/engines/director/sprite.h b/engines/director/sprite.h
index 4e7357f81a9..4ae81cc34b1 100644
--- a/engines/director/sprite.h
+++ b/engines/director/sprite.h
@@ -112,6 +112,7 @@ public:
 	bool _moveable;
 	bool _editable;
 	bool _puppet;
+	bool _autoPuppet; // autopuppet, based upon Director in a Nutshell, page 15
 	bool _immediate;
 	uint32 _backColor;
 	uint32 _foreColor;




More information about the Scummvm-git-logs mailing list