aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2014-10-27 23:04:25 +0100
committerWillem Jan Palenstijn2014-10-27 23:04:25 +0100
commitda9ffe9dbc0912463c6161186085525bb775c0c1 (patch)
tree4eeac91e3ccdb72aded3e1422ec105fb9af0b156
parent7661b8adfccde8190dc795c71033014f486cf800 (diff)
downloadscummvm-rg350-da9ffe9dbc0912463c6161186085525bb775c0c1.tar.gz
scummvm-rg350-da9ffe9dbc0912463c6161186085525bb775c0c1.tar.bz2
scummvm-rg350-da9ffe9dbc0912463c6161186085525bb775c0c1.zip
SCI: Add note on SSCI 11 FindColor bug
-rw-r--r--engines/sci/graphics/palette.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/engines/sci/graphics/palette.cpp b/engines/sci/graphics/palette.cpp
index a3624c7959..c98d1d8e8d 100644
--- a/engines/sci/graphics/palette.cpp
+++ b/engines/sci/graphics/palette.cpp
@@ -524,6 +524,10 @@ uint16 GfxPalette::matchColor(byte r, byte g, byte b) {
cdiff = (dr*dr) + (dg*dg) + (db*db);
// minimum sum match (Sierra's)
// cdiff = ABS(dr) + ABS(dg) + ABS(db);
+// Note: (most? all?) SCI 1.1 interpreters have a bug in this code,
+// and in fact have dr, dg, db as signed int8. This makes the comparison
+// wrap around so that 0 and 255 have an effective distance of 1.
+// See bug 6455 for a symptom of this in SQ5.
if (cdiff < diff) {
if (cdiff == 0)
return i | 0x8000; // setting this flag to indicate exact match