diff options
author | Simon Howard | 2008-09-20 22:58:53 +0000 |
---|---|---|
committer | Simon Howard | 2008-09-20 22:58:53 +0000 |
commit | 9bef9730fb26727a9b505a89615b6ef0425fe64a (patch) | |
tree | 6ec1dee130dfdf23920f217dd078f280accf7057 /src/heretic | |
parent | 5de8de49ccc2c14b7de14da465510b2368080dd4 (diff) | |
download | chocolate-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')
-rw-r--r-- | src/heretic/doomdata.h | 3 | ||||
-rw-r--r-- | src/heretic/doomdef.h | 4 | ||||
-rw-r--r-- | src/heretic/m_misc.c | 18 | ||||
-rw-r--r-- | src/heretic/p_map.c | 1 | ||||
-rw-r--r-- | src/heretic/p_maputl.c | 1 | ||||
-rw-r--r-- | src/heretic/p_setup.c | 1 | ||||
-rw-r--r-- | src/heretic/r_bsp.c | 1 | ||||
-rw-r--r-- | src/heretic/r_main.c | 23 |
8 files changed, 6 insertions, 46 deletions
diff --git a/src/heretic/doomdata.h b/src/heretic/doomdata.h index 8b56c0ed..b55daae4 100644 --- a/src/heretic/doomdata.h +++ b/src/heretic/doomdata.h @@ -107,9 +107,6 @@ typedef struct short offset; } mapseg_t; -enum -{ BOXTOP, BOXBOTTOM, BOXLEFT, BOXRIGHT }; // bbox coordinates - #define NF_SUBSECTOR 0x8000 typedef struct { diff --git a/src/heretic/doomdef.h b/src/heretic/doomdef.h index 02185536..4a4e5299 100644 --- a/src/heretic/doomdef.h +++ b/src/heretic/doomdef.h @@ -914,10 +914,6 @@ boolean M_ValidEpisodeMap(int episode, int map); void M_ForceUppercase(char *text); // Changes a string to uppercase -void M_ClearBox(fixed_t * box); -void M_AddToBox(fixed_t * box, fixed_t x, fixed_t y); -// bounding box functions - void M_LoadDefaults(void); void M_SaveDefaults(void); diff --git a/src/heretic/m_misc.c b/src/heretic/m_misc.c index 26794e9d..465d0fe1 100644 --- a/src/heretic/m_misc.c +++ b/src/heretic/m_misc.c @@ -86,24 +86,6 @@ boolean M_ValidEpisodeMap(int episode, int map) return true; } -void M_ClearBox(fixed_t * box) -{ - box[BOXTOP] = box[BOXRIGHT] = INT_MIN; - box[BOXBOTTOM] = box[BOXLEFT] = INT_MAX; -} - -void M_AddToBox(fixed_t * box, fixed_t x, fixed_t y) -{ - if (x < box[BOXLEFT]) - box[BOXLEFT] = x; - else if (x > box[BOXRIGHT]) - box[BOXRIGHT] = x; - if (y < box[BOXBOTTOM]) - box[BOXBOTTOM] = y; - else if (y > box[BOXTOP]) - box[BOXTOP] = y; -} - //--------------------------------------------------------------------------- // // PROC M_ForceUppercase diff --git a/src/heretic/p_map.c b/src/heretic/p_map.c index 6e98830e..8c4bf51b 100644 --- a/src/heretic/p_map.c +++ b/src/heretic/p_map.c @@ -25,6 +25,7 @@ #include <stdlib.h> #include "doomdef.h" +#include "m_bbox.h" #include "m_random.h" #include "p_local.h" #include "s_sound.h" diff --git a/src/heretic/p_maputl.c b/src/heretic/p_maputl.c index 72e4993c..fb6b7482 100644 --- a/src/heretic/p_maputl.c +++ b/src/heretic/p_maputl.c @@ -26,6 +26,7 @@ #include <stdlib.h> #include "doomdef.h" +#include "m_bbox.h" #include "p_local.h" diff --git a/src/heretic/p_setup.c b/src/heretic/p_setup.c index f9267d3f..c956cc48 100644 --- a/src/heretic/p_setup.c +++ b/src/heretic/p_setup.c @@ -29,6 +29,7 @@ #include "doomdef.h" #include "i_swap.h" #include "m_argv.h" +#include "m_bbox.h" #include "p_local.h" #include "s_sound.h" diff --git a/src/heretic/r_bsp.c b/src/heretic/r_bsp.c index aed96007..a6b2d340 100644 --- a/src/heretic/r_bsp.c +++ b/src/heretic/r_bsp.c @@ -23,6 +23,7 @@ // R_bsp.c #include "doomdef.h" +#include "m_bbox.h" #include "r_local.h" seg_t *curline; 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; |