aboutsummaryrefslogtreecommitdiff
path: root/engines/draci
diff options
context:
space:
mode:
Diffstat (limited to 'engines/draci')
-rw-r--r--engines/draci/screen.cpp20
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;
}