[Scummvm-cvs-logs] SF.net SVN: scummvm: [26314] scummvm/trunk/engines/parallaction

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Wed Mar 28 22:12:01 CEST 2007


Revision: 26314
          http://scummvm.svn.sourceforge.net/scummvm/?rev=26314&view=rev
Author:   peres001
Date:     2007-03-28 13:12:00 -0700 (Wed, 28 Mar 2007)

Log Message:
-----------
Overhaul of palette management to bring it back to its original form. Gfx palette code has been updated, and _c_endComment (callable from scripts) has been implemented. As a by-product, palette cycling now finally works!

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/callables.cpp
    scummvm/trunk/engines/parallaction/disk.cpp
    scummvm/trunk/engines/parallaction/graphics.cpp
    scummvm/trunk/engines/parallaction/graphics.h
    scummvm/trunk/engines/parallaction/location.cpp
    scummvm/trunk/engines/parallaction/menu.cpp
    scummvm/trunk/engines/parallaction/parallaction.cpp

Modified: scummvm/trunk/engines/parallaction/callables.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/callables.cpp	2007-03-27 22:04:50 UTC (rev 26313)
+++ scummvm/trunk/engines/parallaction/callables.cpp	2007-03-28 20:12:00 UTC (rev 26314)
@@ -63,15 +63,14 @@
 }
 
 void _c_fade(void *parm) {
-	byte palette[PALETTE_SIZE];
-	_vm->_gfx->getBlackPalette(palette);
-	_vm->_gfx->setPalette(palette);
+	_vm->_gfx->setBlackPalette();
 
 	_vm->_gfx->swapBuffers();
 
+	Gfx::Palette pal;
 	for (uint16 _di = 0; _di < 64; _di++) {
-		_vm->_gfx->fadePalette(palette);
-		_vm->_gfx->setPalette(palette);
+		_vm->_gfx->fadePalette(pal);
+		_vm->_gfx->setPalette(pal);
 	}
 
 	_vm->waitTime( 1 );
@@ -202,26 +201,113 @@
 	return;
 }
 
