From efaa12c6c76acb5f313f0e2b85530e4205f2507d Mon Sep 17 00:00:00 2001 From: Alug Date: Tue, 1 Jul 2025 14:42:17 +0200 Subject: [PATCH] this can use min/max --- src/r_plane.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/r_plane.cpp b/src/r_plane.cpp index 4d6244468..653353a2b 100644 --- a/src/r_plane.cpp +++ b/src/r_plane.cpp @@ -1096,6 +1096,7 @@ void R_DrawSinglePlane(drawspandata_t* ds, visplane_t *pl, boolean allow_paralle // and mercilessly shoved into saturn by chearii 02-02-2025 { INT32 trans = (10*((256+12) - pl->ffloor->alpha))/255; + if (trans >= 10) return; // Don't even draw it @@ -1132,13 +1133,8 @@ void R_DrawSinglePlane(drawspandata_t* ds, visplane_t *pl, boolean allow_paralle spanfunctype = SPANDRAWFUNC_WATER; // Copy the current scene, ugh - top = pl->high-8; - bottom = pl->low+8; - - if (top < 0) - top = 0; - if (bottom > vid.height) - bottom = vid.height; + top = std::max(0, pl->high - 8); + bottom = std::min(viewheight, pl->low + 8); // Only copy the part of the screen we need UINT8 i = R_GetViewNumber();