diff options
| author | Filippos Karapetis | 2013-04-12 06:46:34 +0300 | 
|---|---|---|
| committer | Filippos Karapetis | 2013-04-12 07:19:53 +0300 | 
| commit | 94b328fa7fc0b4f2cc5bb9e8b20ca8a771b3f7f4 (patch) | |
| tree | 9c430c6b91079f92bf3041ff85a85bc13209dcfc | |
| parent | 53e82436e6d77968e1c5e1a9c5797cae16cb76a0 (diff) | |
| download | scummvm-rg350-94b328fa7fc0b4f2cc5bb9e8b20ca8a771b3f7f4.tar.gz scummvm-rg350-94b328fa7fc0b4f2cc5bb9e8b20ca8a771b3f7f4.tar.bz2 scummvm-rg350-94b328fa7fc0b4f2cc5bb9e8b20ca8a771b3f7f4.zip  | |
TINSEL: Fix black/white colors in the Mac version of DW1
| -rw-r--r-- | engines/tinsel/palette.cpp | 20 | 
1 files changed, 13 insertions, 7 deletions
diff --git a/engines/tinsel/palette.cpp b/engines/tinsel/palette.cpp index 04018172c0..c2ba40b26d 100644 --- a/engines/tinsel/palette.cpp +++ b/engines/tinsel/palette.cpp @@ -170,10 +170,14 @@ void PalettesToVideoDAC() {  			pal[i * 3 + 2] = TINSEL_GetBValue(pColors[i]);  		} -		// In DW1 Mac, color 254 should be black, like in the PC version. -		// We fix it here. +		// Swap black/white colors in the Mac version. +		// We need to swap the current black/white values so that screen fade +		// in/out is done correctly.  		if (TinselV1Mac) { -			pal[254 * 3 + 0] = pal[254 * 3 + 1] = pal[254 * 3 + 2] = 0; +			byte macWhite = pal[  0 * 3 + 0]; +			byte macBlack = pal[254 * 3 + 0]; +			pal[254 * 3 + 0] = pal[254 * 3 + 1] = pal[254 * 3 + 2] = macWhite; +			pal[  0 * 3 + 0] = pal[  0 * 3 + 1] = pal[  0 * 3 + 2] = macBlack;  		}  		// update the system palette @@ -552,7 +556,8 @@ void CreateTranslucentPalette(SCNHANDLE hPalette) {  	// leave background color alone  	g_transPalette[0] = 0; -	for (uint i = 0; i < FROM_32(pPal->numColors); i++) { +	int32 numColors = FROM_32(pPal->numColors); +	for (int32 i = 0; i < numColors; i++) {  		// get the RGB color model values  		uint8 red   = TINSEL_GetRValue(pPal->palRGB[i]);  		uint8 green = TINSEL_GetGValue(pPal->palRGB[i]); @@ -564,7 +569,8 @@ void CreateTranslucentPalette(SCNHANDLE hPalette) {  		// map the Value field to one of the 4 colors reserved for the translucent palette  		val /= 63; -		g_transPalette[i + 1] = (uint8)((val == 0) ? 0 : val + +		byte blackColorIndex = (!TinselV1Mac) ? 0 : 255; +		g_transPalette[i + 1] = (uint8)((val == 0) ? blackColorIndex : val +  			(TinselV2 ? TranslucentColor() : COL_HILIGHT) - 1);  	}  } @@ -575,12 +581,12 @@ void CreateTranslucentPalette(SCNHANDLE hPalette) {  void CreateGhostPalette(SCNHANDLE hPalette) {  	// get a pointer to the palette  	PALETTE *pPal = (PALETTE *)LockMem(hPalette); -	int i;  	// leave background color alone  	g_ghostPalette[0] = 0; -	for (i = 0; i < (int)FROM_32(pPal->numColors); i++) { +	int32 numColors = FROM_32(pPal->numColors); +	for (int32 i = 0; i < numColors; i++) {  		// get the RGB color model values  		uint8 red   = TINSEL_GetRValue(pPal->palRGB[i]);  		uint8 green = TINSEL_GetGValue(pPal->palRGB[i]);  | 
