diff options
author | Walter van Niftrik | 2016-08-24 01:02:22 +0200 |
---|---|---|
committer | Walter van Niftrik | 2016-08-24 01:04:37 +0200 |
commit | 3d558fe6ca0ad61558f5283f2ff4751b034fed5f (patch) | |
tree | 2d6f43c61551eb43642201143db22a7b800a57cd /engines | |
parent | 754907f40888c0cc0a2150550182b31804c4e891 (diff) | |
download | scummvm-rg350-3d558fe6ca0ad61558f5283f2ff4751b034fed5f.tar.gz scummvm-rg350-3d558fe6ca0ad61558f5283f2ff4751b034fed5f.tar.bz2 scummvm-rg350-3d558fe6ca0ad61558f5283f2ff4751b034fed5f.zip |
ADL: Make the optional scanlines less harsh
Diffstat (limited to 'engines')
-rw-r--r-- | engines/adl/display.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
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) { |