From 53e1bf21ecced447192f75067f0232c08d24d647 Mon Sep 17 00:00:00 2001 From: athrxx Date: Wed, 14 Dec 2011 00:44:12 +0100 Subject: KYRA: (EOB) - get rid of loadVGAPalette7bit() (slightly change VGA palette loader to accomodate EOB1 palettes) --- engines/kyra/screen.cpp | 17 ++--------------- engines/kyra/screen.h | 5 ----- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp index 9a8bff6346..8dc53baa2f 100644 --- a/engines/kyra/screen.cpp +++ b/engines/kyra/screen.cpp @@ -3057,9 +3057,6 @@ bool Screen::loadPalette(const char *filename, Palette &pal) { } else if (_vm->gameFlags().platform == Common::kPlatformPC98 && _use16ColorMode) { numCols = stream->size() / Palette::kPC98BytesPerColor; pal.loadPC98Palette(*stream, 0, MIN(maxCols, numCols)); - } else if (_vm->gameFlags().gameID == GI_EOB1) { - numCols = stream->size() / Palette::kVGABytesPerColor; - pal.loadVGAPalette7bit(*stream, 0, MIN(maxCols, numCols)); } else { numCols = stream->size() / Palette::kVGABytesPerColor; pal.loadVGAPalette(*stream, 0, MIN(maxCols, numCols)); @@ -3524,19 +3521,9 @@ Palette::~Palette() { void Palette::loadVGAPalette(Common::ReadStream &stream, int startIndex, int colors) { assert(startIndex + colors <= _numColors); - stream.read(_palData + startIndex * 3, colors * 3); -} - -void Palette::loadVGAPalette7bit(Common::ReadStream &stream, int startIndex, int colors) { - assert(startIndex + colors <= _numColors); - - stream.read(_palData + startIndex * 3, colors * 3); uint8 *pos = _palData + startIndex * 3; - for (int i = 0 ; i < colors; i++) { - *pos++ &= 0x3f; - *pos++ &= 0x3f; - *pos++ &= 0x3f; - } + for (int i = 0 ; i < colors * 3; i++) + *pos++ = stream.readByte() & 0x3f; } void Palette::loadAmigaPalette(Common::ReadStream &stream, int startIndex, int colors) { diff --git a/engines/kyra/screen.h b/engines/kyra/screen.h index 2db84157b3..7912e59973 100644 --- a/engines/kyra/screen.h +++ b/engines/kyra/screen.h @@ -251,11 +251,6 @@ public: */ void loadVGAPalette(Common::ReadStream &stream, int startIndex, int colors); - /** - * Load a VGA palette from the given stream masking out the upper bit. - */ - void loadVGAPalette7bit(Common::ReadStream &stream, int startIndex, int colors); - /** * Load a AMIGA palette from the given stream. */ -- cgit v1.2.3