[Scummvm-git-logs] scummvm master -> 9c52da7cf798d4536aac24a95f9fb8f9343447d8

npjg nathanael.gentrydb8 at gmail.com
Thu Jun 18 22:34:46 UTC 2020


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:
9c52da7cf7 DIRECTOR: Restore rendering of width/height of sprite


Commit: 9c52da7cf798d4536aac24a95f9fb8f9343447d8
    https://github.com/scummvm/scummvm/commit/9c52da7cf798d4536aac24a95f9fb8f9343447d8
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2020-06-18T18:33:52-04:00

Commit Message:
DIRECTOR: Restore rendering of width/height of sprite

Note that automatic stretching is only available on copy and transparent ink, as
I document in the comment.

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


diff --git a/engines/director/ink.cpp b/engines/director/ink.cpp
index 4b4115b59b..72c1262186 100644
--- a/engines/director/ink.cpp
+++ b/engines/director/ink.cpp
@@ -28,9 +28,17 @@
 namespace Director {
 
 void Score::inkBasedBlit(Graphics::ManagedSurface *maskSurface, const Graphics::Surface &spriteSurface, InkType ink, Common::Rect drawRect, uint spriteId) {
-	// drawRect could be bigger than the spriteSurface. Clip it
-	Common::Rect t(spriteSurface.w, spriteSurface.h);
-	t.moveTo(drawRect.left, drawRect.top);
+
+	// FIXME: If we try to use one of the draw* methods below for a sprite that
+	// has width and height changed, there is a butter overflow. But we don't want
+	// to clip `t`, so width and height can be changed and stretched automatically.
+	Common::Rect t;
+	if (ink == kInkTypeCopy || ink == kInkTypeTransparent) {
+		t = drawRect;
+	} else {
+		Common::Rect t(spriteSurface.w, spriteSurface.h);
+		t.moveTo(drawRect.left, drawRect.top);
+	}
 
 	Common::Point maskOrigin(MAX(0, -drawRect.left), MAX(0, -drawRect.top));
 	drawRect.clip(Common::Rect(_maskSurface->w, _maskSurface->h));
diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp
index 74139f4e58..cb2cb12e22 100644
--- a/engines/director/lingo/lingo-the.cpp
+++ b/engines/director/lingo/lingo-the.cpp
@@ -849,6 +849,7 @@ void Lingo::setTheSprite(Datum &id1, int field, Datum &d) {
 		break;
 	case kTheHeight:
 		if (sprite->_puppet && sprite->_stretch) {
+			score->unrenderSprite(id);
 			sprite->_height = d.asInt();
 		}
 		break;
@@ -914,6 +915,7 @@ void Lingo::setTheSprite(Datum &id1, int field, Datum &d) {
 		break;
 	case kTheWidth:
 		if (sprite->_puppet && sprite->_stretch) {
+			score->unrenderSprite(id);
 			sprite->_width = d.asInt();
 		}
 		break;




More information about the Scummvm-git-logs mailing list