[Scummvm-cvs-logs] SF.net SVN: scummvm: [31233] scummvm/trunk/engines/agos

Kirben at users.sourceforge.net Kirben at users.sourceforge.net
Tue Mar 25 09:03:37 CET 2008


Revision: 31233
          http://scummvm.svn.sourceforge.net/scummvm/?rev=31233&view=rev
Author:   Kirben
Date:     2008-03-25 01:03:32 -0700 (Tue, 25 Mar 2008)

Log Message:
-----------
Fix palette glitches in Amiga OCS version of Simon the Sorcerer 1.

Modified Paths:
--------------
    scummvm/trunk/engines/agos/gfx.cpp
    scummvm/trunk/engines/agos/icons.cpp
    scummvm/trunk/engines/agos/verb.cpp
    scummvm/trunk/engines/agos/vga_s1.cpp
    scummvm/trunk/engines/agos/window.cpp

Modified: scummvm/trunk/engines/agos/gfx.cpp
===================================================================
--- scummvm/trunk/engines/agos/gfx.cpp	2008-03-24 23:01:51 UTC (rev 31232)
+++ scummvm/trunk/engines/agos/gfx.cpp	2008-03-25 08:03:32 UTC (rev 31233)
@@ -629,7 +629,7 @@
 		do {
 			for (i = 0; i != state->draw_width; i++)
 				if ((state->flags & kDFNonTrans) || src[i])
-					dst[i] = src[i];
+					dst[i] = src[i] + state->paletteMod;
 			dst += _screenWidth;
 			src += state->width * 16;
 		} while (--h);
@@ -726,6 +726,10 @@
 	state->surf_addr += xoffs + yoffs * state->surf_pitch;
 	state->surf2_addr += xoffs + yoffs * state->surf2_pitch;
 
