aboutsummaryrefslogtreecommitdiff
path: root/scumm/palette.cpp
diff options
context:
space:
mode:
authorTravis Howell2005-05-21 15:45:09 +0000
committerTravis Howell2005-05-21 15:45:09 +0000
commit0b1094ef045be590b66c5e1e530fc29ab1969785 (patch)
tree15a3e2d004ec0a061d59b4dbc97485bcafd6ca59 /scumm/palette.cpp
parent30408308bc1ec8abd194c8913d3ad07dcba8559f (diff)
downloadscummvm-rg350-0b1094ef045be590b66c5e1e530fc29ab1969785.tar.gz
scummvm-rg350-0b1094ef045be590b66c5e1e530fc29ab1969785.tar.bz2
scummvm-rg350-0b1094ef045be590b66c5e1e530fc29ab1969785.zip
Add patch from cyx for:
1094340 - COMI: Frightening the gravedigger, he goes white. 905833 - COMI: Palette in Theater controls svn-id: r18211
Diffstat (limited to 'scumm/palette.cpp')
-rw-r--r--scumm/palette.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/scumm/palette.cpp b/scumm/palette.cpp
index 45fe354024..b8645f3a98 100644
--- a/scumm/palette.cpp
+++ b/scumm/palette.cpp
@@ -269,7 +269,7 @@ void ScummEngine::setPaletteFromPtr(const byte *ptr, int numcolor) {
}
}
- if (_heversion >= 90) {
+ if (_heversion >= 90 || _version == 8) {
memcpy(_darkenPalette, _currentPalette, 768);
}
@@ -674,7 +674,7 @@ void ScummEngine::darkenPalette(int redScale, int greenScale, int blueScale, int
const byte *palptr;
int color, idx, j;
- if (_heversion >= 90) {
+ if (_heversion >= 90 || _version == 8) {
palptr = _darkenPalette;
} else {
palptr = getPalettePtr(_curPalIndex, _roomResource);
@@ -737,7 +737,7 @@ void ScummEngine_v8::desaturatePalette(int hueScale, int satScale, int lightScal
byte *cur;
int j;
- cptr = getPalettePtr(_curPalIndex, _roomResource) + startColor * 3;
+ cptr = _darkenPalette + startColor * 3;
cur = _currentPalette + startColor * 3;
for (j = startColor; j <= endColor; j++) {
@@ -809,7 +809,9 @@ int ScummEngine::remapPaletteColor(int r, int g, int b, int threshold) {
int i;
int ar, ag, ab;
uint sum, bestsum, bestitem = 0;
- byte *pal = _currentPalette;
+
+ int startColor = (_version == 8) ? 24 : 1;
+ byte *pal = _currentPalette + startColor * 3;
if (r > 255)
r = 255;
@@ -824,7 +826,7 @@ int ScummEngine::remapPaletteColor(int r, int g, int b, int threshold) {
g &= ~3;
b &= ~3;
- for (i = 0; i < 256; i++, pal += 3) {
+ for (i = startColor; i < 256; i++, pal += 3) {
ar = pal[0] & ~3;
ag = pal[1] & ~3;
ab = pal[2] & ~3;
@@ -901,6 +903,11 @@ void ScummEngine::setPalColor(int idx, int r, int g, int b) {
_currentPalette[idx * 3 + 0] = r;
_currentPalette[idx * 3 + 1] = g;
_currentPalette[idx * 3 + 2] = b;
+ if (_version == 8) {
+ _darkenPalette[idx * 3 + 0] = r;
+ _darkenPalette[idx * 3 + 1] = g;
+ _darkenPalette[idx * 3 + 2] = b;
+ }
setDirtyColors(idx, idx);
}