AGS: Fix incorrect format check in generic blitting code

This fixes a bunch of errors in 5 Days a Stranger (and all other
games with 16-bit surfaces), including leaked memory and
incorrectly displayed text.
This commit is contained in:
Kaloyan Chehlarski 2023-10-07 22:18:48 +03:00
parent 614507859e
commit 7f84df864d

View File

@ -88,7 +88,7 @@ void BITMAP::drawInnerGeneric(DrawInnerArgs &args) {
*destVal = srcCol;
continue;
} else if ((DestBytesPerPixel == SrcBytesPerPixel) && args.srcAlpha == -1) {
if (DestBytesPerPixel)
if (DestBytesPerPixel == 4)
*(uint32 *)destVal = srcCol;
else
*(uint16 *)destVal = srcCol;