+	if ((getFeatures() & GF_32COLOR) && !_window3Flag && yoffs > 133) {
+		state->paletteMod = 208;
+	}
+
 	if (_backFlag == 1) {
 		drawBackGroundImage(state);
 	} else if (state->flags & kDFMasked) {

Modified: scummvm/trunk/engines/agos/icons.cpp
===================================================================
--- scummvm/trunk/engines/agos/icons.cpp	2008-03-24 23:01:51 UTC (rev 31232)
+++ scummvm/trunk/engines/agos/icons.cpp	2008-03-25 08:03:32 UTC (rev 31233)
@@ -233,7 +233,7 @@
 	if (getPlatform() == Common::kPlatformAmiga) {
 		src = _iconFilePtr;
 		src += READ_BE_UINT32(src + icon * 4);
-		uint8 color = (getFeatures() & GF_32COLOR) ? 16 : 240;
+		uint8 color = (getFeatures() & GF_32COLOR) ? 224 : 240;
 		decompressIconPlanar(dst, src, 24, 12, color, _dxSurfacePitch);
 	} else {
 		src = _iconFilePtr;

Modified: scummvm/trunk/engines/agos/verb.cpp
===================================================================
--- scummvm/trunk/engines/agos/verb.cpp	2008-03-24 23:01:51 UTC (rev 31232)
+++ scummvm/trunk/engines/agos/verb.cpp	2008-03-25 08:03:32 UTC (rev 31233)
@@ -584,13 +584,23 @@
 	if (getGameType() == GType_SIMON1) {
 		if (tmp != NULL) {
 			tmp->flags |= kBFInvertTouch;
-			invertBox(tmp, 213, 208, 213, 10);
+			if (getFeatures() & GF_32COLOR)
+				invertBox(tmp, 212, 208, 212, 8);
+			else
+				invertBox(tmp, 213, 208, 213, 10);
 		}
 
-		if (ha->flags & kBFBoxSelected)
-			invertBox(ha, 218, 213, 213, 5);
-		else
-			invertBox(ha, 223, 218, 218, 10);
+		if (ha->flags & kBFBoxSelected) {
+			if (getFeatures() & GF_32COLOR)
+				invertBox(ha, 216, 212, 212, 4);
+			else
+				invertBox(ha, 218, 213, 213, 5);
+		} else {
+			if (getFeatures() & GF_32COLOR)
+				invertBox(ha, 220, 216, 216, 8);
+			else
+				invertBox(ha, 223, 218, 218, 10);
+		}
 
 		ha->flags &= ~(kBFBoxSelected + kBFInvertTouch);
 	} else {
@@ -610,7 +620,10 @@
 	if (getGameType() == GType_SIMON2) {
 		invertBox(ha, 231, 229, 230, 1);
 	} else {
-		invertBox(ha, 223, 213, 218, 5);
+		if (getFeatures() & GF_32COLOR)
+			invertBox(ha, 220, 212, 216, 4);
+		else
+			invertBox(ha, 223, 213, 218, 5);
 	}
 }
 

Modified: scummvm/trunk/engines/agos/vga_s1.cpp
===================================================================
--- scummvm/trunk/engines/agos/vga_s1.cpp	2008-03-24 23:01:51 UTC (rev 31232)
+++ scummvm/trunk/engines/agos/vga_s1.cpp	2008-03-25 08:03:32 UTC (rev 31233)
@@ -61,6 +61,41 @@
 	_vcPtr += 2;
 }
 
+static const uint8 customPalette[96] = {
+	0x00, 0x00, 0x00,
+	0x99, 0x22, 0xFF,
+	0x66, 0xCC, 0xFF,
+	0xFF, 0x99, 0xFF,
+	0xFF, 0xFF, 0xFF,
+	0x66, 0x44, 0xBB,
+	0x77, 0x55, 0xCC,
+	0x88, 0x77, 0xCC,
+	0xCC, 0xAA, 0xDD,
+	0x33, 0x00, 0x09,
+	0x66, 0x44, 0xCC,
+	0x88, 0x55, 0xCC,
+	0xAA, 0x77, 0xEE,
+	0x00, 0x00, 0x00,
+	0x00, 0x00, 0x00,
+	0x00, 0x00, 0x00,
+	0x00, 0x00, 0x00,
+	0xFF, 0xFF, 0xFF,
+	0x33, 0x00, 0x00,
+	0xCC, 0xCC, 0xDD,
+	0x88, 0x99, 0xBB,
+	0x44, 0x77, 0xAA,
+	0x44, 0x44, 0x66,
+	0x44, 0x44, 0x00,
+	0x44, 0x66, 0x00,
+	0x88, 0x99, 0x00,
+	0x99, 0x44, 0x00,
+	0xBB, 0x44, 0x22,
+	0xFF, 0x55, 0x33,
+	0xFF, 0x88, 0x88,
+	0xFF, 0xBB, 0x33,
+	0xFF, 0xFF, 0x77,
+};
+
 void AGOSEngine::vc22_setPaletteNew() {
 	byte *offs, *palptr = 0, *src;
 	uint16 a = 0, b, num, palSize = 0;
@@ -93,6 +128,19 @@
 		src += 3;
 	} while (--num);
 
+	if (getFeatures() & GF_32COLOR) {
+		// Custom palette used for verb area
+		palptr = &_displayPalette[(13 * 64)];
+		for (uint8 c = 0; c < 32; c++) {
+			palptr[0] = customPalette[c * 3 + 0];
+			palptr[1] = customPalette[c * 3 + 1];
+			palptr[2] = customPalette[c * 3 + 2];
+			palptr[3] = 0;
+
+			palptr += 4;
+		}; 
+	}
+
 	_paletteFlag = 2;
 	_vgaSpriteChanged++;
 }

Modified: scummvm/trunk/engines/agos/window.cpp
===================================================================
--- scummvm/trunk/engines/agos/window.cpp	2008-03-24 23:01:51 UTC (rev 31232)
+++ scummvm/trunk/engines/agos/window.cpp	2008-03-25 08:03:32 UTC (rev 31233)
@@ -259,7 +259,7 @@
 		if (window->fill_color == 17)
 			color = 25;
 		else
-			color = 12;
+			color = 220;
 	}
 
 	window->text_color = color;


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