diff options
author | Travis Howell | 2009-11-22 08:49:19 +0000 |
---|---|---|
committer | Travis Howell | 2009-11-22 08:49:19 +0000 |
commit | d5d3ca66ce174e8c0b95c288f991a047f2f718d7 (patch) | |
tree | b82ba107222c904eef22985c0a6eeec460e82383 /engines | |
parent | 94e75b8b6d24f3ad0e0dc9f4e6e789948e31f48e (diff) | |
download | scummvm-rg350-d5d3ca66ce174e8c0b95c288f991a047f2f718d7.tar.gz scummvm-rg350-d5d3ca66ce174e8c0b95c288f991a047f2f718d7.tar.bz2 scummvm-rg350-d5d3ca66ce174e8c0b95c288f991a047f2f718d7.zip |
Add patch for Tobias, for more accurate palette in PCE version of Loom.
svn-id: r46065
Diffstat (limited to 'engines')
-rw-r--r-- | engines/scumm/palette.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/engines/scumm/palette.cpp b/engines/scumm/palette.cpp index 467ed9617c..18b6b3e383 100644 --- a/engines/scumm/palette.cpp +++ b/engines/scumm/palette.cpp @@ -204,9 +204,9 @@ void ScummEngine::setPaletteFromTable(const byte *ptr, int numcolor, int index) void colorPCEToRGB(uint16 color, byte *r, byte *g, byte *b) { // 3 bits for each color component: 0xgggrrrbbb - *b = ((color) & 0x7) << 5; - *r = ((color >> 3) & 0x7) << 5; - *g = ((color >> 6) & 0x7) << 5; + *b = ((color) & 0x7) * 0xFF / 0x7; + *r = ((color >> 3) & 0x7) * 0xFF / 0x7; + *g = ((color >> 6) & 0x7) * 0xFF / 0x7; } void ScummEngine::setPCETextPalette(uint8 color) { @@ -242,6 +242,7 @@ void ScummEngine::readPCEPalette(const byte **ptr, byte **dest, int numEntries) void ScummEngine::setPCEPaletteFromPtr(const byte *ptr) { byte *dest; byte bgSpriteR, bgSpriteG, bgSpriteB; + byte charsetR, charsetG, charsetB; int paletteOffset = *ptr++; int numPalettes = *ptr++; @@ -254,6 +255,9 @@ void ScummEngine::setPCEPaletteFromPtr(const byte *ptr) { colorPCEToRGB(READ_LE_UINT16(ptr), &bgSpriteR, &bgSpriteG, &bgSpriteB); ptr += 2; + // CHARSET_COLORS[_curTextColor] (unused?) + colorPCEToRGB(0x01B6, &charsetR, &charsetG, &charsetB); + dest = _currentPalette + firstIndex * 3; for (int i = 0; i < numPalettes; ++i) { @@ -265,10 +269,10 @@ void ScummEngine::setPCEPaletteFromPtr(const byte *ptr) { // entry 1 - 14 readPCEPalette(&ptr, &dest, 14); - // entry 15: DEFAULT_PALETTE[var3AE3]; - *dest++ = 6 << 5; - *dest++ = 6 << 5; - *dest++ = 6 << 5; + // entry 15 + *dest++ = charsetR; + *dest++ = charsetG; + *dest++ = charsetB; } if (_game.features & GF_16BIT_COLOR) { |