[Scummvm-cvs-logs] SF.net SVN: scummvm: [22567] scummvm/trunk/engines/kyra

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Sun May 21 13:42:02 CEST 2006


Revision: 22567
Author:   eriktorbjorn
Date:     2006-05-21 13:41:53 -0700 (Sun, 21 May 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=22567&view=rev

Log Message:
-----------
Palette handling simplification, suggested by LordHoto.

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/vqa.cpp
    scummvm/trunk/engines/kyra/vqa.h
Modified: scummvm/trunk/engines/kyra/vqa.cpp
===================================================================
--- scummvm/trunk/engines/kyra/vqa.cpp	2006-05-21 20:25:22 UTC (rev 22566)
+++ scummvm/trunk/engines/kyra/vqa.cpp	2006-05-21 20:41:53 UTC (rev 22567)
@@ -463,7 +463,6 @@
 
 		byte *inbuf, *outbuf;
 		uint32 insize, outsize;
-		byte *pal;
 		uint32 end;
 
 		switch (tag) {
@@ -532,32 +531,13 @@
 
 				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 @@
 	// 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;

Modified: scummvm/trunk/engines/kyra/vqa.h
===================================================================
--- scummvm/trunk/engines/kyra/vqa.h	2006-05-21 20:25:22 UTC (rev 22566)
+++ scummvm/trunk/engines/kyra/vqa.h	2006-05-21 20:41:53 UTC (rev 22567)
@@ -108,7 +108,6 @@
 	uint32 _numVectorPointers;
 	uint16 *_vectorPointers;
 
-	byte _palette[3 * 256];
 	byte *_frame;
 
 	Audio::AppendableAudioStream *_stream;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the Scummvm-git-logs mailing list