aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKari Salminen2008-11-18 19:54:44 +0000
committerKari Salminen2008-11-18 19:54:44 +0000
commit089c8b4e48e8dd29ce7d839f6e87f12937478081 (patch)
treef3906d7bd2a41d2981d18807e3fcd08e1188c9e7
parent48e1316da9b712568e762d8513f73ce34bff90bc (diff)
downloadscummvm-rg350-089c8b4e48e8dd29ce7d839f6e87f12937478081.tar.gz
scummvm-rg350-089c8b4e48e8dd29ce7d839f6e87f12937478081.tar.bz2
scummvm-rg350-089c8b4e48e8dd29ce7d839f6e87f12937478081.zip
Make the 256 color transformPaletteRange-function and Future Wars's refreshPalette-function compliant with disassembly.
svn-id: r35118
-rw-r--r--engines/cine/gfx.cpp7
-rw-r--r--engines/cine/pal.cpp6
2 files changed, 6 insertions, 7 deletions
diff --git a/engines/cine/gfx.cpp b/engines/cine/gfx.cpp
index 832576b852..e743d4227c 100644
--- a/engines/cine/gfx.cpp
+++ b/engines/cine/gfx.cpp
@@ -556,10 +556,9 @@ void FWRenderer::refreshPalette() {
assert(_activeLowPal);
for (i = 0; i < 16; i++) {
- // This seems to match the output from DOSbox.
- pal[i * 4 + 2] = ((_activeLowPal[i] & 0x00f) >> 0) * 32;
- pal[i * 4 + 1] = ((_activeLowPal[i] & 0x0f0) >> 4) * 32;
- pal[i * 4 + 0] = ((_activeLowPal[i] & 0xf00) >> 8) * 32;
+ pal[i * 4 + 2] = ((_activeLowPal[i] & 0x007) >> 0) * 32;
+ pal[i * 4 + 1] = ((_activeLowPal[i] & 0x070) >> 4) * 32;
+ pal[i * 4 + 0] = ((_activeLowPal[i] & 0x700) >> 8) * 32;
pal[i * 4 + 3] = 0;
}
diff --git a/engines/cine/pal.cpp b/engines/cine/pal.cpp
index 7f6307c640..910ed4735a 100644
--- a/engines/cine/pal.cpp
+++ b/engines/cine/pal.cpp
@@ -155,9 +155,9 @@ void transformPaletteRange(byte *dstPal, byte *srcPal, int startColor, int stopC
assert(srcPal && dstPal);
for (int i = startColor; i <= stopColor; i++) {
- dstPal[3 * i + 0] = CLIP(srcPal[3 * i + 0] + r * 32, 0, 255);
- dstPal[3 * i + 1] = CLIP(srcPal[3 * i + 1] + g * 32, 0, 255);
- dstPal[3 * i + 2] = CLIP(srcPal[3 * i + 2] + b * 32, 0, 255);
+ dstPal[3 * i + 0] = CLIP(srcPal[3 * i + 0] + r * 36, 0, 252);
+ dstPal[3 * i + 1] = CLIP(srcPal[3 * i + 1] + g * 36, 0, 252);
+ dstPal[3 * i + 2] = CLIP(srcPal[3 * i + 2] + b * 36, 0, 252);
}
}