From db635e5c5b5ab9c4e761078273723695ff17abd4 Mon Sep 17 00:00:00 2001 From: Alug Date: Fri, 21 Nov 2025 18:54:42 +0100 Subject: [PATCH 1/2] K_GetScreenCoords: fix signed overflow why even cast that to signed...... --- src/k_hud.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_hud.c b/src/k_hud.c index 54b81a0f4..7a58a5390 100644 --- a/src/k_hud.c +++ b/src/k_hud.c @@ -2860,7 +2860,7 @@ static boolean K_GetScreenCoords(vector2_t *vec, player_t *player, mobj_t *targe // X coordinate // get difference between camangle and angle towards target - x = (INT32)viewangle - (INT32)R_PointToAngle(targx, targy); + x = (fixed_t)(viewangle - R_PointToAngle(targx, targy)); distfact = FINECOSINE((x>>ANGLETOFINESHIFT) & FINEMASK); if (!distfact) distfact = 1; From 9a794232d7e542110a0dc0a16c7c4c9f2bdf693f Mon Sep 17 00:00:00 2001 From: Alug Date: Fri, 21 Nov 2025 19:50:44 +0100 Subject: [PATCH 2/2] HWR_ProcessSeg: fix cliphigh overflow --- src/hardware/hw_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hardware/hw_main.cpp b/src/hardware/hw_main.cpp index 769fab71c..d28592ad1 100644 --- a/src/hardware/hw_main.cpp +++ b/src/hardware/hw_main.cpp @@ -1352,7 +1352,7 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom // x offset the texture const fixed_t texturehpeg = gl_sidedef->textureoffset + gl_curline->offset; const float cliplow = (float)texturehpeg; - const float cliphigh = (float)(texturehpeg + gl_curline->length); + const float cliphigh = ((float)texturehpeg + (float)gl_curline->length); FUINT lightnum = gl_frontsector->lightlevel; extracolormap_t *colormap = gl_frontsector->extra_colormap;