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

AndywinXp noreply at scummvm.org
Tue Jul 11 23:47:20 UTC 2023


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:
9e1f8cbb9b SCUMM/HE: SPYFOX1: Fix bug #13548


Commit: 9e1f8cbb9b6bbed8276c61b648c8378d7790e681
    https://github.com/scummvm/scummvm/commit/9e1f8cbb9b6bbed8276c61b648c8378d7790e681
Author: AndywinXp (andywinxp at gmail.com)
Date: 2023-07-12T01:47:12+02:00

Commit Message:
SCUMM/HE: SPYFOX1: Fix bug #13548

Verified on disasms ranging from HE70 to HE100.
The original EXEs never checks for transparency
when drawing a BMAP image.

As a matter of fact it doesn't even use drawStripHE,
but it uses a simplified version which doesn't have
the check at all.

We disable the transparency check accordingly and
use the compression type code just to produce the
correct bits-per-pixel and mask decompression params.

Changed paths:
    engines/scumm/gfx.cpp


diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index 648e8432025..bc56053e7ca 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -62,6 +62,8 @@ struct StripTable {
 	int zrun[120];		// FIXME: Why only 120 here?
 };
 
+static const byte bitMasks[9] = { 0x00, 0x01, 0x03, 0x07, 0x0F, 0x1F, 0x3F, 0x7F, 0xFF };
+
 enum {
 	kNoDelay = 0,
 	// This should actually be 3 in all games using it;
@@ -2471,8 +2473,6 @@ void Gdi::drawBMAPBg(const byte *ptr, VirtScreen *vs) {
 	// The following few lines more or less duplicate decompressBitmap(), only
 	// for an area spanning multiple strips. In particular, the codecs 13 & 14
 	// in decompressBitmap call drawStripHE()
-	_decomp_shr = code % 10;
-	_decomp_mask = 0xFF >> (8 - _decomp_shr);
 
 	switch (code) {
 	case BMCOMP_NMAJMIN_H4:
@@ -2480,6 +2480,8 @@ void Gdi::drawBMAPBg(const byte *ptr, VirtScreen *vs) {
 	case BMCOMP_NMAJMIN_H6:
 	case BMCOMP_NMAJMIN_H7:
 	case BMCOMP_NMAJMIN_H8:
+		_decomp_shr = code - BMCOMP_NMAJMIN_H0; // Bits per pixel
+		_decomp_mask = bitMasks[_decomp_shr];
 		drawStripHE(dst, vs->pitch, bmap_ptr, vs->w, vs->h, false);
 		break;
 	case BMCOMP_NMAJMIN_HT4:
@@ -2487,7 +2489,9 @@ void Gdi::drawBMAPBg(const byte *ptr, VirtScreen *vs) {
 	case BMCOMP_NMAJMIN_HT6:
 	case BMCOMP_NMAJMIN_HT7:
 	case BMCOMP_NMAJMIN_HT8:
-		drawStripHE(dst, vs->pitch, bmap_ptr, vs->w, vs->h, true);
+		_decomp_shr = code - BMCOMP_NMAJMIN_HT0; // Bits per pixel
+		_decomp_mask = bitMasks[_decomp_shr];
+		drawStripHE(dst, vs->pitch, bmap_ptr, vs->w, vs->h, false);
 		break;
 	case BMCOMP_SOLID_COLOR_FILL:
 		fill(dst, vs->pitch, *bmap_ptr, vs->w, vs->h, vs->format.bytesPerPixel);




More information about the Scummvm-git-logs mailing list