From a4f5382ec9f72573db239f6cb4ee59a56a0c710d Mon Sep 17 00:00:00 2001 From: Alaux <73968015+MrAlaux@users.noreply.github.com> Date: Wed, 29 Jan 2025 04:27:39 -0300 Subject: [PATCH] Fix rendering of voxels on top/bottom of screen (#2134) --- 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 ca91a4e0..9cdf9d29 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)