From 3d558fe6ca0ad61558f5283f2ff4751b034fed5f Mon Sep 17 00:00:00 2001 From: Walter van Niftrik Date: Wed, 24 Aug 2016 01:02:22 +0200 Subject: ADL: Make the optional scanlines less harsh --- engines/adl/display.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'engines/adl') diff --git a/engines/adl/display.cpp b/engines/adl/display.cpp index d05257792c..2cf50f72fc 100644 --- a/engines/adl/display.cpp +++ b/engines/adl/display.cpp @@ -55,6 +55,9 @@ static const byte colorPalette[COLOR_PALETTE_ENTRIES * 3] = { 0xf2, 0x5e, 0x00 }; +// Opacity of the optional scanlines (percentage) +#define SCANLINE_OPACITY 75 + // Corresponding color in second palette #define PAL2(X) ((X) | 0x04) @@ -334,14 +337,16 @@ void Display::writeFrameBuffer(const Common::Point &p, byte color, byte mask) { } void Display::showScanlines(bool enable) { - byte pal[COLOR_PALETTE_ENTRIES * 3] = { }; + byte pal[COLOR_PALETTE_ENTRIES * 3]; + + g_system->getPaletteManager()->grabPalette(pal, 0, COLOR_PALETTE_ENTRIES); - if (enable) - g_system->getPaletteManager()->setPalette(pal, COLOR_PALETTE_ENTRIES, COLOR_PALETTE_ENTRIES); - else { - g_system->getPaletteManager()->grabPalette(pal, 0, COLOR_PALETTE_ENTRIES); - g_system->getPaletteManager()->setPalette(pal, COLOR_PALETTE_ENTRIES, COLOR_PALETTE_ENTRIES); + if (enable) { + for (uint i = 0; i < ARRAYSIZE(pal); ++i) + pal[i] = pal[i] * (100 - SCANLINE_OPACITY) / 100; } + + g_system->getPaletteManager()->setPalette(pal, COLOR_PALETTE_ENTRIES, COLOR_PALETTE_ENTRIES); } static byte processColorBits(uint16 &bits, bool &odd, bool secondPal) { -- cgit v1.2.3