From bbc464a7bc950ce4860abc7bbd1dc26e5a16cd45 Mon Sep 17 00:00:00 2001 From: Scott Percival Date: Tue, 3 Jan 2023 19:53:43 +0800 Subject: [PATCH] DIRECTOR: Fix matte display for 1-bit images --- engines/director/channel.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/engines/director/channel.cpp b/engines/director/channel.cpp index 4663233f359..0cf6231ebe2 100644 --- a/engines/director/channel.cpp +++ b/engines/director/channel.cpp @@ -162,7 +162,12 @@ const Graphics::Surface *Channel::getMask(bool forceMatte) { // as they already have all non-enclosed white pixels transparent. // Matte on text has a trivial enough effect to not worry about implementing. if (_sprite->_cast->_type == kCastBitmap) { - return ((BitmapCastMember *)_sprite->_cast)->getMatte(bbox); + BitmapCastMember *bitmap = ((BitmapCastMember *)_sprite->_cast); + // 1-bit images only require a matte for the matte ink type + if (bitmap->_bitsPerPixel == 1 && _sprite->_ink != kInkTypeMatte) { + return nullptr; + } + return bitmap->getMatte(bbox); } else { return nullptr; }