[Scummvm-git-logs] scummvm master -> cd8bc8b8056d9f26d829a6f8ad5cc612e824df31

Strangerke noreply at scummvm.org
Wed Jun 25 21:49:04 UTC 2025


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
cd8bc8b805 M4: Riddle: Fix a couple of constants in krn_fade_to_grey


Commit: cd8bc8b8056d9f26d829a6f8ad5cc612e824df31
    https://github.com/scummvm/scummvm/commit/cd8bc8b8056d9f26d829a6f8ad5cc612e824df31
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2025-06-25T22:47:05+01:00

Commit Message:
M4: Riddle: Fix a couple of constants in krn_fade_to_grey

Changed paths:
    engines/m4/graphics/krn_pal.cpp


diff --git a/engines/m4/graphics/krn_pal.cpp b/engines/m4/graphics/krn_pal.cpp
index 251af0ab882..5f0599c6b0b 100644
--- a/engines/m4/graphics/krn_pal.cpp
+++ b/engines/m4/graphics/krn_pal.cpp
@@ -161,11 +161,11 @@ void krn_fade_to_grey(RGB8 *pal, int32 steps, int32 delay) {
 
 	// Make translation table to translate colors using entries 59-255 into 21-58 range
 
-	for (int32 i = 0; i < NUM_GREYS; i++) {
-		int32 bestMatch = 65;
+	for (int32 i = 0; i < (IS_RIDDLE ? 64 : 32); i++) {
+		int32 bestMatch = IS_RIDDLE ? 63 : 65;
 		int32 minDist = 255;
 
-		for (int32 j = 59; j <= 255; j++) {
+		for (int32 j = FREE_START; j <= 255; j++) {
 			if (imath_abs((_GP(fadeToMe)[j].r >> 2) - i) < minDist) {
 				minDist = imath_abs((_GP(fadeToMe)[j].r >> 2) - i);
 				bestMatch = j;




More information about the Scummvm-git-logs mailing list