From 158aaa68037941caaa178e978be4c502bc54e1bf Mon Sep 17 00:00:00 2001 From: Eidolon Date: Mon, 20 Feb 2023 17:48:55 -0600 Subject: [PATCH] hwr2: fix DrawFill full screen special case --- src/r_main.c | 12 +++++++++--- src/v_video.cpp | 22 ++++++++++++---------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/r_main.c b/src/r_main.c index 2c781509c..b00717810 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -1476,9 +1476,15 @@ void R_RenderPlayerView(void) if (cv_homremoval.value && player == &players[displayplayers[0]]) { if (cv_homremoval.value == 1) - V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); // No HOM effect! - else //'development' HOM removal -- makes it blindingly obvious if HOM is spotted. - V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 32+(timeinmap&15)); + { + // Clear the software screen buffer to remove HOM + memset(screens[0], 31, vid.width * vid.height * vid.bpp); + } + else + { + //'development' HOM removal -- makes it blindingly obvious if HOM is spotted. + memset(screens[0], 32+(timeinmap&15), vid.width * vid.height * vid.bpp); + } } else if (r_splitscreen == 2 && player == &players[displayplayers[2]]) { diff --git a/src/v_video.cpp b/src/v_video.cpp index 4e1f0d0f7..87a4ddfbe 100644 --- a/src/v_video.cpp +++ b/src/v_video.cpp @@ -1031,18 +1031,20 @@ void V_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c) INT32 dupx = vid.dupx, dupy = vid.dupy; if (x == 0 && y == 0 && w == BASEVIDWIDTH && h == BASEVIDHEIGHT) - { // Clear the entire screen, from dest to deststop. Yes, this really works. - memset(screens[0], (c&255), vid.width * vid.height * vid.bpp); - return; + { + w = vid.width; + h = vid.height; } + else + { + x *= dupx; + y *= dupy; + w *= dupx; + h *= dupy; - x *= dupx; - y *= dupy; - w *= dupx; - h *= dupy; - - // Center it if necessary - V_AdjustXYWithSnap(&x, &y, c, dupx, dupy); + // Center it if necessary + V_AdjustXYWithSnap(&x, &y, c, dupx, dupy); + } } if (x >= vid.width || y >= vid.height)