From 9bef9730fb26727a9b505a89615b6ef0425fe64a Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sat, 20 Sep 2008 22:58:53 +0000 Subject: Remove heretic duplicate versions of M_AddToBox, M_ClearBox, SlopeDiv and use common versions. Subversion-branch: /branches/raven-branch Subversion-revision: 1260 --- src/heretic/r_main.c | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) (limited to 'src/heretic/r_main.c') diff --git a/src/heretic/r_main.c b/src/heretic/r_main.c index a83422cf..b19b87c3 100644 --- a/src/heretic/r_main.c +++ b/src/heretic/r_main.c @@ -25,10 +25,9 @@ #include #include #include "doomdef.h" +#include "m_bbox.h" #include "r_local.h" -/* - -*/ +#include "tables.h" int viewangleoffset; @@ -205,24 +204,6 @@ int R_PointOnSegSide(fixed_t x, fixed_t y, seg_t * line) =============================================================================== */ -// to get a global angle from cartesian coordinates, the coordinates are -// flipped until they are in the first octant of the coordinate system, then -// the y (<=x) is scaled and divided by x to get a tangent (slope) value -// which is looked up in the tantoangle[] table. The +1 size is to handle -// the case when x==y without additional checking. -#define SLOPERANGE 2048 -#define SLOPEBITS 11 -#define DBITS (FRACBITS-SLOPEBITS) - -int SlopeDiv(unsigned num, unsigned den) -{ - unsigned ans; - if (den < 512) - return SLOPERANGE; - ans = (num << 3) / (den >> 8); - return ans <= SLOPERANGE ? ans : SLOPERANGE; -} - angle_t R_PointToAngle(fixed_t x, fixed_t y) { x -= viewx; -- cgit v1.2.3