From 05b397e8d6936476bf5e2cc627c2d2d1bc6e5e32 Mon Sep 17 00:00:00 2001 From: Alug Date: Wed, 20 Nov 2024 21:10:28 +0100 Subject: [PATCH] rename to R_PointOnSideFast --- src/hardware/hw_main.c | 2 +- src/r_bsp.c | 2 +- src/r_main.h | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 7882dfabc..327f207fc 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -3150,7 +3150,7 @@ static void HWR_RenderBSPNode(INT32 bspnum) bsp = &nodes[bspnum]; - const INT32 side = R_PointOnSideRender(viewx, viewy, bsp); + const INT32 side = R_PointOnSideFast(viewx, viewy, bsp); stack_bsp[sp] = bspnum; stack_side[sp] = side ^ 1; diff --git a/src/r_bsp.c b/src/r_bsp.c index a65d3636b..bb7d343fa 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -1337,7 +1337,7 @@ void R_RenderBSPNode(INT32 bspnum) bsp = &nodes[bspnum]; // Decide which side the view point is on. - const INT32 side = R_PointOnSideRender(viewx, viewy, bsp); + const INT32 side = R_PointOnSideFast(viewx, viewy, bsp); stack_bsp[sp] = bspnum; stack_side[sp] = side ^ 1; diff --git a/src/r_main.h b/src/r_main.h index 7b156e83f..59ce22fdf 100644 --- a/src/r_main.h +++ b/src/r_main.h @@ -99,7 +99,9 @@ FUNCINLINE static ATTRINLINE PUREFUNC INT32 R_PointOnSide(fixed_t x, fixed_t y, (~mask & (FixedMul(y, node->dx>>FRACBITS) >= FixedMul(node->dy>>FRACBITS, x))); } -FUNCINLINE static ATTRINLINE PUREFUNC INT32 R_PointOnSideRender(fixed_t x, fixed_t y, const node_t *node) +// This is not as accurate +// SHOULD NOT BE USED FOR ANYTHING GAMEPLAY RELATED!! +FUNCINLINE static ATTRINLINE PUREFUNC INT32 R_PointOnSideFast(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;