foxygit / doom Log in
commit 41bbb2c4ccc6dd49a04ea07dbfd23a19af78e29b
Author:     jens <jens.se@icloud.com>
AuthorDate: Fri Aug 21 23:36:35 2026 +0200
Commit:     jens <jens.se@icloud.com>
CommitDate: Fri Aug 21 23:36:35 2026 +0200

    Fix status bar corruption from unscaled SBARHEIGHT

    R_FillBackScreen/R_InitBuffer reserve SBARHEIGHT real screen rows for
    the status bar when centering the shrunk view and tiling the border
    pattern, but SBARHEIGHT was still the native 32 even after the status
    bar itself became 64 rows tall (see the previous commit). The border
    fill's bottom edge landed 32 rows short of the bar's actual top, so it
    painted border pattern over the bar's own top rows - most visibly
    clipping the ammo-type labels and the health/armor '%' signs, worse at
    smaller screen sizes where more of the screen is border. Scale
    SBARHEIGHT the same way.

    Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
---
 src/doom/r_draw.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/doom/r_draw.c b/src/doom/r_draw.c
index 193ec2a8..a382fa3c 100644
--- a/src/doom/r_draw.c
+++ b/src/doom/r_draw.c
@@ -41,8 +41,12 @@
 #define MAXWIDTH			1120
 #define MAXHEIGHT			832

-// status bar height at bottom of screen
-#define SBARHEIGHT		32
+// status bar height at bottom of screen - native ORIGHEIGHT-space 32,
+// scaled to real screen terms to match the real space the status bar
+// actually occupies now (see ST_HEIGHT/ST_SCALE in st_stuff.h) - used
+// here purely as a real-space reservation so the border-fill/view-
+// centering math below doesn't encroach on the status bar's real area.
+#define SBARHEIGHT		(32 * (SCREENWIDTH / ORIGWIDTH))

 //
 // All drawing to the view buffer is accomplished in this file.