diff options
| -rw-r--r-- | engines/cine/gfx.cpp | 33 | ||||
| -rw-r--r-- | engines/cine/pal.cpp | 15 | 
2 files changed, 41 insertions, 7 deletions
| diff --git a/engines/cine/gfx.cpp b/engines/cine/gfx.cpp index f17c8dd6e1..d6aa32cc3b 100644 --- a/engines/cine/gfx.cpp +++ b/engines/cine/gfx.cpp @@ -286,7 +286,7 @@ void FWRenderer::drawMessage(const char *str, int x, int y, int width, int color  	ty += 9;  	if (color >= 0) {  		drawPlainBox(x, ty, width, 4, color); -		drawDoubleBorder(x, y, width, ty - y + 4, 2); +		drawDoubleBorder(x, y, width, ty - y + 4, g_cine->getPlatform() == Common::kPlatformAmiga ? 1 : 2);  	}  } @@ -331,9 +331,30 @@ void FWRenderer::drawPlainBox(int x, int y, int width, int height, byte color) {  	boxRect.clip(screenRect);  	// Draw the filled rectangle -	byte *dest = _backBuffer + boxRect.top * 320 + boxRect.left; -	for (int i = 0; i < boxRect.height(); i++) { -		memset(dest + i * 320, color, boxRect.width()); +	// +	// Since the Amiga version uses a transparent boxes we need to decide whether: +	//  - we draw a box, that should be the case then both width and height is greater than 1 +	//  - we draw a line, that should be the case then either width or height is 1 +	// When we draw a box and we're running an Amiga version we do use the special code to make +	// the boxes transparent. +	// When on the other hand we are drawing a line or are not running an Amiga version, we will +	// always use the code, which simply fills the rect. +	// +	// TODO: Think over whether this is the nicest / best solution we can find for handling +	// the transparency for Amiga boxes. +	if (g_cine->getPlatform() == Common::kPlatformAmiga && width > 1 && height > 1) { +		byte *dest = _backBuffer + boxRect.top * 320 + boxRect.left; +		const int lineAdd = 320 - boxRect.width(); +		for (int i = 0; i < boxRect.height(); ++i) { +			for (int j = 0; j < boxRect.width(); ++j) +				*dest++ += 16; +			dest += lineAdd; +		} +	} else { +		byte *dest = _backBuffer + boxRect.top * 320 + boxRect.left; +		for (int i = 0; i < boxRect.height(); i++) { +			memset(dest + i * 320, color, boxRect.width()); +		}  	}  } @@ -783,7 +804,7 @@ void FWRenderer::drawMenu(const CommandeType *items, unsigned int height, int x,  	}  	drawPlainBox(x, ty, width, 4, _messageBg); -	drawDoubleBorder(x, y, width, ty - y + 4, 2); +	drawDoubleBorder(x, y, width, ty - y + 4, g_cine->getPlatform() == Common::kPlatformAmiga ? 1 : 2);  }  /*! \brief Draw text input box @@ -856,7 +877,7 @@ void FWRenderer::drawInputBox(const char *info, const char *input, int cursor, i  	ty += 9;  	drawPlainBox(x, ty, width, 4, _messageBg); -	drawDoubleBorder(x, y, width, ty - y + 4, 2); +	drawDoubleBorder(x, y, width, ty - y + 4, g_cine->getPlatform() == Common::kPlatformAmiga ? 1 : 2);  }  /*! \brief Fade to black diff --git a/engines/cine/pal.cpp b/engines/cine/pal.cpp index 582a707be7..d793f06602 100644 --- a/engines/cine/pal.cpp +++ b/engines/cine/pal.cpp @@ -187,7 +187,20 @@ const Graphics::PixelFormat &Palette::colorFormat() const {  void Palette::setGlobalOSystemPalette() const {  	byte buf[256 * 4]; // Allocate space for the largest possible palette  	save(buf, sizeof(buf), Cine::kSystemPalFormat, CINE_LITTLE_ENDIAN); -	g_system->setPalette(buf, 0, colorCount()); + +	// TODO: Think over whether this is really the correct place to calculate the Amiga +	// specific transparency palette. +	if (g_cine->getPlatform() == Common::kPlatformAmiga && colorCount() == 16) { +		// The Amiga version of Future Wars does use the upper 16 colors for a darkened +		// game palette to allow transparent dialog boxes. To support that in our code +		// we do calculate that palette over here and append it to the screen palette. +		for (uint i = 0; i < 16 * 4; ++i) +			buf[16 * 4 + i] = buf[i] >> 1; + +		g_system->setPalette(buf, 0, colorCount() * 2); +	} else { +		g_system->setPalette(buf, 0, colorCount()); +	}  }  Cine::Palette::Color Palette::getColor(byte index) const { | 
