[Scummvm-cvs-logs] SF.net SVN: scummvm:[44845] scummvm/trunk/engines/sci/gui

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Fri Oct 9 22:21:21 CEST 2009


Revision: 44845
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44845&view=rev
Author:   m_kiewitz
Date:     2009-10-09 20:21:21 +0000 (Fri, 09 Oct 2009)

Log Message:
-----------
SCI/newgui: changing undithering logic again, palette now uses decoded color-combinations, fixup happens during dithering run on undithered mode

Modified Paths:
--------------
    scummvm/trunk/engines/sci/gui/gui_palette.cpp
    scummvm/trunk/engines/sci/gui/gui_screen.cpp

Modified: scummvm/trunk/engines/sci/gui/gui_palette.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_palette.cpp	2009-10-09 19:50:20 UTC (rev 44844)
+++ scummvm/trunk/engines/sci/gui/gui_palette.cpp	2009-10-09 20:21:21 UTC (rev 44845)
@@ -143,7 +143,7 @@
 
 void SciGuiPalette::setEGA() {
 	int i;
-	byte color, color1, color2;
+	byte color1, color2;
 	_sysPalette.colors[1].r  = 0x000; _sysPalette.colors[1].g  = 0x000; _sysPalette.colors[1].b  = 0x0AA;
 	_sysPalette.colors[2].r  = 0x000; _sysPalette.colors[2].g  = 0x0AA; _sysPalette.colors[2].b  = 0x000;
 	_sysPalette.colors[3].r  = 0x000; _sysPalette.colors[3].g  = 0x0AA; _sysPalette.colors[3].b  = 0x0AA;
@@ -165,13 +165,11 @@
 	// Now setting colors 16-254 to the correct mix colors that occur when not doing a dithering run on
 	//  finished pictures
 	for (i = 0x10; i <= 0xFE; i++) {
-		color = i;
-		_sysPalette.colors[color].used = 1;
-		color ^= color << 4;
+		_sysPalette.colors[i].used = 1;
 		color1 = i & 0x0F; color2 = i >> 4;
-		_sysPalette.colors[color].r = (_sysPalette.colors[color1].r >> 1) + (_sysPalette.colors[color2].r >> 1);
-		_sysPalette.colors[color].g = (_sysPalette.colors[color1].g >> 1) + (_sysPalette.colors[color2].g >> 1);
-		_sysPalette.colors[color].b = (_sysPalette.colors[color1].b >> 1) + (_sysPalette.colors[color2].b >> 1);
+		_sysPalette.colors[i].r = (_sysPalette.colors[color1].r >> 1) + (_sysPalette.colors[color2].r >> 1);
+		_sysPalette.colors[i].g = (_sysPalette.colors[color1].g >> 1) + (_sysPalette.colors[color2].g >> 1);
+		_sysPalette.colors[i].b = (_sysPalette.colors[color1].b >> 1) + (_sysPalette.colors[color2].b >> 1);
 	}
 	setOnScreen();
 }

Modified: scummvm/trunk/engines/sci/gui/gui_screen.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_screen.cpp	2009-10-09 19:50:20 UTC (rev 44844)
+++ scummvm/trunk/engines/sci/gui/gui_screen.cpp	2009-10-09 20:21:21 UTC (rev 44845)
@@ -222,18 +222,39 @@
 	byte *screenPtr = _visualScreen;
 	byte *displayPtr = _displayScreen;
 
-	for (y = 0; y < _height; y++) {
-		for (x = 0; x < _width; x++) {
-			color = *screenPtr;
-			if (color & 0xF0) {
-				color ^= color << 4;
-				color = ((x^y) & 1) ? color >> 4 : color & 0x0F;
-				*screenPtr = color;
-				if (!_unditherState)
-					*displayPtr = color;
+	if (!_unditherState) {
+		// Do dithering on visual and display-screen
+		for (y = 0; y < _height; y++) {
+			for (x = 0; x < _width; x++) {
+				color = *screenPtr;
+				if (color & 0xF0) {
+					color ^= color << 4;
+					color = ((x^y) & 1) ? color >> 4 : color & 0x0F;
+					*screenPtr = color; *displayPtr = color;
+				}
+				screenPtr++; displayPtr++;
 			}
-			screenPtr++; displayPtr++;
 		}
+	} else {
+		// Do dithering on visual screen and put decoded but undithered byte onto display-screen
+		for (y = 0; y < _height; y++) {
+			for (x = 0; x < _width; x++) {
+				color = *screenPtr;
+				if (color & 0xF0) {
+					color ^= color << 4;
+					// if decoded color wants do dither with black on left side, we turn it around
+					//  otherwise the normal ega color would get used for display
+					if (color & 0xF0) {
+						*displayPtr = color;
+					}	else {
+						*displayPtr = color << 4;
+					}
+					color = ((x^y) & 1) ? color >> 4 : color & 0x0F;
+					*screenPtr = color;
+				}
+				screenPtr++; displayPtr++;
+			}
+		}
 	}
 }
 


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