summaryrefslogtreecommitdiff
path: root/src/heretic/r_main.c
diff options
context:
space:
mode:
authorSimon Howard2008-09-20 22:58:53 +0000
committerSimon Howard2008-09-20 22:58:53 +0000
commit9bef9730fb26727a9b505a89615b6ef0425fe64a (patch)
tree6ec1dee130dfdf23920f217dd078f280accf7057 /src/heretic/r_main.c
parent5de8de49ccc2c14b7de14da465510b2368080dd4 (diff)
downloadchocolate-doom-9bef9730fb26727a9b505a89615b6ef0425fe64a.tar.gz
chocolate-doom-9bef9730fb26727a9b505a89615b6ef0425fe64a.tar.bz2
chocolate-doom-9bef9730fb26727a9b505a89615b6ef0425fe64a.zip
Remove heretic duplicate versions of M_AddToBox, M_ClearBox, SlopeDiv
and use common versions. Subversion-branch: /branches/raven-branch Subversion-revision: 1260
Diffstat (limited to 'src/heretic/r_main.c')
-rw-r--r--src/heretic/r_main.c23
1 files changed, 2 insertions, 21 deletions
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 <stdlib.h>
#include <math.h>
#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;