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

athrxx at users.sourceforge.net athrxx at users.sourceforge.net
Thu Nov 12 08:41:34 CET 2009


Revision: 45852
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45852&view=rev
Author:   athrxx
Date:     2009-11-12 07:41:33 +0000 (Thu, 12 Nov 2009)

Log Message:
-----------
LOL: - cleanup

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/lol.cpp
    scummvm/trunk/engines/kyra/screen_lol.cpp
    scummvm/trunk/engines/kyra/screen_lol.h

Modified: scummvm/trunk/engines/kyra/lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/lol.cpp	2009-11-12 03:25:10 UTC (rev 45851)
+++ scummvm/trunk/engines/kyra/lol.cpp	2009-11-12 07:41:33 UTC (rev 45852)
@@ -1758,12 +1758,17 @@
 	if (_flags.isTalkie || _loadSuppFilesFlag)
 		return;
 
-	Palette tpal(256);
+	uint8 *tpal = new uint8[768];
+
 	if (_flags.use16ColorMode) {
-		static const uint8 colTbl[] = { 0x00, 0x00, 0x11, 0x00, 0x22, 0x00, 0x33, 0x00, 0x44, 0x00, 0x55, 0x00, 0x66, 0x00, 0x77, 0x00, 0x88, 0x00, 0x99, 0x00, 0xAA, 0x00, 0xBB, 0x00, 0xCC, 0x00, 0xDD, 0x00, 0xEE, 0x00, 0xFF, 0x00 };
-		memset(tpal.getData(), 0xff, 768);
+		static const uint8 colTbl[] = {
+			0x00, 0x00, 0x11, 0x00, 0x22, 0x00, 0x33, 0x00, 0x44, 0x00, 0x55, 0x00, 0x66, 0x00, 0x77, 0x00,
+			0x88, 0x00, 0x99, 0x00, 0xAA, 0x00, 0xBB, 0x00, 0xCC, 0x00, 0xDD, 0x00, 0xEE, 0x00, 0xFF, 0x00
+		};
 
-		_res->loadFileToBuf("LOL.NOL", tpal.getData(), 48);
+		memset(tpal, 0xff, 768);
+		_res->loadFileToBuf("LOL.NOL", tpal, 48);
+
 		for (int i = 15; i > -1; i--) {
 			int s = colTbl[i << 1] * 3;	
 			tpal[s] = tpal[i * 3];
@@ -1773,14 +1778,16 @@
 		}
 
 		_screen->createTransparencyTablesIntern(colTbl, 16, tpal, tpal,  _transparencyTable1, _transparencyTable2, 80);
+
 	} else {
-		_screen->loadPalette("fxpal.col", tpal);
+		_res->loadFileToBuf("fxpal.col", tpal, 768);
 		_screen->loadBitmap("fxpal.shp", 3, 3, 0);
 		const uint8 *shpPal = _screen->getPtrToShape(_screen->getCPagePtr(2), 0) + 11;
 
-		_screen->createTransparencyTablesIntern(shpPal, 20, tpal, _screen->getPalette(1), _transparencyTable1, _transparencyTable2, 70);
+		_screen->createTransparencyTablesIntern(shpPal, 20, tpal, _screen->getPalette(1).getData(), _transparencyTable1, _transparencyTable2, 70);
 	}
 
+	delete[] tpal;
 	_loadSuppFilesFlag = 1;
 }
 

Modified: scummvm/trunk/engines/kyra/screen_lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/screen_lol.cpp	2009-11-12 03:25:10 UTC (rev 45851)
+++ scummvm/trunk/engines/kyra/screen_lol.cpp	2009-11-12 07:41:33 UTC (rev 45852)
@@ -245,7 +245,10 @@
 	return ovl;
 }
 
-void Screen_LoL::createTransparencyTablesIntern(const uint8 *ovl, int a, const Palette &fxPal, const Palette &screenPal, uint8 *outTable1, uint8 *outTable2, int b) {
+void Screen_LoL::createTransparencyTablesIntern(const uint8 *ovl, int a, const uint8 *fxPal1, const uint8 *fxPal2, uint8 *outTable1, uint8 *outTable2, int b) {
+	Palette screenPal(256);
+	screenPal.copy(fxPal2, 0, 256);
+
 	memset(outTable1, 0xff, 256);
 
 	for (int i = 0; i < a; i++)
@@ -261,9 +264,9 @@
 			uint16 t2 = 64 - t1;
 
 			uint8 c = ovl[i];
-			fcol[0] = fxPal[3 * c];
-			fcol[1] = fxPal[3 * c + 1];
-			fcol[2] = fxPal[3 * c + 2];
+			fcol[0] = fxPal1[3 * c];
+			fcol[1] = fxPal1[3 * c + 1];
+			fcol[2] = fxPal1[3 * c + 2];
 
 			uint8 *o = &outTable2[i << 8];
 

Modified: scummvm/trunk/engines/kyra/screen_lol.h
===================================================================
--- scummvm/trunk/engines/kyra/screen_lol.h	2009-11-12 03:25:10 UTC (rev 45851)
+++ scummvm/trunk/engines/kyra/screen_lol.h	2009-11-12 07:41:33 UTC (rev 45852)
@@ -82,7 +82,7 @@
 	uint8 *generateLevelOverlay(const Palette &Pal, uint8 *ovl, int opColor, int weight);
 	uint8 *getLevelOverlay(int index) { return _levelOverlays[index]; }
 
-	void createTransparencyTablesIntern(const uint8 *ovl, int a, const Palette &fxPal, const Palette &screenPal, uint8 *outTable1, uint8 *outTable2, int b);
+	void createTransparencyTablesIntern(const uint8 *ovl, int a, const uint8 *fxPal1, const uint8 *fxPal2, uint8 *outTable1, uint8 *outTable2, int b);
 
 	void copyBlockAndApplyOverlay(int page1, int x1, int y1, int page2, int x2, int y2, int w, int h, int dim, uint8 *ovl);
 	void applyOverlaySpecial(int page1, int x1, int y1, int page2, int x2, int y2, int w, int h, int dim, int flag, uint8 *ovl);


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