From 48fac2f9dc4bf608d9568c4c626f4fabc98160c8 Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Tue, 25 Mar 2008 08:03:32 +0000 Subject: Fix palette glitches in Amiga OCS version of Simon the Sorcerer 1. svn-id: r31233 --- engines/agos/vga_s1.cpp | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'engines/agos/vga_s1.cpp') diff --git a/engines/agos/vga_s1.cpp b/engines/agos/vga_s1.cpp index f99c8afb83..b3ee374595 100644 --- a/engines/agos/vga_s1.cpp +++ b/engines/agos/vga_s1.cpp @@ -61,6 +61,41 @@ void AGOSEngine::vc17_setPathfinderItem() { _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 @@ void AGOSEngine::vc22_setPaletteNew() { 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++; } -- cgit v1.2.3