[Scummvm-cvs-logs] SF.net SVN: scummvm: [30708] scummvm/trunk/engines/agi/graphics.cpp

buddha_ at users.sourceforge.net buddha_ at users.sourceforge.net
Wed Jan 30 02:58:44 CET 2008


Revision: 30708
          http://scummvm.svn.sourceforge.net/scummvm/?rev=30708&view=rev
Author:   buddha_
Date:     2008-01-29 17:58:43 -0800 (Tue, 29 Jan 2008)

Log Message:
-----------
Fix for bug #1881170 (AGI: palette-related glitches reported). Made AGIPAL use only the lowest 6 bits of each color component (This should be the way the original AGIPAL-hack behaves too).

Modified Paths:
--------------
    scummvm/trunk/engines/agi/graphics.cpp

Modified: scummvm/trunk/engines/agi/graphics.cpp
===================================================================
--- scummvm/trunk/engines/agi/graphics.cpp	2008-01-29 22:39:42 UTC (rev 30707)
+++ scummvm/trunk/engines/agi/graphics.cpp	2008-01-30 01:58:43 UTC (rev 30708)
@@ -864,18 +864,20 @@
 		return;
 	}
 
-	// Check that all components are maximum 6 bits (VGA used 6 bits per color component).
-	// Makes at least Naturette 2's colors not be messed up anymore (Naturette 2 provides
-	// AGIPAL-files that use 8 bits per color component. Haven't seen any other game that
-	// provides such files and don't know of *any* AGI interpreter that supports such files.
-	// So I presume they have been left over to Naturette 2's release file by accident).
+	// Use only the lowest 6 bits of each color component (Red, Green and Blue)
+	// because VGA used only 6 bits per color component (i.e. VGA had 18-bit colors).
+	// This should now be identical to the original AGIPAL-hack's behaviour.
+	bool validVgaPalette = true;
 	for (int i = 0; i < 16 * 3; i++) {
 		if (_agipalPalette[i] >= (1 << 6)) {
-			warning("Invalid AGIPAL palette (Over 6 bits per color component) in '%s'. Not changing palette", filename);
-			return;
+			_agipalPalette[i] &= 0x3F; // Leave only the lowest 6 bits of each color component
+			validVgaPalette = false;
 		}
 	}
 
+	if (!validVgaPalette)
+		warning("Invalid AGIPAL palette (Over 6 bits per color component) in '%s'. Using only the lowest 6 bits per color component", filename);
+
 	_agipalFileNum = p0;
 
 	initPalette(_agipalPalette);


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