[Scummvm-git-logs] scummvm master -> 12d1112780596a90b5fa728f118ee22a7729adfd

criezy noreply at scummvm.org
Mon Feb 7 21:08:06 UTC 2022


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:
12d1112780 AGS: Add sanity check on luminance in tint_image


Commit: 12d1112780596a90b5fa728f118ee22a7729adfd
    https://github.com/scummvm/scummvm/commit/12d1112780596a90b5fa728f118ee22a7729adfd
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2022-02-07T21:03:40Z

Commit Message:
AGS: Add sanity check on luminance in tint_image

This fixes bug #13246 Mage's Initiation - crashes while entering
the Palace on Lone Island.

The game has incorrect data causing the luminance value to be -26335
in the Lone Island palace. The original game doesn't crash has the
config file distributed with the game specifies either the D3D9 or
OGL driver should be used and those have a sanity check on the
luminance when tinting sprite to use 255 if it is negative. This
commit does the same sanity check for the software rendering path.

Changed paths:
    engines/ags/engine/ac/draw.cpp


diff --git a/engines/ags/engine/ac/draw.cpp b/engines/ags/engine/ac/draw.cpp
index 8c93096d829..7685dcbe16b 100644
--- a/engines/ags/engine/ac/draw.cpp
+++ b/engines/ags/engine/ac/draw.cpp
@@ -1471,6 +1471,11 @@ void tint_image(Bitmap *ds, Bitmap *srcimg, int red, int grn, int blu, int light
 		return;
 	}
 
+	// Some games have incorrect data that result in a negative luminance.
+	// Do the same as the accelerated drivers that use 255 luminance for that case.
+	if (luminance <= 0)
+		luminance = 255;
+
 	// For performance reasons, we have a separate blender for
 	// when light is being adjusted and when it is not.
 	// If luminance >= 250, then normal brightness, otherwise darken




More information about the Scummvm-git-logs mailing list