rename to R_PointOnSideFast

This commit is contained in:
Alug committed 2024-11-20 21:10:28 +01:00
1 parent 1e5d809740
commit 05b397e8d6
3 files changed
+5 -3

No files matched your search

+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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;
+3 -1
View File
@@ -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;