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

athrxx at users.sourceforge.net athrxx at users.sourceforge.net
Thu Oct 8 21:42:40 CEST 2009


Revision: 44794
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44794&view=rev
Author:   athrxx
Date:     2009-10-08 19:42:39 +0000 (Thu, 08 Oct 2009)

Log Message:
-----------
LOLLOL/PC-98: fixed ghorka swamp freeze mode

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

Modified: scummvm/trunk/engines/kyra/lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/lol.cpp	2009-10-08 19:41:38 UTC (rev 44793)
+++ scummvm/trunk/engines/kyra/lol.cpp	2009-10-08 19:42:39 UTC (rev 44794)
@@ -2280,7 +2280,7 @@
 	if (_currentLevel == 11 && !(_flagsTable[52] & 0x04)) {
 		uint8 *sc = _screen->getPalette(0).getData();
 		uint8 *dc = _screen->getPalette(2).getData();
-		for (int i = 1; i < 768; i++)
+		for (int i = 1; i < (_screen->getPalette(0).getNumColors() * 3); i++)
 			SWAP(sc[i], dc[i]);
 
 		_flagsTable[52] |= 0x04;
@@ -2292,25 +2292,14 @@
 	s.copy(_screen->getPalette(1));
 	if (_flags.use16ColorMode) {
 		_screen->loadPalette("LOLICE.NOL", swampCol);
-		uint8 *s1 = s.getData();
-		for (int i = 0; i < 16; i++) {
-			s1[((i << 4) | i) * 3] = s1[i * 3];
-			s1[((i << 4) | i) * 3 + 1] = s1[i * 3 + 1];
-			s1[((i << 4) | i) * 3 + 2] = s1[i * 3 + 2];
-		}		
-		uint8 *d1 = tpal.getData();
-		uint8 *d2 = swampCol.getData();
-		for (int i = 48; i < 256; i++)
-			d1[i] = d2[i] = s1[i] & 0x3f;
-
 		for (int i = 1; i < 16; i++) {
 			uint16 v = (s[i * 3] + s[i * 3 + 1] + s[i * 3 + 2]) / 3;
 			tpal[i * 3] = 0;			
 			tpal[i * 3 + 1] = v;
 			tpal[i * 3 + 2] = v << 1;
 
-			if (tpal[i * 3 + 2] > 0x3f)
-				tpal[i * 3 + 2] = 0x3f;
+			if (tpal[i * 3 + 2] > 29)
+				tpal[i * 3 + 2] = 29;
 		}
 
 	} else {	
@@ -3781,7 +3770,7 @@
 	uint8 *d = _screen->getPalette(0).getData();
 	uint8 *d2 = _screen->getPalette(1).getData();
 
-	for (int i = 1; i < 768; i++)
+	for (int i = 1; i < (_screen->getPalette(0).getNumColors() * 3); i++)
 		SWAP(s[i], d[i]);
 
 	generateBrightnessPalette(_screen->getPalette(0), _screen->getPalette(1), _brightness, _lampEffect);

Modified: scummvm/trunk/engines/kyra/scene_lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/scene_lol.cpp	2009-10-08 19:41:38 UTC (rev 44793)
+++ scummvm/trunk/engines/kyra/scene_lol.cpp	2009-10-08 19:42:39 UTC (rev 44794)
@@ -420,13 +420,18 @@
 	}	
 
 	if (_currentLevel == 11) {
-		_screen->loadPalette("SWAMPICE.COL", _screen->getPalette(2));
-		_screen->getPalette(2).copy(_screen->getPalette(0), 128);
+		if (_flags.use16ColorMode) {
+			_screen->loadPalette("LOLICE.NOL", _screen->getPalette(2));
 
+		} else {
+			_screen->loadPalette("SWAMPICE.COL", _screen->getPalette(2));
+			_screen->getPalette(2).copy(_screen->getPalette(0), 128);
+		}
+
 		if (_flagsTable[52] & 0x04) {
 			uint8 *pal0 = _screen->getPalette(0).getData();
 			uint8 *pal2 = _screen->getPalette(2).getData();
-			for (int i = 1; i < 768; i++)
+			for (int i = 1; i < _screen->getPalette(0).getNumColors() * 3; i++)
 				SWAP(pal0[i], pal2[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