From 8f4d185ea6decc0601ef9db7c8a65abe8ed861bf Mon Sep 17 00:00:00 2001 From: Alug Date: Wed, 30 Oct 2024 16:03:35 +0100 Subject: [PATCH] Revert "use highly optmized (but slightly inaccurate) version of R_PointOnSide for rendering" This reverts commit 9314a24cb22de1aefcc95189d415ed4ff38f94cb. --- src/hardware/hw_main.c | 2 +- src/r_bsp.c | 3 +-- src/r_main.h | 6 ------ 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index feaa48523..2af5537b2 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -3312,7 +3312,7 @@ static void HWR_RenderBSPNode(INT32 bspnum) bsp = &nodes[bspnum]; // Decide which side the view point is on. - side = R_PointOnSideRender(viewx, viewy, bsp); + side = R_PointOnSide(viewx, viewy, bsp); // Recursively divide front space. if (HWR_PortalCheckBBox(bsp->bbox[side])) diff --git a/src/r_bsp.c b/src/r_bsp.c index a6530ce21..500a58035 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -1320,8 +1320,7 @@ void R_RenderBSPNode(INT32 bspnum) bsp = &nodes[bspnum]; // Decide which side the view point is on. - side = R_PointOnSideRender(viewx, viewy, bsp); - + side = R_PointOnSide(viewx, viewy, bsp); // Recursively divide front space. R_RenderBSPNode(bsp->children[side]); diff --git a/src/r_main.h b/src/r_main.h index cc30cc22b..8515b5e4c 100644 --- a/src/r_main.h +++ b/src/r_main.h @@ -74,12 +74,6 @@ extern lighttable_t *zlight[LIGHTLEVELS][MAXLIGHTZ]; // Utility functions. INT32 R_PointOnSide(fixed_t x, fixed_t y, const node_t *node); -FUNCINLINE static ATTRINLINE PUREFUNC INT32 R_PointOnSideRender(fixed_t x, fixed_t y, const node_t *node) -{ - // use cross product to determine side quickly - return (INT64)(y - node->y) * node->dx - (INT64)(x - node->x) * node->dy > 0; -} - FUNCINLINE static ATTRINLINE PUREFUNC INT32 R_PointOnSegSide(fixed_t x, fixed_t y, const seg_t *line) { fixed_t lx = line->v1->x;