diff --git a/src/p_maputl.c b/src/p_maputl.c index 3f318bf2e..e2d08a930 100644 --- a/src/p_maputl.c +++ b/src/p_maputl.c @@ -103,6 +103,17 @@ void P_ClosestPointOnLine3D(const vector3_t *p, const vector3_t *Line, vector3_t return; } +// +// P_PointOnLineSide +// Returns 0 or 1 +// +INT32 P_PointOnLineSide(fixed_t x, fixed_t y, const line_t *line) +{ + // use cross product to determine side quickly + INT64 v = ((INT64)y - line->v1->y) * line->dx - ((INT64)x - line->v1->x) * line->dy; + return v > 0; +} + // // P_BoxOnLineSide // Considers the line to be infinite @@ -140,7 +151,7 @@ INT32 P_BoxOnLineSide(const fixed_t *tmbox, const line_t *ld) // P_PointOnDivlineSide // Returns 0 or 1. // -FUNCMATH FUNCINLINE static ATTRINLINE INT32 P_PointOnDivlineSide(fixed_t x, fixed_t y, const divline_t *line) +static INT32 P_PointOnDivlineSide(fixed_t x, fixed_t y, const divline_t *line) { // use cross product to determine side quickly INT64 v = ((INT64)y - line->y) * line->dx - ((INT64)x - line->x) * line->dy; diff --git a/src/p_maputl.h b/src/p_maputl.h index b117b73f6..698bd878d 100644 --- a/src/p_maputl.h +++ b/src/p_maputl.h @@ -48,18 +48,7 @@ boolean P_PathTraverse(fixed_t px1, fixed_t py1, fixed_t px2, fixed_t py2, #define P_AproxDistance(dx, dy) FixedHypot(dx, dy) void P_ClosestPointOnLine(fixed_t x, fixed_t y, const line_t *line, vertex_t *result); void P_ClosestPointOnLine3D(const vector3_t *p, const vector3_t *line, vector3_t *result); - -// -// P_PointOnLineSide -// Returns 0 or 1 -// -FUNCMATH FUNCINLINE static ATTRINLINE INT32 P_PointOnLineSide(fixed_t x, fixed_t y, const line_t *line) -{ - // use cross product to determine side quickly - INT64 v = ((INT64)y - line->v1->y) * line->dx - ((INT64)x - line->v1->x) * line->dy; - return v > 0; -} - +INT32 P_PointOnLineSide(fixed_t x, fixed_t y, const line_t *line); void P_MakeDivline(const line_t *li, divline_t *dl); struct opening_t