[Scummvm-cvs-logs] scummvm master -> 5c91173337278d1d23d03efbeb4e6b6debba0d6d

m-kiewitz m_kiewitz at users.sourceforge.net
Wed Oct 29 00:11:54 CET 2014


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:
5c91173337 SCI: color matching bug fix


Commit: 5c91173337278d1d23d03efbeb4e6b6debba0d6d
    https://github.com/scummvm/scummvm/commit/5c91173337278d1d23d03efbeb4e6b6debba0d6d
Author: Martin Kiewitz (m_kiewitz at users.sourceforge.net)
Date: 2014-10-29T00:12:12+01:00

Commit Message:
SCI: color matching bug fix

Changed paths:
    engines/sci/graphics/palette.cpp



diff --git a/engines/sci/graphics/palette.cpp b/engines/sci/graphics/palette.cpp
index 5058eaa..59abef5 100644
--- a/engines/sci/graphics/palette.cpp
+++ b/engines/sci/graphics/palette.cpp
@@ -525,7 +525,7 @@ uint16 GfxPalette::matchColor(byte matchRed, byte matchGreen, byte matchBlue) {
 	int16 differenceRed, differenceGreen, differenceBlue;
 	int16 differenceTotal = 0;
 	int16 bestDifference = 0x7FFF;
-	uint16 bestColor = 255;
+	uint16 bestColorNr = 255;
 
 	if (_use16bitColorMatch) {
 		// used by SCI0 to SCI1, also by the first few SCI1.1 games
@@ -538,7 +538,7 @@ uint16 GfxPalette::matchColor(byte matchRed, byte matchGreen, byte matchBlue) {
 			differenceTotal = differenceRed + differenceGreen + differenceBlue;
 			if (differenceTotal <= bestDifference) {
 				bestDifference = differenceTotal;
-				bestColor = colorNr;
+				bestColorNr = colorNr;
 			}
 		}
 	} else {
@@ -554,13 +554,13 @@ uint16 GfxPalette::matchColor(byte matchRed, byte matchGreen, byte matchBlue) {
 			differenceTotal = differenceRed + differenceGreen + differenceBlue;
 			if (differenceTotal <= bestDifference) {
 				bestDifference = differenceTotal;
-				bestColor = colorNr;
+				bestColorNr = colorNr;
 			}
 		}
 	}
 	if (differenceTotal == 0) // original interpreter does not do this, instead it does 2 calls for merges in the worst case
-		return colorNr | SCI_PALETTE_MATCH_PERFECT; // we set this flag, so that we can optimize during palette merge
-	return bestColor;
+		return bestColorNr | SCI_PALETTE_MATCH_PERFECT; // we set this flag, so that we can optimize during palette merge
+	return bestColorNr;
 }
 
 void GfxPalette::getSys(Palette *pal) {






More information about the Scummvm-git-logs mailing list