Skip to content

Commit

Permalink
make sure borders of fullscreen patches are drawn (close to) black
Browse files Browse the repository at this point in the history
Fixes #1110
  • Loading branch information
fabiangreffrath committed Nov 20, 2023
1 parent 743a24f commit 45647d0
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/v_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,14 +311,24 @@ void V_DrawPatch(int x, int y, patch_t *patch)
void V_DrawPatchFullScreen(patch_t *patch, boolean flipped)
{
int x = ((SCREENWIDTH >> crispy->hires) - SHORT(patch->width)) / 2 - WIDESCREENDELTA;
static int black = -1;

patch->leftoffset = 0;
patch->topoffset = 0;

if (black == -1)
{
#ifndef CRISPY_TRUECOLOR
black = I_GetPaletteIndex(0x00, 0x00, 0x00);
#else
black = I_MapRGB(0x00, 0x00, 0x00);
#endif
}

// [crispy] fill pillarboxes in widescreen mode
if (SCREENWIDTH != NONWIDEWIDTH)
{
V_DrawFilledBox(0, 0, SCREENWIDTH, SCREENHEIGHT, 0);
V_DrawFilledBox(0, 0, SCREENWIDTH, SCREENHEIGHT, black);
}

if (flipped)
Expand Down

0 comments on commit 45647d0

Please sign in to comment.