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

athrxx at users.sourceforge.net athrxx at users.sourceforge.net
Sun Oct 11 20:40:22 CEST 2009


Revision: 44936
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44936&view=rev
Author:   athrxx
Date:     2009-10-11 18:40:21 +0000 (Sun, 11 Oct 2009)

Log Message:
-----------
LOL/PC-98: fix king richard healing sequence

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/screen.cpp
    scummvm/trunk/engines/kyra/screen_lol.cpp
    scummvm/trunk/engines/kyra/script_lol.cpp

Modified: scummvm/trunk/engines/kyra/screen.cpp
===================================================================
--- scummvm/trunk/engines/kyra/screen.cpp	2009-10-11 17:59:23 UTC (rev 44935)
+++ scummvm/trunk/engines/kyra/screen.cpp	2009-10-11 18:40:21 UTC (rev 44936)
@@ -1361,7 +1361,7 @@
 		&Screen::drawShapePlotType13,		// used by Kyra 1
 		&Screen::drawShapePlotType14,		// used by Kyra 1 (invisibility)
 		&Screen::drawShapePlotType11_15,	// used by Kyra 1 (invisibility)
-		&Screen::drawShapePlotType16,	// used by LoL PC-98/16 Colors (teleporters),
+		&Screen::drawShapePlotType16,		// used by LoL PC-98/16 Colors (teleporters),
 		0, 0, 0,
 		&Screen::drawShapePlotType20,		// used by LoL (heal spell effect)
 		&Screen::drawShapePlotType21,		// used by LoL (white tower spirits)

Modified: scummvm/trunk/engines/kyra/screen_lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/screen_lol.cpp	2009-10-11 17:59:23 UTC (rev 44935)
+++ scummvm/trunk/engines/kyra/screen_lol.cpp	2009-10-11 18:40:21 UTC (rev 44936)
@@ -939,16 +939,17 @@
 }
 
 Palette **Screen_LoL::generateFadeTable(Palette **dst, Palette *src1, Palette *src2, int numTabs) {
-	if (!src1)
+	int len = _use16ColorMode ? 48 : 768;
+	if (!src1) 
 		src1 = _screenPalette;
-
+	
 	uint8 *p1 = (*dst++)->getData();
 	uint8 *p2 = src1->getData();
 	uint8 *p3 = src2->getData();
 	uint8 *p4 = p1;
 	uint8 *p5 = p2;
 
-	for (int i = 0; i < 768; i++) {
+	for (int i = 0; i < len; i++) {
 		int8 val = (int8)*p3++ - (int8)*p2++;
 		*p4++ = (uint8)val;
 	}
@@ -962,13 +963,13 @@
 		t += d;
 		p4 = (*dst++)->getData();
 
-		for (int ii = 0; ii < 768; ii++) {
+		for (int ii = 0; ii < len; ii++) {
 			int16 val = (((int8)*p3++ * t) >> 8) + (int8)*p2++;
 			*p4++ = (uint8)val;
 		}
 	}
 
-	memcpy(p1, p5, 768);
+	memcpy(p1, p5, len);
 	(*dst)->copy(*src2);
 
 	return ++dst;

Modified: scummvm/trunk/engines/kyra/script_lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/script_lol.cpp	2009-10-11 17:59:23 UTC (rev 44935)
+++ scummvm/trunk/engines/kyra/script_lol.cpp	2009-10-11 18:40:21 UTC (rev 44936)
@@ -2027,7 +2027,7 @@
 
 int LoLEngine::olol_restoreFadePalette(EMCState *script) {
 	debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_restoreFadePalette(%p)", (const void *)script);
-	_screen->getPalette(0).copy(_screen->getPalette(1), 0, 128);
+	_screen->getPalette(0).copy(_screen->getPalette(1), 0, _flags.use16ColorMode ? 16 : 128);
 	_screen->fadePalette(_screen->getPalette(0), 10);
 	_screen->_fadeFlag = 0;
 	return 1;
@@ -2210,17 +2210,41 @@
 
 	Palette *fadeTab[28];
 	for (int i = 0; i < 28; i++)
-		fadeTab[i] = new Palette(256);
+		fadeTab[i] = new Palette(_flags.use16ColorMode ? 16 : 256);
 
 	Palette **tpal1 = &fadeTab[0];
 	Palette **tpal2 = &fadeTab[1];
 	Palette **tpal3 = &fadeTab[2];
 	Palette **tpal4 = 0;
-	_screen->loadPalette("LITEPAL1.COL", **tpal1);
+
+	if (_flags.use16ColorMode) {		
+		const uint8 *s = _res->fileData("LITEPAL1.COL", 0);
+		(*tpal1)->copy(s, 0, 16);
+		delete[] s;
+	} else {
+		_screen->loadPalette("LITEPAL1.COL", **tpal1);
+	}
+
 	tpal2 = _screen->generateFadeTable(tpal3, 0, *tpal1, 21);
-	_screen->loadPalette("LITEPAL2.COL", **tpal2);
+
+	if (_flags.use16ColorMode) {	
+		const uint8 *s = _res->fileData("LITEPAL2.COL", 0);
+		(*tpal2)->copy(s, 0, 16);
+		delete[] s;
+	} else {
+		_screen->loadPalette("LITEPAL2.COL", **tpal2);
+	}
+
 	tpal4 = tpal2++;
-	_screen->loadPalette("LITEPAL3.COL", **tpal1);
+
+	if (_flags.use16ColorMode) {		
+		const uint8 *s = _res->fileData("LITEPAL3.COL", 0);
+		(*tpal1)->copy(s, 0, 16);
+		delete[] s;
+	} else {
+		_screen->loadPalette("LITEPAL3.COL", **tpal1);
+	}
+
 	_screen->generateFadeTable(tpal2, *tpal4, *tpal1, 4);
 
 	for (int i = 0; i < 21; i++) {


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