aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics/palette.cpp
diff options
context:
space:
mode:
authorMartin Kiewitz2014-10-29 00:12:12 +0100
committerMartin Kiewitz2014-10-29 00:12:12 +0100
commit5c91173337278d1d23d03efbeb4e6b6debba0d6d (patch)
treeec9aaf4eff41f27c4e32bd81e3dc0f1522315671 /engines/sci/graphics/palette.cpp
parentbb29cdc899dcf48fb67b369273194dab32843665 (diff)
downloadscummvm-rg350-5c91173337278d1d23d03efbeb4e6b6debba0d6d.tar.gz
scummvm-rg350-5c91173337278d1d23d03efbeb4e6b6debba0d6d.tar.bz2
scummvm-rg350-5c91173337278d1d23d03efbeb4e6b6debba0d6d.zip
SCI: color matching bug fix
Diffstat (limited to 'engines/sci/graphics/palette.cpp')
-rw-r--r--engines/sci/graphics/palette.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/engines/sci/graphics/palette.cpp b/engines/sci/graphics/palette.cpp
index 5058eaa550..59abef5550 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) {