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

athrxx at users.sourceforge.net athrxx at users.sourceforge.net
Mon Oct 19 23:27:39 CEST 2009


Revision: 45252
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45252&view=rev
Author:   athrxx
Date:     2009-10-19 21:27:39 +0000 (Mon, 19 Oct 2009)

Log Message:
-----------
LOL/PC-98: match vaelan's cube behaviour with original code

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

Modified: scummvm/trunk/engines/kyra/lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/lol.cpp	2009-10-19 19:58:10 UTC (rev 45251)
+++ scummvm/trunk/engines/kyra/lol.cpp	2009-10-19 21:27:39 UTC (rev 45252)
@@ -2842,21 +2842,33 @@
 }
 
 int LoLEngine::processMagicVaelansCube() {
-	uint8 *tmpPal1 = new uint8[768];
-	uint8 *tmpPal2 = new uint8[768];
 	uint8 *sp1 = _screen->getPalette(1).getData();
+	int len = _screen->getPalette(1).getNumColors() * 3;
 
-	memcpy(tmpPal1, sp1, 768);
-	memcpy(tmpPal2, sp1, 768);
+	uint8 *tmpPal1 = new uint8[len];
+	uint8 *tmpPal2 = new uint8[len];
 
-	for (int i = 0; i < 128; i++) {
-		uint16 a = sp1[i * 3] + 16;
-		tmpPal2[i * 3] = (a > 60) ? 60 : a;
-		tmpPal2[i * 3 + 1] = sp1[i * 3 + 1];
-		a = sp1[i * 3 + 2] + 19;
-		tmpPal2[i * 3 + 2] = (a > 60) ? 60 : a;
+	memcpy(tmpPal1, sp1, len);
+	memcpy(tmpPal2, sp1, len);
+
+	if (_flags.use16ColorMode) {
+		for (int i = 0; i < 16; i++) {
+			uint16 a = sp1[i * 3 + 1] + 16;
+			tmpPal2[i * 3 + 1] = (a > 58) ? 58 : a;
+			tmpPal2[i * 3] = sp1[i * 3];
+			a =	sp1[i * 3 + 2] + 16;
+			tmpPal2[i * 3 + 2] = (a > 63) ? 63 : a;
+		}
+	} else {
+		for (int i = 0; i < 128; i++) {
+			uint16 a = sp1[i * 3] + 16;
+			tmpPal2[i * 3] = (a > 60) ? 60 : a;
+			tmpPal2[i * 3 + 1] = sp1[i * 3 + 1];
+			a =	sp1[i * 3 + 2] + 19;
+			tmpPal2[i * 3 + 2] = (a > 60) ? 60 : a;
+		}
 	}
-
+	
 	snd_playSoundEffect(146, -1);
 
 	uint32 ctime = _system->getMillis();


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