[Scummvm-cvs-logs] scummvm master -> 55be1b82a84454ae838419e22ce15cade5298665
dreammaster
dreammaster at scummvm.org
Mon Feb 9 05:56:16 CET 2015
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:
55be1b82a8 MADS: Variable renaming in closestColor
Commit: 55be1b82a84454ae838419e22ce15cade5298665
https://github.com/scummvm/scummvm/commit/55be1b82a84454ae838419e22ce15cade5298665
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-02-08T23:54:51-05:00
Commit Message:
MADS: Variable renaming in closestColor
Changed paths:
engines/mads/palette.cpp
diff --git a/engines/mads/palette.cpp b/engines/mads/palette.cpp
index 250c98b..b41eaed 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;
}
More information about the Scummvm-git-logs
mailing list