aboutsummaryrefslogtreecommitdiff
path: root/scumm/palette_he.cpp
diff options
context:
space:
mode:
authorTravis Howell2005-04-09 09:20:44 +0000
committerTravis Howell2005-04-09 09:20:44 +0000
commitcbe1437c27f22714cd730e77021f042ace34b530 (patch)
tree8afc734ce14241af2ad2fe5d41d38100a1ad2522 /scumm/palette_he.cpp
parent16061e0f428db810665e16eb083374611bef0a24 (diff)
downloadscummvm-rg350-cbe1437c27f22714cd730e77021f042ace34b530.tar.gz
scummvm-rg350-cbe1437c27f22714cd730e77021f042ace34b530.tar.bz2
scummvm-rg350-cbe1437c27f22714cd730e77021f042ace34b530.zip
rewrite for hePalettes.
svn-id: r17472
Diffstat (limited to 'scumm/palette_he.cpp')
-rw-r--r--scumm/palette_he.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/scumm/palette_he.cpp b/scumm/palette_he.cpp
index ea36c26512..b2259918a3 100644
--- a/scumm/palette_he.cpp
+++ b/scumm/palette_he.cpp
@@ -164,33 +164,33 @@ void ScummEngine_v99he::setPaletteFromPtr(const byte *ptr, int numcolor) {
void ScummEngine_v99he::darkenPalette(int redScale, int greenScale, int blueScale, int startColor, int endColor) {
if (startColor <= endColor) {
- const byte *cptr;
- const byte *palptr;
- int color, idx, j;
+ uint8 *src, *dest;
+ int color, j;
- palptr = getPalettePtr(_curPalIndex, _roomResource);
for (j = startColor; j <= endColor; j++) {
- idx = _hePalettes[1792 + j];
- cptr = palptr + idx * 3;
- setDirtyColors(idx, idx);
+ src = _hePalettes + j * 3;
+ dest = src + 1024;
- color = *cptr++;
+ color = *src++;
color = color * redScale / 0xFF;
if (color > 255)
color = 255;
- _hePalettes[1024 + idx * 3 + 0] = color;
+ *dest++ = color;
- color = *cptr++;
+ color = *src++;
color = color * greenScale / 0xFF;
if (color > 255)
color = 255;
- _hePalettes[1024 + idx * 3 + 1] = color;
+ *dest++ = color;
- color = *cptr++;
+ color = *src++;
color = color * blueScale / 0xFF;
if (color > 255)
color = 255;
- _hePalettes[1024 + idx * 3 + 2] = color;
+ *dest++ = color;
+
+ _hePalettes[1768 + startColor + j] = j;
+ setDirtyColors(j, endColor);
}
}
}