From 55be1b82a84454ae838419e22ce15cade5298665 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 8 Feb 2015 23:54:51 -0500 Subject: MADS: Variable renaming in closestColor --- engines/mads/palette.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'engines/mads/palette.cpp') diff --git a/engines/mads/palette.cpp b/engines/mads/palette.cpp index 250c98b074..b41eaedfcc 100644 --- a/engines/mads/palette.cpp +++ b/engines/mads/palette.cpp @@ -888,19 +888,19 @@ void Palette::refreshSceneColors() { int Palette::closestColor(const byte *matchColor, const byte *refPalette, int listWrap, int count) { int bestColor = 0; - int bestDifference = 0x7fff; + int bestDistance = 0x7fff; for (int idx = 0; idx < count; ++idx) { // Figure out hash for color - int hash = 0; + int distance = 0; for (int rgbIdx = 0; rgbIdx < 3; ++rgbIdx, ++refPalette) { byte diff = *refPalette - matchColor[rgbIdx]; - hash += (int)diff * (int)diff; + distance += (int)diff * (int)diff; } // If the given color is a closer match to our color, store the index - if (hash < bestDifference) { - bestDifference = hash; + if (distance < bestDistance) { + bestDistance = distance; bestColor = idx; } -- cgit v1.2.3