diff options
author | Paul Gilbert | 2015-02-08 23:54:51 -0500 |
---|---|---|
committer | Paul Gilbert | 2015-02-08 23:54:51 -0500 |
commit | 55be1b82a84454ae838419e22ce15cade5298665 (patch) | |
tree | f1dfc6165a1579de0a7dd8bcdca7c76dea7440fc | |
parent | 5e00b39caec66e1c5626a89f207c26c577fd30d8 (diff) | |
download | scummvm-rg350-55be1b82a84454ae838419e22ce15cade5298665.tar.gz scummvm-rg350-55be1b82a84454ae838419e22ce15cade5298665.tar.bz2 scummvm-rg350-55be1b82a84454ae838419e22ce15cade5298665.zip |
MADS: Variable renaming in closestColor
-rw-r--r-- | engines/mads/palette.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
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; } |