foxygit / doom Log in
commit b73194ec7b1b0ec30e9658df818d183f4081cce7
Author:     Jonathan Dowland <jon+github@alcopop.org>
AuthorDate: Fri Feb 17 07:13:47 2017 +0000
Commit:     Jonathan Dowland <jon+github@alcopop.org>
CommitDate: Fri Feb 17 09:15:17 2017 +0000

    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.
---
 src/i_video.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/i_video.c b/src/i_video.c
index c50f8ea9..759d9776 100644
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -740,6 +740,10 @@ void I_FinishUpdate (void)
     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;
     }