From d77312cc1e67d67a803c933a275260c053dcf81d Mon Sep 17 00:00:00 2001 From: viciious Date: Fri, 28 Jun 2024 23:18:02 +0300 Subject: [PATCH] Test --- r_phase1.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/r_phase1.c b/r_phase1.c index 7ea3bb605..9ce8b5f7e 100644 --- a/r_phase1.c +++ b/r_phase1.c @@ -134,19 +134,13 @@ static boolean R_CheckBBox(rbspWork_t *rbsp, int16_t bspcoord_[4]) bspcoord[3] = bspcoord_[3] << 16; // find the corners of the box that define the edges from current viewpoint - if(vd->viewx <= bspcoord[BOXLEFT]) - boxx = 0; - else if(vd->viewx < bspcoord[BOXRIGHT]) - boxx = 1; - else - boxx = 2; + boxx = 2; + boxx -= (vd->viewx < bspcoord[BOXRIGHT]); + boxx -= (vd->viewx <= bspcoord[BOXLEFT]); - if(vd->viewy >= bspcoord[BOXTOP]) - boxy = 0; - else if(vd->viewy > bspcoord[BOXBOTTOM]) - boxy = 1; - else - boxy = 2; + boxy = 2; + boxy -= (vd->viewy > bspcoord[BOXBOTTOM]); + boxy -= (vd->viewy >= bspcoord[BOXTOP]); boxpos = (boxy << 2) + boxx; if(boxpos == 5)