DIRECTOR: Fix matte display for 1-bit images

This commit is contained in:
Scott Percival
2023-01-10 13:41:53 +01:00
committed by Eugene Sandulenko
parent 9fb41d82d1
commit bbc464a7bc
+6 -1
View File
@@ -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;
}