[Scummvm-cvs-logs] scummvm master -> 3d558fe6ca0ad61558f5283f2ff4751b034fed5f
waltervn
walter at vanniftrik-it.nl
Wed Aug 24 01:08:11 CEST 2016
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
3d558fe6ca ADL: Make the optional scanlines less harsh
Commit: 3d558fe6ca0ad61558f5283f2ff4751b034fed5f
https://github.com/scummvm/scummvm/commit/3d558fe6ca0ad61558f5283f2ff4751b034fed5f
Author: Walter van Niftrik (walter at scummvm.org)
Date: 2016-08-24T01:04:37+02:00
Commit Message:
ADL: Make the optional scanlines less harsh
Changed paths:
engines/adl/display.cpp
diff --git a/engines/adl/display.cpp b/engines/adl/display.cpp
index d052577..2cf50f7 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) {
More information about the Scummvm-git-logs
mailing list