From 57efbacb9af159c59043d5265b12625206d48224 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Sun, 21 May 2006 20:41:53 +0000 Subject: Palette handling simplification, suggested by LordHoto. svn-id: r22567 --- engines/kyra/vqa.cpp | 26 +++----------------------- engines/kyra/vqa.h | 1 - 2 files changed, 3 insertions(+), 24 deletions(-) (limited to 'engines/kyra') diff --git a/engines/kyra/vqa.cpp b/engines/kyra/vqa.cpp index 83eedea694..e0bc757da9 100644 --- a/engines/kyra/vqa.cpp +++ b/engines/kyra/vqa.cpp @@ -463,7 +463,6 @@ void VQAMovie::displayFrame(uint frameNum) { byte *inbuf, *outbuf; uint32 insize, outsize; - byte *pal; uint32 end; switch (tag) { @@ -532,32 +531,13 @@ void VQAMovie::displayFrame(uint frameNum) { case MKID_BE('CPL0'): // Palette assert(size <= 3 * 256); - - inbuf = (byte *)allocBuffer(0, size); - pal = _palette; - _file.read(inbuf, size); - - for (i = 0; i < size / 3; i++) { - *pal++ = *inbuf++; - *pal++ = *inbuf++; - *pal++ = *inbuf++; - } - + _file.read(_vm->screen()->_currentPalette, size); break; case MKID_BE('CPLZ'): // Palette inbuf = (byte *)allocBuffer(0, size); - outbuf = (byte *)allocBuffer(1, 3 * 256); - pal = _palette; _file.read(inbuf, size); - size = decodeFormat80(inbuf, outbuf); - - for (i = 0; i < size / 3; i++) { - *pal++ = *outbuf++; - *pal++ = *outbuf++; - *pal++ = *outbuf++; - } - + size = decodeFormat80(inbuf, _vm->screen()->_currentPalette); break; case MKID_BE('VPT0'): // Frame data @@ -600,7 +580,7 @@ void VQAMovie::displayFrame(uint frameNum) { // The frame has been decoded if (_frameInfo[frameNum] & 0x80000000) { - _vm->screen()->setScreenPalette(_palette); + _vm->screen()->setScreenPalette(_vm->screen()->_currentPalette); } int blockPitch = _header.width / _header.blockW; diff --git a/engines/kyra/vqa.h b/engines/kyra/vqa.h index f5d7cc5399..90ad2b12b4 100644 --- a/engines/kyra/vqa.h +++ b/engines/kyra/vqa.h @@ -108,7 +108,6 @@ protected: uint32 _numVectorPointers; uint16 *_vectorPointers; - byte _palette[3 * 256]; byte *_frame; Audio::AppendableAudioStream *_stream; -- cgit v1.2.3