-void _c_endComment(void *parm) {
+void _c_endComment(void *param) {
 
+	byte* _enginePal = _vm->_gfx->_palette;
+	Gfx::Palette pal;
+
+	uint32 si;
+	for (si = 0; si < 32; si++) {
+
+		byte al = _enginePal[si*3+1];
+		if (al > _enginePal[si*3+2]) {
+			al = _enginePal[si*3+1];
+		} else {
+			al = _enginePal[si*3+2];
+		}
+
+		if (al < _enginePal[si*3]) {
+			al = _enginePal[si*3];
+		} else {
+			al = _enginePal[si*3+1];
+		}
+
+		if (al > _enginePal[si*3+2]) {
+			al = _enginePal[si*3+1];
+		} else {
+			al = _enginePal[si*3+2];
+		}
+
+		pal[si*3] = al;
+		pal[si*3+2] = al;
+		pal[si*3+1] = al;
+
+	}
+
+	int16 w = 0, h = 0;
+	_vm->_gfx->getStringExtent(_vm->_location._endComment, 130, &w, &h);
+
+	Common::Rect r(w+5, h+5);
+	r.moveTo(5, 5);
+	_vm->_gfx->floodFill(Gfx::kBitFront, r, 0);
+
+	r.setWidth(w+3);
+	r.setHeight(w+4);
+	r.moveTo(7, 7);
+	_vm->_gfx->floodFill(Gfx::kBitFront, r, 1);
+
+	_vm->_gfx->setFont("comic");
+	_vm->_gfx->displayWrappedString(_vm->_location._endComment, 3, 5, 130, 0);
+
+	uint32 di = 0;
+	for (di = 0; di < PALETTE_COLORS; di++) {
+		for (si = 0; si <= 93; si +=3) {
+
+			char al;
+
+			if (_enginePal[si] != pal[si]) {
+				al = _enginePal[si];
+				if (al > pal[si])
+					al = 1;
+				else
+					al = -1;
+				_enginePal[si] += al;
+			}
+
+			if (_enginePal[si+1] != pal[si+1]) {
+				al = _enginePal[si+1];
+				if (al > pal[si+1])
+					al = 1;
+				else
+					al = -1;
+				_enginePal[si+1] += al;
+			}
+
+			if (_enginePal[si+2] != pal[si+2]) {
+				al = _enginePal[si+2];
+				if (al > pal[si+2])
+					al = 1;
+				else
+					al = -1;
+				_enginePal[si+2] += al;
+			}
+
+		}
+
+		_vm->_gfx->setPalette(_enginePal);
+	}
+
+	waitUntilLeftClick();
+
+	return;
 }
 
 void _c_frankenstein(void *parm) {
-	byte pal0[PALETTE_SIZE], pal1[PALETTE_SIZE];
+	Gfx::Palette pal0;
 
-	for (uint16 i = 0; i <= PALETTE_COLORS; i++) {
-		pal0[i] = _vm->_gfx->_palette[i];
-		pal0[i*3+1] = 0;
-		pal0[i*3+2] = 0;
+	for (uint16 i = 0; i <= BASE_PALETTE_COLORS; i++) {
+		pal0[(i+FIRST_BASE_COLOR)] = _vm->_gfx->_palette[i];
+		pal0[(i+FIRST_BASE_COLOR)*3+1] = 0;
+		pal0[(i+FIRST_BASE_COLOR)*3+2] = 0;
+		pal0[(i+FIRST_EHB_COLOR)*3+1] = 0;
+		pal0[(i+FIRST_EHB_COLOR)*3+2] = 0;
 	}
 
-	_vm->_gfx->getBlackPalette(pal1);
-
 	for (uint16 _di = 0; _di < 30; _di++) {
 		g_system->delayMillis(20);
-		_vm->_gfx->setPalette(pal0);
+		_vm->_gfx->setPalette(pal0, FIRST_BASE_COLOR, BASE_PALETTE_COLORS);
 		g_system->delayMillis(20);
-		_vm->_gfx->setPalette(pal1);
+		_vm->_gfx->setPalette(pal0, FIRST_EHB_COLOR, EHB_PALETTE_COLORS);
 	}
 
 	_vm->_gfx->setPalette(_vm->_gfx->_palette);
@@ -272,7 +358,7 @@
 	cleanInventory();
 	refreshInventory(_vm->_characterName);
 
-	_vm->_gfx->palUnk0(_vm->_gfx->_palette);
+	_vm->_gfx->extendPalette(_vm->_gfx->_palette);
 
 	if (gameCompleted) {
 		_vm->_gfx->setFont("slide");

Modified: scummvm/trunk/engines/parallaction/disk.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/disk.cpp	2007-03-27 22:04:50 UTC (rev 26313)
+++ scummvm/trunk/engines/parallaction/disk.cpp	2007-03-28 20:12:00 UTC (rev 26314)
@@ -428,9 +428,8 @@
 
 void DosDisk::parseBackground(Common::SeekableReadStream &stream) {
 
-	byte pal[96];
-	stream.read(pal, PALETTE_SIZE);
-	_vm->_gfx->setPalette(pal);
+	stream.read(_vm->_gfx->_palette, BASE_PALETTE_SIZE);
+	_vm->_gfx->setPalette(_vm->_gfx->_palette);
 
 	parseDepths(stream);
 
@@ -442,14 +441,6 @@
 		_vm->_gfx->_palettefx[_si]._last = stream.readByte();
 	}
 
-#if 0
-	uint16 v147;
-	for (v147 = 0; v147 < PALETTE_SIZE; v147++) {
-		byte _al = _vm->_gfx->_palette[v147];
-		_vm->_gfx->_palette[PALETTE_SIZE+v147] = _al / 2;
-	}
-#endif
-
 }
 
 void DosDisk::loadBackground(const char *filename) {
@@ -744,7 +735,7 @@
 }
 
 Cnv* AmigaDisk::loadObjects(const char *name) {
-	debugC(1, kDebugDisk, "AmigaDisk::loadObjects '%s'", name);
+	debugC(1, kDebugDisk, "AmigaDisk::loadObjects");
 	return NULL;
 }
 
@@ -791,13 +782,13 @@
 	Graphics::ILBMDecoder decoder(stream);
 	decoder.decode(surf, pal);
 
-	for (uint32 i = 0; i < 96; i++)
-		pal[i] >>= 2;
+	for (uint32 i = 0; i < PALETTE_SIZE; i++)
+		_vm->_gfx->_palette[i] = pal[i] >> 2;
 
-
-	_vm->_gfx->setPalette(pal);
 	free(pal);
 
+	_vm->_gfx->setPalette(_vm->_gfx->_palette);
+
 	_vm->_gfx->setBackground(static_cast<byte*>(surf.pixels));
 
 	surf.free();
@@ -811,7 +802,7 @@
 }
 
 Table* AmigaDisk::loadTable(const char* name) {
-	printf("AmigaDisk::loadTable\n");
+//	printf("AmigaDisk::loadTable\n");
 
 	char path[PATH_LEN];
 	sprintf(path, "%s.table", name);

Modified: scummvm/trunk/engines/parallaction/graphics.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.cpp	2007-03-27 22:04:50 UTC (rev 26313)
+++ scummvm/trunk/engines/parallaction/graphics.cpp	2007-03-28 20:12:00 UTC (rev 26314)
@@ -33,8 +33,6 @@
 
 namespace Parallaction {
 
-
-
 //
 //	proportional font glyphs width
 //
@@ -52,18 +50,6 @@
 bool		Gfx::_proportionalFont = false;
 byte *		Gfx::_buffers[];
 
-#define PALETTE_BACKUP	PALETTE_SIZE
-
-byte _black_palette[PALETTE_SIZE] = {
-	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-};
-
-
 #define BALLOON_WIDTH	12
 #define BALLOON_HEIGHT	10
 
@@ -128,98 +114,39 @@
 }
 
 
+void Gfx::setPalette(Palette pal, uint32 first, uint32 num) {
+//	printf("setPalette(%i, %i)\n", first, num);
 
-//
-//	palette management
-//
+	if (first + num > PALETTE_COLORS)
+		error("wrong parameters for setPalette()");
 
-void Gfx::setPalette(byte *palette) {
-//	memcpy(_palette, palette, PALETTE_SIZE);
-
 	byte syspal[PALETTE_COLORS*4];
 
-	for (uint32 i = 0; i < PALETTE_COLORS; i++) {
-		syspal[i*4]   = (palette[i*3] << 2) | (palette[i*3] >> 4);
-		syspal[i*4+1] = (palette[i*3+1] << 2) | (palette[i*3+1] >> 4);
-		syspal[i*4+2] = (palette[i*3+2] << 2) | (palette[i*3+2] >> 4);
+	for (uint32 i = first; i < first+num; i++) {
+		syspal[i*4]   = (pal[i*3] << 2) | (pal[i*3] >> 4);
+		syspal[i*4+1] = (pal[i*3+1] << 2) | (pal[i*3+1] >> 4);
+		syspal[i*4+2] = (pal[i*3+2] << 2) | (pal[i*3+2] >> 4);
 		syspal[i*4+3] = 0;
 	}
 
-	g_system->setPalette(syspal, 0, PALETTE_COLORS);
+	g_system->setPalette(syspal, first, num);
 	g_system->updateScreen();
-	return;
-}
 
-void Gfx::getBlackPalette(byte *palette) {
-	memcpy(palette, _black_palette, PALETTE_SIZE);
 	return;
 }
 
-void Gfx::palUnk0(byte *palette) {
-#if 0
-	for (uint16 i = 0; i < PALETTE_SIZE; i++) {
-		palette[PALETTE_BACKUP+i] = _palette[i]/2;
-	}
-#endif
-//	Gfx::setPalette(palette);
-
-	return;
+void Gfx::setBlackPalette() {
+	Palette pal;
+	memset(pal, 0, PALETTE_SIZE);
+	setPalette(pal);
 }
 
-void Gfx::buildBWPalette(byte *palette) {
-
-	for (uint16 i = 0; i < PALETTE_COLORS; i++) {
-		byte max;
-
-		if (_palette[i*3+1] > _palette[i*3+2]) {
-			max = _palette[i*3+1];
-		} else {
-			max = _palette[i*3+2];
-		}
-
-		if (_palette[i*3] > max) {
-			max = _palette[i*3];
-		} else {
-			if (_palette[i*3+1] > _palette[i*3+2]) {
-				max = _palette[i*3+1];
-			} else {
-				max = _palette[i*3+2];
-			}
-		}
-
-		palette[i*3] = max;
-		palette[i*3+1] = max;
-		palette[i*3+2] = max;
-	}
-
-	return;
-}
-
-void Gfx::fadePalette(byte *palette) {
-
-	for (uint16 i = 0; i < PALETTE_SIZE; i++)
-		if (palette[i] < _palette[i]) palette[i]++;
-
-
-	return;
-}
-
-void Gfx::quickFadePalette(byte *palette) {
-
-	for (uint16 i = 0; i < PALETTE_SIZE; i++) {
-		if (palette[i] == _palette[i]) continue;
-		palette[i] += (palette[i] < _palette[i] ? 4 : -4);
-	}
-
-	return;
-}
-
 //
 //	palette Animation
 //
 //	FIXME: the effect is different from the original
 //
-void Gfx::animatePalette(byte *palette) {
+void Gfx::animatePalette() {
 // printf("Gfx::animatePalette()\n");
 
 	byte tmp[3];
@@ -240,11 +167,11 @@
 			tmp[1] = _palette[_palettefx[i]._first * 3 + 1];
 			tmp[2] = _palette[_palettefx[i]._first * 3 + 2];
 
-			memmove(palette+_palettefx[i]._first*3, _palette+(_palettefx[i]._first+1)*3, (_palettefx[i]._last - _palettefx[i]._first)*3);
+			memmove(_palette+_palettefx[i]._first*3, _palette+(_palettefx[i]._first+1)*3, (_palettefx[i]._last - _palettefx[i]._first)*3);
 
-			palette[_palettefx[i]._last * 3]	 = tmp[0];
-			palette[_palettefx[i]._last * 3 + 1] = tmp[1];
-			palette[_palettefx[i]._last * 3 + 2] = tmp[2];
+			_palette[_palettefx[i]._last * 3]	 = tmp[0];
+			_palette[_palettefx[i]._last * 3 + 1] = tmp[1];
+			_palette[_palettefx[i]._last * 3 + 2] = tmp[2];
 
 		} else {											// backward
 
@@ -252,22 +179,67 @@
 			tmp[1] = _palette[_palettefx[i]._last * 3 + 1];
 			tmp[2] = _palette[_palettefx[i]._last * 3 + 2];
 
-			memmove(palette+(_palettefx[i]._first+1)*3, _palette+_palettefx[i]._first*3, (_palettefx[i]._last - _palettefx[i]._first)*3);
+			memmove(_palette+(_palettefx[i]._first+1)*3, _palette+_palettefx[i]._first*3, (_palettefx[i]._last - _palettefx[i]._first)*3);
 
-			palette[_palettefx[i]._first * 3]	  = tmp[0];
-			palette[_palettefx[i]._first * 3 + 1] = tmp[1];
-			palette[_palettefx[i]._first * 3 + 2] = tmp[2];
+			_palette[_palettefx[i]._first * 3]	  = tmp[0];
+			_palette[_palettefx[i]._first * 3 + 1] = tmp[1];
+			_palette[_palettefx[i]._first * 3 + 2] = tmp[2];
 
 		}
 
 	}
 
+	setPalette(_palette);
+
 	return;
 }
 
+void Gfx::fadePalette(Palette pal) {
+	for (uint16 i = 0; i < PALETTE_SIZE; i++)
+		if (pal[i] < _palette[i]) pal[i]++;
 
+	return;
+}
 
+void Gfx::buildBWPalette(Palette pal) {
 
+	for (uint16 i = 0; i < BASE_PALETTE_COLORS; i++) {
+		byte max;
+
+		max = MAX(_palette[i*3+1], _palette[i*3+2]);
+		max = MAX(max, _palette[i*3]);
+
+		pal[i*3] = max;
+		pal[i*3+1] = max;
+		pal[i*3+2] = max;
+	}
+
+	return;
+}
+
+void Gfx::quickFadePalette(Palette pal) {
+
+	for (uint16 i = 0; i < PALETTE_SIZE; i++) {
+		if (pal[i] == _palette[i]) continue;
+		pal[i] += (pal[i] < _palette[i] ? 4 : -4);
+	}
+
+	return;
+}
+
+void Gfx::extendPalette(Palette pal) {
+
+	for (uint16 i = 0; i < BASE_PALETTE_COLORS; i++) {
+		pal[(i+FIRST_EHB_COLOR)*3] = pal[i*3] / 2;
+		pal[(i+FIRST_EHB_COLOR)*3+1] = pal[i*3+1] / 2;
+		pal[(i+FIRST_EHB_COLOR)*3+2] = pal[i*3+2] / 2;
+	}
+
+	setPalette(pal);
+}
+
+
+
 void Gfx::updateScreen() {
 //	  printf("Gfx::updateScreen()\n");
 	g_system->copyRectToScreen(_buffers[kBitFront], SCREEN_WIDTH, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
@@ -950,16 +922,12 @@
 	_vm(vm) {
 
 	g_system->beginGFXTransaction();
-
 	g_system->initSize(SCREEN_WIDTH, SCREEN_HEIGHT);
-
 	g_system->endGFXTransaction();
 
 	initBuffers();
 
-	byte palette[PALETTE_SIZE];
-	getBlackPalette(palette);
-	setPalette(palette);
+	setBlackPalette();
 
 	initMouse( 0 );
 

Modified: scummvm/trunk/engines/parallaction/graphics.h
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.h	2007-03-27 22:04:50 UTC (rev 26313)
+++ scummvm/trunk/engines/parallaction/graphics.h	2007-03-28 20:12:00 UTC (rev 26314)
@@ -38,9 +38,19 @@
 #define SCREENMASK_WIDTH	SCREEN_WIDTH/4
 #define SCREENPATH_WIDTH	SCREEN_WIDTH/8
 
-#define PALETTE_COLORS		32
-#define PALETTE_SIZE		PALETTE_COLORS*3
+#define BASE_PALETTE_COLORS		32
+#define FIRST_BASE_COLOR		0
+#define LAST_BASE_COLOR			(FIRST_BASE_COLOR+BASE_PALETTE_COLORS-1)
 
+#define EHB_PALETTE_COLORS		32										// extra half-brite colors for amiga
+#define FIRST_EHB_COLOR			(LAST_BASE_COLOR+1)
+#define LAST_EHB_COLOR			(FIRST_EHB_COLOR+EHB_PALETTE_COLORS-1)
+
+#define PALETTE_COLORS			(BASE_PALETTE_COLORS+EHB_PALETTE_COLORS)
+
+#define BASE_PALETTE_SIZE		BASE_PALETTE_COLORS*3
+#define PALETTE_SIZE			PALETTE_COLORS*3
+
 #include "common/pack-start.h"	// START STRUCT PACKING
 
 struct PaletteFxRange {
@@ -65,6 +75,8 @@
 class Gfx {
 
 public:
+	typedef byte Palette[PALETTE_SIZE];
+
 	enum Buffers {
 		// bit buffers
 		kBitFront,
@@ -119,13 +131,13 @@
 	void blitCnv(StaticCnv *cnv, int16 x, int16 y, uint16 z, Gfx::Buffers buffer);
 
 	// palette
-	void animatePalette(byte *palette);
-	void setPalette(byte *palette);
-	void getBlackPalette(byte *palette);
-	void palUnk0(byte *palette);
-	void buildBWPalette(byte *palette);
-	void quickFadePalette(byte *palette);
-	void fadePalette(byte *palette);
+	void setPalette(Palette palette, uint32 first = FIRST_BASE_COLOR, uint32 num = PALETTE_COLORS);
+	void setBlackPalette();
+	void animatePalette();
+	void fadePalette(Palette palette);
+	void buildBWPalette(Palette palette);
+	void quickFadePalette(Palette palette);
+	void extendPalette(Palette palette);
 
 	// init
 	Gfx(Parallaction* vm);
@@ -141,7 +153,7 @@
 
 	uint16				_bgLayers[4];
 	PaletteFxRange		_palettefx[6];
-	byte				_palette[PALETTE_SIZE];
+	Palette				_palette;
 
 protected:
 	Parallaction*		_vm;

Modified: scummvm/trunk/engines/parallaction/location.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/location.cpp	2007-03-27 22:04:50 UTC (rev 26313)
+++ scummvm/trunk/engines/parallaction/location.cpp	2007-03-28 20:12:00 UTC (rev 26314)
@@ -255,20 +255,20 @@
 void switchBackground(const char* background, const char* mask) {
 //	printf("switchBackground(%s)", name);
 
-	byte palette[PALETTE_SIZE];
+	Gfx::Palette pal;
 
 	uint16 v2 = 0;
 	if (!scumm_stricmp(background, "final")) {
 		_vm->_gfx->clearScreen(Gfx::kBitBack);
 		for (uint16 _si = 0; _si <= 93; ) {
-			palette[_si] = v2;
-			palette[_si+1] = v2;
-			palette[_si+2] = v2;
+			pal[_si] = v2;
+			pal[_si+1] = v2;
+			pal[_si+2] = v2;
 			v2 += 4;
 			_si += 3;
 		}
 
-		_vm->_gfx->palUnk0(palette);
+		_vm->_gfx->extendPalette(pal);
 	}
 
 	_vm->_disk->loadScenery(background, mask);
@@ -283,7 +283,7 @@
 void Parallaction::showSlide(const char *name) {
 
 	_disk->loadSlide(name);
-	_gfx->palUnk0(_vm->_gfx->_palette);
+	_gfx->extendPalette(_vm->_gfx->_palette);
 	_gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront);
 
 	debugC(1, kDebugLocation, "changeLocation: new background set");
@@ -401,7 +401,7 @@
 
 	byte palette[PALETTE_SIZE];
 	for (uint16 _si = 0; _si < PALETTE_SIZE; _si++) palette[_si] = 0;
-	_gfx->palUnk0(palette);
+	_gfx->extendPalette(palette);
 	_gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront);
 	if (_location._commands) {
 		runCommands(_location._commands);
@@ -419,7 +419,7 @@
 	runJobs();
 	_gfx->swapBuffers();
 
-	_gfx->palUnk0(_vm->_gfx->_palette);
+	_gfx->extendPalette(_vm->_gfx->_palette);
 	if (_location._aCommands) {
 		runCommands(_location._aCommands);
 		debugC(1, kDebugLocation, "changeLocation: location acommands run");
@@ -443,11 +443,11 @@
 void Parallaction::doLocationEnterTransition() {
 	debugC(1, kDebugLocation, "doLocationEnterTransition");
 
-	byte v60[PALETTE_SIZE];
 	if (_localFlags[_currentLocationIndex] & kFlagsVisited) return; // visited
 
-	_vm->_gfx->buildBWPalette(v60);
-	_vm->_gfx->setPalette(v60);
+	byte pal[PALETTE_SIZE];
+	_vm->_gfx->buildBWPalette(pal);
+	_vm->_gfx->setPalette(pal, FIRST_BASE_COLOR, BASE_PALETTE_COLORS);
 
 	jobRunScripts(NULL, NULL);
 	jobEraseAnimations(NULL, NULL);
@@ -481,8 +481,8 @@
 	// fades maximum intensity palette towards approximation of main palette
 	for (uint16 _si = 0; _si<6; _si++) {
 		waitTime( 1 );
-		_vm->_gfx->quickFadePalette(v60);
-		_vm->_gfx->setPalette(v60);
+		_vm->_gfx->quickFadePalette(pal);
+		_vm->_gfx->setPalette(pal);
 	}
 
 	debugC(1, kDebugLocation, "doLocationEnterTransition completed");

Modified: scummvm/trunk/engines/parallaction/menu.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/menu.cpp	2007-03-27 22:04:50 UTC (rev 26313)
+++ scummvm/trunk/engines/parallaction/menu.cpp	2007-03-28 20:12:00 UTC (rev 26314)
@@ -106,13 +106,13 @@
 	_vm->_gfx->setFont("slide");
 
 	_vm->_disk->loadSlide("intro");
-	_vm->_gfx->palUnk0(_vm->_gfx->_palette);
+	_vm->_gfx->extendPalette(_vm->_gfx->_palette);
 	_vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront);
 
 	g_system->delayMillis(2000);
 
 	_vm->_disk->loadSlide("minintro");
-	_vm->_gfx->palUnk0(_vm->_gfx->_palette);
+	_vm->_gfx->extendPalette(_vm->_gfx->_palette);
 	_vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront);
 
 	g_system->delayMillis(2000);
@@ -120,7 +120,7 @@
 	if (_vm->getPlatform() == Common::kPlatformPC) {
 
 		_vm->_disk->loadSlide("lingua");
-		_vm->_gfx->palUnk0(_vm->_gfx->_palette);
+		_vm->_gfx->extendPalette(_vm->_gfx->_palette);
 		_vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront);
 
 		_vm->_gfx->displayString(60, 30, "SELECT LANGUAGE");
@@ -144,7 +144,7 @@
 	const char **v14 = introMsg3;
 
 	_vm->_disk->loadScenery("test", NULL);
-	_vm->_gfx->palUnk0(_vm->_gfx->_palette);
+	_vm->_gfx->extendPalette(_vm->_gfx->_palette);
 	_vm->_gfx->swapBuffers();
 
 	uint16 _ax = (SCREEN_WIDTH - _vm->_gfx->getStringWidth(v14[0])) / 2;
@@ -217,7 +217,7 @@
 
 
 	_vm->_disk->loadSlide("restore");
-	_vm->_gfx->palUnk0(_vm->_gfx->_palette);
+	_vm->_gfx->extendPalette(_vm->_gfx->_palette);
 	_vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront);
 
 	_vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBit2);
@@ -297,7 +297,7 @@
 
 	_vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront);	//
 	_vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBit2);		//
-	_vm->_gfx->palUnk0(_vm->_gfx->_palette);
+	_vm->_gfx->extendPalette(_vm->_gfx->_palette);
 
 	while (askPassword == true) {
 
@@ -371,9 +371,7 @@
 		}
 	}
 
-	byte palette[PALETTE_SIZE];
-	_vm->_gfx->getBlackPalette(palette);
-	_vm->_gfx->setPalette(palette);
+	_vm->_gfx->setBlackPalette();
 
 	_engineFlags |= kEngineChangeLocation;
 

Modified: scummvm/trunk/engines/parallaction/parallaction.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.cpp	2007-03-27 22:04:50 UTC (rev 26313)
+++ scummvm/trunk/engines/parallaction/parallaction.cpp	2007-03-28 20:12:00 UTC (rev 26314)
@@ -402,10 +402,7 @@
 
 		if ((_engineFlags & kEnginePauseJobs) == 0 || (_engineFlags & kEngineInventory)) {
 			_gfx->swapBuffers();
-			byte palette[PALETTE_SIZE];
-			memcpy(palette, _vm->_gfx->_palette, sizeof(palette));
-			_gfx->animatePalette(palette);
-			_gfx->setPalette(palette);
+			_gfx->animatePalette();
 		}
 
 	}


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