Skip to content

Commit

Permalink
do not draw fuzz columns beyond screen boundaries (#2108)
Browse files Browse the repository at this point in the history
Fixes #2099
  • Loading branch information
fabiangreffrath authored Dec 30, 2024
1 parent 79c801c commit fe20c49
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/r_draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,8 @@ static void DrawFuzzColumnBlocky(void)

int lines = fuzzblocksize - (dc_yl % fuzzblocksize);

const int fuzzblockwidth = MIN(fuzzblocksize, linesize - dc_x);

do
{
count -= lines;
Expand All @@ -506,7 +508,7 @@ static void DrawFuzzColumnBlocky(void)

do
{
memset(dest, fuzz, fuzzblocksize);
memset(dest, fuzz, fuzzblockwidth);
dest += linesize;
} while (--lines);

Expand Down Expand Up @@ -580,6 +582,8 @@ static void DrawFuzzColumnRefraction(void)

int lines = fuzzblocksize - (dc_yl % fuzzblocksize);

const int fuzzblockwidth = MIN(fuzzblocksize, linesize - dc_x);

int dark = FUZZDARK;
int offset = 0;

Expand All @@ -600,7 +604,7 @@ static void DrawFuzzColumnRefraction(void)

do
{
memset(dest, fuzz, fuzzblocksize);
memset(dest, fuzz, fuzzblockwidth);
dest += linesize;
} while (--lines);

Expand Down

0 comments on commit fe20c49

Please sign in to comment.