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

sev- sev at scummvm.org
Tue Apr 21 23:46:11 UTC 2020


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:
9ee9bc48be DIRECTOR: Matte sprites always use normal white color
bf1fecaa8e DIRECTOR: Use bg sprite color for drawBackgndTransSprite()


Commit: 9ee9bc48bea25ebb73764b69ff0463dcebf95888
    https://github.com/scummvm/scummvm/commit/9ee9bc48bea25ebb73764b69ff0463dcebf95888
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-04-22T01:45:07+02:00

Commit Message:
DIRECTOR: Matte sprites always use normal white color

Changed paths:
    engines/director/frame.cpp


diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index 76ed1c90d2..c0a12e8759 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -1194,17 +1194,16 @@ void Frame::drawMatteSprite(Graphics::ManagedSurface &target, const Graphics::Su
 	// Searching white color in the corners
 	int whiteColor = -1;
 
-	for (int corner = 0; corner < 4; corner++) {
-		int x = (corner & 0x1) ? tmp.w - 1 : 0;
-		int y = (corner & 0x2) ? tmp.h - 1 : 0;
-
-		byte color = *(byte *)tmp.getBasePtr(x, y);
-
-		if (_vm->getPalette()[color * 3 + 0] == 0xff &&
-			_vm->getPalette()[color * 3 + 1] == 0xff &&
-			_vm->getPalette()[color * 3 + 2] == 0xff) {
-			whiteColor = color;
-			break;
+	for (int y = 0; y < tmp.h; y++) {
+		for (int x = 0; x < tmp.w; x++) {
+			byte color = *(byte *)tmp.getBasePtr(x, y);
+
+			if (_vm->getPalette()[color * 3 + 0] == 0xff &&
+				_vm->getPalette()[color * 3 + 1] == 0xff &&
+				_vm->getPalette()[color * 3 + 2] == 0xff) {
+				whiteColor = color;
+				break;
+			}
 		}
 	}
 


Commit: bf1fecaa8e3eeb30ae33d98e371dc9a16ea565a4
    https://github.com/scummvm/scummvm/commit/bf1fecaa8e3eeb30ae33d98e371dc9a16ea565a4
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-04-22T01:45:40+02:00

Commit Message:
DIRECTOR: Use bg sprite color for drawBackgndTransSprite()

Changed paths:
    engines/director/frame.cpp
    engines/director/frame.h


diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index c0a12e8759..b5a5914f59 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -1074,7 +1074,7 @@ void Frame::inkBasedBlit(Graphics::ManagedSurface &targetSurface, const Graphics
 		targetSurface.transBlitFrom(spriteSurface, Common::Point(drawRect.left, drawRect.top), _vm->getPaletteColorCount() - 1);
 		break;
 	case kInkTypeBackgndTrans:
-		drawBackgndTransSprite(targetSurface, spriteSurface, drawRect);
+		drawBackgndTransSprite(targetSurface, spriteSurface, drawRect, spriteId);
 		break;
 	case kInkTypeMatte:
 		drawMatteSprite(targetSurface, spriteSurface, drawRect);
@@ -1092,8 +1092,8 @@ void Frame::inkBasedBlit(Graphics::ManagedSurface &targetSurface, const Graphics
 	}
 }
 
-void Frame::drawBackgndTransSprite(Graphics::ManagedSurface &target, const Graphics::Surface &sprite, Common::Rect &drawRect) {
-	uint8 skipColor = _vm->getPaletteColorCount() - 1; // FIXME is it always white (last entry in pallette) ?
+void Frame::drawBackgndTransSprite(Graphics::ManagedSurface &target, const Graphics::Surface &sprite, Common::Rect &drawRect, int spriteId) {
+	byte skipColor = _sprites[spriteId]->_backColor;
 	Common::Rect srcRect(sprite.w, sprite.h);
 
 	if (!target.clip(srcRect, drawRect))
diff --git a/engines/director/frame.h b/engines/director/frame.h
index 6edd246c44..7d773bd8ac 100644
--- a/engines/director/frame.h
+++ b/engines/director/frame.h
@@ -92,7 +92,7 @@ private:
 	void readMainChannels(Common::SeekableSubReadStreamEndian &stream, uint16 offset, uint16 size);
 	Image::ImageDecoder *getImageFrom(uint16 spriteId);
 	Common::String readTextStream(Common::SeekableSubReadStreamEndian *textStream, TextCast *textCast);
-	void drawBackgndTransSprite(Graphics::ManagedSurface &target, const Graphics::Surface &sprite, Common::Rect &drawRect);
+	void drawBackgndTransSprite(Graphics::ManagedSurface &target, const Graphics::Surface &sprite, Common::Rect &drawRect, int spriteId);
 	void drawMatteSprite(Graphics::ManagedSurface &target, const Graphics::Surface &sprite, Common::Rect &drawRect);
 	void drawGhostSprite(Graphics::ManagedSurface &target, const Graphics::Surface &sprite, Common::Rect &drawRect);
 	void drawReverseSprite(Graphics::ManagedSurface &target, const Graphics::Surface &sprite, Common::Rect &drawRect, uint16 spriteId);




More information about the Scummvm-git-logs mailing list