aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2014-05-09 22:53:37 -0400
committerPaul Gilbert2014-05-09 22:53:37 -0400
commit88ac15d69e550209f1a82d3090e370d2fa7d3153 (patch)
tree5e2162d6a46a7726be78b7349090ba85c777043c /engines
parente2f2e31db37be06538ecea78917c64a0b9c65197 (diff)
downloadscummvm-rg350-88ac15d69e550209f1a82d3090e370d2fa7d3153.tar.gz
scummvm-rg350-88ac15d69e550209f1a82d3090e370d2fa7d3153.tar.bz2
scummvm-rg350-88ac15d69e550209f1a82d3090e370d2fa7d3153.zip
MADS: Greyscale fading now close to the original
Diffstat (limited to 'engines')
-rw-r--r--engines/mads/palette.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/engines/mads/palette.cpp b/engines/mads/palette.cpp
index 1d3072f14b..e718059b67 100644
--- a/engines/mads/palette.cpp
+++ b/engines/mads/palette.cpp
@@ -377,7 +377,7 @@ void Fader::fadeToGrey(byte palette[PALETTE_SIZE], byte *paletteMap,
intensity = _colorValues[colorCtr];
}
- int diff = intensity - palette[palCtr * 3 + colorCtr];
+ int diff = intensity - VGA_COLOR_REV(palette[palCtr * 3 + colorCtr]);
palIndex[palCtr][colorCtr] = (byte)ABS(diff);
signs[palCtr][colorCtr] = (diff == 0) ? 0 : (diff < 0 ? -1 : 1);
}
@@ -390,7 +390,10 @@ void Fader::fadeToGrey(byte palette[PALETTE_SIZE], byte *paletteMap,
map[index]._accum[colorCtr] += palIndex[palCtr][colorCtr];
while (map[index]._accum[colorCtr] >= steps) {
map[index]._accum[colorCtr] -= steps;
- palette[palCtr * 3 + colorCtr] = signs[palCtr][colorCtr];
+
+ byte rgb63 = VGA_COLOR_REV(palette[palCtr * 3 + colorCtr]) +
+ signs[palCtr][colorCtr];
+ palette[palCtr * 3 + colorCtr] = VGA_COLOR_TRANS(rgb63);
}
}
}