Make the 256 color transformPaletteRange-function and Future Wars's refreshPalette-function compliant with disassembly.

svn-id: r35118
This commit is contained in:
Kari Salminen 2008-11-18 19:54:44 +00:00
parent 48e1316da9
commit 089c8b4e48
2 changed files with 6 additions and 7 deletions

View File

@ -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;
}

View File

@ -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);
}
}