shithub: choc

Download patch

ref: b73194ec7b1b0ec30e9658df818d183f4081cce7
parent: 75005106f1582a284628aeb7148a231640a5bd14
author: Jonathan Dowland <jon+github@alcopop.org>
date: Fri Feb 17 02:13:47 EST 2017

VGA Porch border emulation

Set the renderer draw colour to the current palette's 0-index,
rather than just black. This means the pillars/letterboxes "flash"
when the palette changes (such as item pick up, being hurt, etc.)

This emulates the behaviour of the VGA "porch" region with Vanilla.

Fixes #832.

--- a/src/i_video.c
+++ b/src/i_video.c
@@ -740,6 +740,10 @@
     if (palette_to_set)
     {
         SDL_SetPaletteColors(screenbuffer->format->palette, palette, 0, 256);
+        // "flash" the pillars/letterboxes with palette changes, emulating
+        // VGA "porch" behaviour (GitHub issue #832)
+        SDL_SetRenderDrawColor(renderer, palette[0].r, palette[0].g,
+            palette[0].b, SDL_ALPHA_OPAQUE);
         palette_to_set = false;
     }