From 4717d11862a45991b56f367cc6616ffb1379e8c6 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 27 Sep 2011 16:45:17 +0300 Subject: SCI: Added support for the halfbrite palette used in Longbow Amiga This fixes the remaining palette problems in the game (bug #3309036) --- engines/sci/graphics/palette.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'engines/sci') diff --git a/engines/sci/graphics/palette.cpp b/engines/sci/graphics/palette.cpp index c667e3313f..5f703b90e3 100644 --- a/engines/sci/graphics/palette.cpp +++ b/engines/sci/graphics/palette.cpp @@ -206,6 +206,14 @@ bool GfxPalette::setAmiga() { _sysPalette.colors[curColor].r = (byte1 & 0x0F) * 0x11; _sysPalette.colors[curColor].g = ((byte2 & 0xF0) >> 4) * 0x11; _sysPalette.colors[curColor].b = (byte2 & 0x0F) * 0x11; + + if (_totalScreenColors == 64) { + // Set the associated color from the Amiga halfbrite colors + _sysPalette.colors[curColor + 32].used = 1; + _sysPalette.colors[curColor + 32].r = _sysPalette.colors[curColor].r >> 1; + _sysPalette.colors[curColor + 32].g = _sysPalette.colors[curColor].g >> 1; + _sysPalette.colors[curColor + 32].b = _sysPalette.colors[curColor].b >> 1; + } } // Directly set the palette, because setOnScreen() wont do a thing for amiga @@ -226,6 +234,13 @@ void GfxPalette::modifyAmigaPalette(byte *data) { _sysPalette.colors[curColor].r = (byte1 & 0x0F) * 0x11; _sysPalette.colors[curColor].g = ((byte2 & 0xF0) >> 4) * 0x11; _sysPalette.colors[curColor].b = (byte2 & 0x0F) * 0x11; + + if (_totalScreenColors == 64) { + // Set the associated color from the Amiga halfbrite colors + _sysPalette.colors[curColor + 32].r = _sysPalette.colors[curColor].r >> 1; + _sysPalette.colors[curColor + 32].g = _sysPalette.colors[curColor].g >> 1; + _sysPalette.colors[curColor + 32].b = _sysPalette.colors[curColor].b >> 1; + } } copySysPaletteToScreen(); -- cgit v1.2.3