diff options
author | Johannes Schickel | 2011-02-13 15:32:36 +0100 |
---|---|---|
committer | Johannes Schickel | 2011-02-14 17:08:32 +0100 |
commit | 8db9fca56ced10acbcaa104de4eeb9c362009301 (patch) | |
tree | b793719139e162e0b3df2ff537fc69e47c364464 | |
parent | 0a389b310cc1794191762d142777004b5096cbb5 (diff) | |
download | scummvm-rg350-8db9fca56ced10acbcaa104de4eeb9c362009301.tar.gz scummvm-rg350-8db9fca56ced10acbcaa104de4eeb9c362009301.tar.bz2 scummvm-rg350-8db9fca56ced10acbcaa104de4eeb9c362009301.zip |
DRACI: Adapt to setPalette RGBA->RGB.
-rw-r--r-- | engines/draci/screen.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/engines/draci/screen.cpp b/engines/draci/screen.cpp index bb7a093d8f..dbe3fd98b8 100644 --- a/engines/draci/screen.cpp +++ b/engines/draci/screen.cpp @@ -36,7 +36,7 @@ namespace Draci { Screen::Screen(DraciEngine *vm) : _vm(vm) { _surface = new Surface(kScreenWidth, kScreenHeight); - _palette = new byte[4 * kNumColours]; + _palette = new byte[3 * kNumColours]; _blackPalette = new byte[3 * kNumColours]; for (int i = 0; i < 3 * kNumColours; ++i) { _blackPalette[i] = 0; @@ -63,15 +63,14 @@ void Screen::setPalette(const byte *data, uint16 start, uint16 num) { // Copy the palette for (uint16 i = start; i < start + num; ++i) { - _palette[i * 4] = pal.readByte(); - _palette[i * 4 + 1] = pal.readByte(); - _palette[i * 4 + 2] = pal.readByte(); - _palette[i * 4 + 3] = 0; + _palette[i * 3] = pal.readByte(); + _palette[i * 3 + 1] = pal.readByte(); + _palette[i * 3 + 2] = pal.readByte(); } // Shift the palette two bits to the left to make it brighter. The // original game only uses 6-bit colors 0..63. - for (int i = start * 4; i < (start + num) * 4; ++i) { + for (int i = start * 3; i < (start + num) * 3; ++i) { _palette[i] <<= 2; } @@ -86,14 +85,13 @@ void Screen::interpolatePalettes(const byte *first, const byte *second, uint16 s // Interpolate the palettes for (uint16 i = start; i < start + num; ++i) { - _palette[i * 4] = interpolate(firstPal.readByte(), secondPal.readByte(), index, number); - _palette[i * 4 + 1] = interpolate(firstPal.readByte(), secondPal.readByte(), index, number); - _palette[i * 4 + 2] = interpolate(firstPal.readByte(), secondPal.readByte(), index, number); - _palette[i * 4 + 3] = 0; + _palette[i * 3] = interpolate(firstPal.readByte(), secondPal.readByte(), index, number); + _palette[i * 3 + 1] = interpolate(firstPal.readByte(), secondPal.readByte(), index, number); + _palette[i * 3 + 2] = interpolate(firstPal.readByte(), secondPal.readByte(), index, number); } // Shift the palette two bits to the left to make it brighter - for (int i = start * 4; i < (start + num) * 4; ++i) { + for (int i = start * 3; i < (start + num) * 3; ++i) { _palette[i] <<= 2; } |