From 1f4643bfae5a3de9c68e51a52b211d81bf18383d Mon Sep 17 00:00:00 2001 From: Alaux <73968015+MrAlaux@users.noreply.github.com> Date: Thu, 9 Jan 2025 07:11:11 -0300 Subject: [PATCH] Potential fix for voxels on top/bottom of screen --- src/r_voxel.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/r_voxel.c b/src/r_voxel.c index ca91a4e09..9cdf9d291 100644 --- a/src/r_voxel.c +++ b/src/r_voxel.c @@ -871,13 +871,14 @@ static void VX_DrawColumn (vissprite_t * spr, int x, int y) fixed_t uy0 = uy1; // clip the slab vertically - if (uy1 >= clip_y2) break; - if (uy2 <= clip_y1) continue; + if (uy1 >= clip_y2) uy1 = clip_y2; + if (uy2 <= clip_y1) uy2 = clip_y1; if (uy1 < clip_y1) uy1 = clip_y1; if (uy2 > clip_y2) uy2 = clip_y2; - boolean has_side = ((face & (ux > Bx ? B_face : A_face)) != 0); + boolean has_side = ((face & (ux > Bx ? B_face : A_face)) != 0 + && uy1 < clip_y2 && uy2 > clip_y1); // handle the fuzz effect for Spectres if (shadow)