mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
Rename mplane_t to plane_t and clean up the mess.
I got rather tired of there being multiple definitions of mostly compatible plane types (and I need a common type anyway). dplane_t still exists for now because I want to be careful when messing with the actual bsp format.
This commit is contained in:
parent
2f23cfa4d0
commit
91e65b6c80
28 changed files with 72 additions and 89 deletions
|
@ -249,7 +249,7 @@ void AngleVectors (const vec3_t angles, vec3_t forward, vec3_t right,
|
||||||
void AngleQuat (const vec3_t angles, quat_t q);
|
void AngleQuat (const vec3_t angles, quat_t q);
|
||||||
void VectorVectors (const vec3_t forward, vec3_t right, vec3_t up);
|
void VectorVectors (const vec3_t forward, vec3_t right, vec3_t up);
|
||||||
int BoxOnPlaneSide (const vec3_t emins, const vec3_t emaxs,
|
int BoxOnPlaneSide (const vec3_t emins, const vec3_t emaxs,
|
||||||
struct mplane_s *plane);
|
struct plane_s *plane);
|
||||||
float anglemod (float a);
|
float anglemod (float a);
|
||||||
|
|
||||||
void RotatePointAroundVector (vec3_t dst, const vec3_t axis,
|
void RotatePointAroundVector (vec3_t dst, const vec3_t axis,
|
||||||
|
@ -288,7 +288,7 @@ void QuatToMatrix (const quat_t q, vec_t *m, int homogenous, int vertical);
|
||||||
VectorNegate ((sp)->normal, (dp)->normal); \
|
VectorNegate ((sp)->normal, (dp)->normal); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
extern mplane_t * const frustum;
|
extern plane_t * const frustum;
|
||||||
extern inline qboolean R_CullBox (const vec3_t mins, const vec3_t maxs);
|
extern inline qboolean R_CullBox (const vec3_t mins, const vec3_t maxs);
|
||||||
extern inline qboolean R_CullSphere (const vec3_t origin, const float radius);
|
extern inline qboolean R_CullSphere (const vec3_t origin, const float radius);
|
||||||
extern inline float VectorNormalize (vec3_t v); // returns vector length
|
extern inline float VectorNormalize (vec3_t v); // returns vector length
|
||||||
|
|
|
@ -122,7 +122,7 @@ typedef struct glpoly_s {
|
||||||
typedef struct msurface_s {
|
typedef struct msurface_s {
|
||||||
int visframe; // should be drawn when node is crossed
|
int visframe; // should be drawn when node is crossed
|
||||||
|
|
||||||
mplane_t *plane;
|
plane_t *plane;
|
||||||
int flags;
|
int flags;
|
||||||
|
|
||||||
int firstedge; // look up in model->surfedges[], negative numbers
|
int firstedge; // look up in model->surfedges[], negative numbers
|
||||||
|
@ -162,7 +162,7 @@ typedef struct mnode_s {
|
||||||
struct mnode_s *parent;
|
struct mnode_s *parent;
|
||||||
|
|
||||||
// node specific
|
// node specific
|
||||||
mplane_t *plane;
|
plane_t *plane;
|
||||||
struct mnode_s *children[2];
|
struct mnode_s *children[2];
|
||||||
|
|
||||||
unsigned short firstsurface;
|
unsigned short firstsurface;
|
||||||
|
@ -197,7 +197,7 @@ typedef struct mclipnode_s {
|
||||||
|
|
||||||
typedef struct hull_s {
|
typedef struct hull_s {
|
||||||
mclipnode_t *clipnodes;
|
mclipnode_t *clipnodes;
|
||||||
mplane_t *planes;
|
plane_t *planes;
|
||||||
int firstclipnode;
|
int firstclipnode;
|
||||||
int lastclipnode;
|
int lastclipnode;
|
||||||
vec3_t clip_mins;
|
vec3_t clip_mins;
|
||||||
|
@ -357,7 +357,7 @@ typedef struct model_s {
|
||||||
dmodel_t *submodels;
|
dmodel_t *submodels;
|
||||||
|
|
||||||
int numplanes;
|
int numplanes;
|
||||||
mplane_t *planes;
|
plane_t *planes;
|
||||||
|
|
||||||
int numleafs; // number of visible leafs, not counting 0
|
int numleafs; // number of visible leafs, not counting 0
|
||||||
mleaf_t *leafs;
|
mleaf_t *leafs;
|
||||||
|
|
|
@ -89,12 +89,12 @@ typedef int fixed16_t;
|
||||||
|
|
||||||
// plane_t structure
|
// plane_t structure
|
||||||
// !!! if this is changed, it must be changed in asm_i386.h too !!!
|
// !!! if this is changed, it must be changed in asm_i386.h too !!!
|
||||||
typedef struct mplane_s {
|
typedef struct plane_s {
|
||||||
vec3_t normal;
|
vec3_t normal;
|
||||||
float dist;
|
float dist;
|
||||||
byte type; // for texture axis selection and fast side tests
|
byte type; // for texture axis selection and fast side tests
|
||||||
byte signbits; // signx + signy<<1 + signz<<1
|
byte signbits; // signx + signy<<1 + signz<<1
|
||||||
byte pad[2];
|
byte pad[2];
|
||||||
} mplane_t;
|
} plane_t;
|
||||||
|
|
||||||
#endif // __qtypes_h
|
#endif // __qtypes_h
|
||||||
|
|
|
@ -128,7 +128,7 @@ void R_RenderWorld (void);
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
||||||
extern mplane_t screenedge[4];
|
extern plane_t screenedge[4];
|
||||||
|
|
||||||
extern vec3_t r_origin;
|
extern vec3_t r_origin;
|
||||||
|
|
||||||
|
@ -158,7 +158,7 @@ void R_DrawSprite (void);
|
||||||
void R_RenderFace (msurface_t *fa, int clipflags);
|
void R_RenderFace (msurface_t *fa, int clipflags);
|
||||||
void R_RenderPoly (msurface_t *fa, int clipflags);
|
void R_RenderPoly (msurface_t *fa, int clipflags);
|
||||||
void R_RenderBmodelFace (bedge_t *pedges, msurface_t *psurf);
|
void R_RenderBmodelFace (bedge_t *pedges, msurface_t *psurf);
|
||||||
void R_TransformPlane (mplane_t *p, float *normal, float *dist);
|
void R_TransformPlane (plane_t *p, float *normal, float *dist);
|
||||||
void R_TransformFrustum (void);
|
void R_TransformFrustum (void);
|
||||||
void R_SetSkyFrame (void);
|
void R_SetSkyFrame (void);
|
||||||
void R_DrawSurfaceBlock (void);
|
void R_DrawSurfaceBlock (void);
|
||||||
|
|
|
@ -33,12 +33,6 @@
|
||||||
#include "QF/mathlib.h"
|
#include "QF/mathlib.h"
|
||||||
#include "QF/model.h"
|
#include "QF/model.h"
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
vec3_t normal;
|
|
||||||
vec_t dist;
|
|
||||||
} plane_t;
|
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
tr_point,
|
tr_point,
|
||||||
tr_box,
|
tr_box,
|
||||||
|
@ -77,7 +71,7 @@ extern areanode_t sv_areanodes[AREA_NODES];
|
||||||
|
|
||||||
void SV_FreeAllEdictLeafs (void);
|
void SV_FreeAllEdictLeafs (void);
|
||||||
|
|
||||||
void SV_InitHull (hull_t *hull, mclipnode_t *clipnodes, mplane_t *planes);
|
void SV_InitHull (hull_t *hull, mclipnode_t *clipnodes, plane_t *planes);
|
||||||
|
|
||||||
void SV_ClearWorld (void);
|
void SV_ClearWorld (void);
|
||||||
// called after the world model has been loaded, before linking any entities
|
// called after the world model has been loaded, before linking any entities
|
||||||
|
|
|
@ -63,7 +63,7 @@ Mod_PointInLeaf (const vec3_t p, model_t *model)
|
||||||
{
|
{
|
||||||
float d;
|
float d;
|
||||||
mnode_t *node;
|
mnode_t *node;
|
||||||
mplane_t *plane;
|
plane_t *plane;
|
||||||
|
|
||||||
if (!model || !model->nodes)
|
if (!model || !model->nodes)
|
||||||
Sys_Error ("Mod_PointInLeaf: bad model");
|
Sys_Error ("Mod_PointInLeaf: bad model");
|
||||||
|
@ -837,7 +837,7 @@ Mod_LoadPlanes (bsp_t *bsp)
|
||||||
{
|
{
|
||||||
dplane_t *in;
|
dplane_t *in;
|
||||||
int bits, count, i, j;
|
int bits, count, i, j;
|
||||||
mplane_t *out;
|
plane_t *out;
|
||||||
|
|
||||||
in = bsp->planes;
|
in = bsp->planes;
|
||||||
count = bsp->numplanes;
|
count = bsp->numplanes;
|
||||||
|
|
|
@ -47,7 +47,7 @@ MOD_Alloc_Hull (int nodes, int planes)
|
||||||
int size, i;
|
int size, i;
|
||||||
|
|
||||||
size = sizeof (hull_t);
|
size = sizeof (hull_t);
|
||||||
size += sizeof (mclipnode_t) * nodes + sizeof (mplane_t) * planes;
|
size += sizeof (mclipnode_t) * nodes + sizeof (plane_t) * planes;
|
||||||
size *= MAX_MAP_HULLS;
|
size *= MAX_MAP_HULLS;
|
||||||
size += sizeof (clip_hull_t);
|
size += sizeof (clip_hull_t);
|
||||||
|
|
||||||
|
@ -58,11 +58,11 @@ MOD_Alloc_Hull (int nodes, int planes)
|
||||||
for (i = 1; i < MAX_MAP_HULLS; i++)
|
for (i = 1; i < MAX_MAP_HULLS; i++)
|
||||||
ch->hulls[i] = &ch->hulls[i - 1][1];
|
ch->hulls[i] = &ch->hulls[i - 1][1];
|
||||||
ch->hulls[0]->clipnodes = (mclipnode_t *) &ch->hulls[i - 1][1];
|
ch->hulls[0]->clipnodes = (mclipnode_t *) &ch->hulls[i - 1][1];
|
||||||
ch->hulls[0]->planes = (mplane_t *) &ch->hulls[0]->clipnodes[nodes];
|
ch->hulls[0]->planes = (plane_t *) &ch->hulls[0]->clipnodes[nodes];
|
||||||
for (i = 1; i < MAX_MAP_HULLS; i++) {
|
for (i = 1; i < MAX_MAP_HULLS; i++) {
|
||||||
ch->hulls[i]->clipnodes =
|
ch->hulls[i]->clipnodes =
|
||||||
(mclipnode_t *) &ch->hulls[i - 1]->planes[planes];
|
(mclipnode_t *) &ch->hulls[i - 1]->planes[planes];
|
||||||
ch->hulls[i]->planes = (mplane_t *) &ch->hulls[i]->clipnodes[nodes];
|
ch->hulls[i]->planes = (plane_t *) &ch->hulls[i]->clipnodes[nodes];
|
||||||
}
|
}
|
||||||
return ch;
|
return ch;
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,11 +60,11 @@ typedef struct {
|
||||||
vec_t start_frac;
|
vec_t start_frac;
|
||||||
int side;
|
int side;
|
||||||
int num;
|
int num;
|
||||||
mplane_t *plane;
|
plane_t *plane;
|
||||||
} tracestack_t;
|
} tracestack_t;
|
||||||
|
|
||||||
static inline float
|
static inline float
|
||||||
calc_offset (trace_t *trace, mplane_t *plane)
|
calc_offset (trace_t *trace, plane_t *plane)
|
||||||
{
|
{
|
||||||
vec_t d = 0;
|
vec_t d = 0;
|
||||||
vec3_t Rn;
|
vec3_t Rn;
|
||||||
|
@ -92,7 +92,7 @@ calc_offset (trace_t *trace, mplane_t *plane)
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
calc_impact (trace_t *trace, const vec3_t start, const vec3_t end,
|
calc_impact (trace_t *trace, const vec3_t start, const vec3_t end,
|
||||||
mplane_t *plane)
|
plane_t *plane)
|
||||||
{
|
{
|
||||||
vec_t t1, t2, frac, offset;
|
vec_t t1, t2, frac, offset;
|
||||||
vec3_t dist;
|
vec3_t dist;
|
||||||
|
@ -135,7 +135,7 @@ MOD_TraceLine (hull_t *hull, int num,
|
||||||
tracestack_t *tstack;
|
tracestack_t *tstack;
|
||||||
tracestack_t tracestack[256];
|
tracestack_t tracestack[256];
|
||||||
mclipnode_t *node;
|
mclipnode_t *node;
|
||||||
mplane_t *plane, *split_plane;
|
plane_t *plane, *split_plane;
|
||||||
|
|
||||||
VectorCopy (start_point, start);
|
VectorCopy (start_point, start);
|
||||||
VectorCopy (end_point, end);
|
VectorCopy (end_point, end);
|
||||||
|
|
|
@ -48,8 +48,8 @@ static __attribute__ ((used)) const char rcsid[] =
|
||||||
#include "QF/sys.h"
|
#include "QF/sys.h"
|
||||||
|
|
||||||
VISIBLE int nanmask = 255 << 23;
|
VISIBLE int nanmask = 255 << 23;
|
||||||
static mplane_t _frustum[4];
|
static plane_t _frustum[4];
|
||||||
VISIBLE mplane_t *const frustum = _frustum;
|
VISIBLE plane_t *const frustum = _frustum;
|
||||||
static vec3_t _vec3_origin = { 0, 0, 0 };
|
static vec3_t _vec3_origin = { 0, 0, 0 };
|
||||||
VISIBLE const vec_t * const vec3_origin = _vec3_origin;
|
VISIBLE const vec_t * const vec3_origin = _vec3_origin;
|
||||||
static vec3_t _quat_origin = { 0, 0, 0 };
|
static vec3_t _quat_origin = { 0, 0, 0 };
|
||||||
|
@ -269,7 +269,7 @@ BOPS_Error (void)
|
||||||
Returns 1, 2, or 1 + 2
|
Returns 1, 2, or 1 + 2
|
||||||
*/
|
*/
|
||||||
VISIBLE int
|
VISIBLE int
|
||||||
BoxOnPlaneSide (const vec3_t emins, const vec3_t emaxs, mplane_t *p)
|
BoxOnPlaneSide (const vec3_t emins, const vec3_t emaxs, plane_t *p)
|
||||||
{
|
{
|
||||||
float dist1, dist2;
|
float dist1, dist2;
|
||||||
int sides;
|
int sides;
|
||||||
|
|
|
@ -83,7 +83,7 @@ qboolean envmap; // true during envmap command capture
|
||||||
|
|
||||||
int mirrortexturenum; // quake texturenum, not gltexturenum
|
int mirrortexturenum; // quake texturenum, not gltexturenum
|
||||||
qboolean mirror;
|
qboolean mirror;
|
||||||
mplane_t *mirror_plane;
|
plane_t *mirror_plane;
|
||||||
|
|
||||||
// view origin
|
// view origin
|
||||||
VISIBLE vec3_t vup;
|
VISIBLE vec3_t vup;
|
||||||
|
@ -360,7 +360,7 @@ R_DrawViewModel (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
SignbitsForPlane (mplane_t *out)
|
SignbitsForPlane (plane_t *out)
|
||||||
{
|
{
|
||||||
int bits, j;
|
int bits, j;
|
||||||
|
|
||||||
|
|
|
@ -370,7 +370,7 @@ R_DrawBrushModel (entity_t *e)
|
||||||
int i;
|
int i;
|
||||||
unsigned int k;
|
unsigned int k;
|
||||||
model_t *model;
|
model_t *model;
|
||||||
mplane_t *pplane;
|
plane_t *pplane;
|
||||||
msurface_t *psurf;
|
msurface_t *psurf;
|
||||||
qboolean rotated;
|
qboolean rotated;
|
||||||
vec3_t mins, maxs;
|
vec3_t mins, maxs;
|
||||||
|
@ -571,7 +571,7 @@ static inline int
|
||||||
get_side (mnode_t *node)
|
get_side (mnode_t *node)
|
||||||
{
|
{
|
||||||
// find which side of the node we are on
|
// find which side of the node we are on
|
||||||
mplane_t *plane = node->plane;
|
plane_t *plane = node->plane;
|
||||||
|
|
||||||
if (plane->type < 3)
|
if (plane->type < 3)
|
||||||
return (modelorg[plane->type] - plane->dist) < 0;
|
return (modelorg[plane->type] - plane->dist) < 0;
|
||||||
|
|
|
@ -125,7 +125,7 @@ static void
|
||||||
R_SplitEntityOnNode (mnode_t *node)
|
R_SplitEntityOnNode (mnode_t *node)
|
||||||
{
|
{
|
||||||
efrag_t *ef;
|
efrag_t *ef;
|
||||||
mplane_t *splitplane;
|
plane_t *splitplane;
|
||||||
mleaf_t *leaf;
|
mleaf_t *leaf;
|
||||||
int sides;
|
int sides;
|
||||||
|
|
||||||
|
|
|
@ -152,7 +152,7 @@ R_RecursiveMarkLights (const vec3_t lightorigin, dlight_t *light, int bit,
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
float ndist, maxdist;
|
float ndist, maxdist;
|
||||||
mplane_t *splitplane;
|
plane_t *splitplane;
|
||||||
msurface_t *surf;
|
msurface_t *surf;
|
||||||
//XXX mvertex_t *vertices;
|
//XXX mvertex_t *vertices;
|
||||||
|
|
||||||
|
@ -276,7 +276,7 @@ R_PushDlights (const vec3_t entorigin)
|
||||||
|
|
||||||
/* LIGHT SAMPLING */
|
/* LIGHT SAMPLING */
|
||||||
|
|
||||||
mplane_t *lightplane;
|
plane_t *lightplane;
|
||||||
vec3_t lightspot;
|
vec3_t lightspot;
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -347,7 +347,7 @@ RecursiveLightPoint (mnode_t *node, const vec3_t start, const vec3_t end)
|
||||||
{
|
{
|
||||||
int i, r, s, t, ds, dt, side;
|
int i, r, s, t, ds, dt, side;
|
||||||
float front, back, frac;
|
float front, back, frac;
|
||||||
mplane_t *plane;
|
plane_t *plane;
|
||||||
msurface_t *surf;
|
msurface_t *surf;
|
||||||
mtexinfo_t *tex;
|
mtexinfo_t *tex;
|
||||||
vec3_t mid;
|
vec3_t mid;
|
||||||
|
|
|
@ -155,7 +155,7 @@ R_RecursiveClipBPoly (bedge_t *pedges, mnode_t *pnode, msurface_t *psurf)
|
||||||
bedge_t *psideedges[2], *pnextedge, *ptedge;
|
bedge_t *psideedges[2], *pnextedge, *ptedge;
|
||||||
int i, side, lastside;
|
int i, side, lastside;
|
||||||
float dist, frac, lastdist;
|
float dist, frac, lastdist;
|
||||||
mplane_t *splitplane, tplane;
|
plane_t *splitplane, tplane;
|
||||||
mvertex_t *pvert, *plastvert, *ptvert;
|
mvertex_t *pvert, *plastvert, *ptvert;
|
||||||
mnode_t *pn;
|
mnode_t *pn;
|
||||||
|
|
||||||
|
@ -301,7 +301,7 @@ R_DrawSolidClippedSubmodelPolygons (model_t *pmodel)
|
||||||
vec_t dot;
|
vec_t dot;
|
||||||
msurface_t *psurf;
|
msurface_t *psurf;
|
||||||
int numsurfaces;
|
int numsurfaces;
|
||||||
mplane_t *pplane;
|
plane_t *pplane;
|
||||||
mvertex_t bverts[MAX_BMODEL_VERTS];
|
mvertex_t bverts[MAX_BMODEL_VERTS];
|
||||||
bedge_t bedges[MAX_BMODEL_EDGES], *pbedge;
|
bedge_t bedges[MAX_BMODEL_EDGES], *pbedge;
|
||||||
medge_t *pedge, *pedges;
|
medge_t *pedge, *pedges;
|
||||||
|
@ -370,7 +370,7 @@ R_DrawSubmodelPolygons (model_t *pmodel, int clipflags)
|
||||||
vec_t dot;
|
vec_t dot;
|
||||||
msurface_t *psurf;
|
msurface_t *psurf;
|
||||||
int numsurfaces;
|
int numsurfaces;
|
||||||
mplane_t *pplane;
|
plane_t *pplane;
|
||||||
|
|
||||||
// FIXME: use bounding-box-based frustum clipping info?
|
// FIXME: use bounding-box-based frustum clipping info?
|
||||||
|
|
||||||
|
@ -409,7 +409,7 @@ static inline int
|
||||||
get_side (mnode_t *node)
|
get_side (mnode_t *node)
|
||||||
{
|
{
|
||||||
// find which side of the node we are on
|
// find which side of the node we are on
|
||||||
mplane_t *plane = node->plane;
|
plane_t *plane = node->plane;
|
||||||
|
|
||||||
if (plane->type < 3)
|
if (plane->type < 3)
|
||||||
return (modelorg[plane->type] - plane->dist) < 0;
|
return (modelorg[plane->type] - plane->dist) < 0;
|
||||||
|
@ -560,7 +560,7 @@ R_RecursiveWorldNode (mnode_t *node, int clipflags)
|
||||||
{
|
{
|
||||||
int i, c, side, *pindex;
|
int i, c, side, *pindex;
|
||||||
vec3_t acceptpt, rejectpt;
|
vec3_t acceptpt, rejectpt;
|
||||||
mplane_t *plane;
|
plane_t *plane;
|
||||||
msurface_t *surf;
|
msurface_t *surf;
|
||||||
mleaf_t *pleaf;
|
mleaf_t *pleaf;
|
||||||
double d, dot;
|
double d, dot;
|
||||||
|
|
|
@ -353,7 +353,7 @@ R_RenderFace (msurface_t *fa, int clipflags)
|
||||||
{
|
{
|
||||||
int i, lindex;
|
int i, lindex;
|
||||||
unsigned int mask;
|
unsigned int mask;
|
||||||
mplane_t *pplane;
|
plane_t *pplane;
|
||||||
float distinv;
|
float distinv;
|
||||||
vec3_t p_normal;
|
vec3_t p_normal;
|
||||||
medge_t *pedges, tedge;
|
medge_t *pedges, tedge;
|
||||||
|
@ -519,7 +519,7 @@ R_RenderBmodelFace (bedge_t *pedges, msurface_t *psurf)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
unsigned int mask;
|
unsigned int mask;
|
||||||
mplane_t *pplane;
|
plane_t *pplane;
|
||||||
float distinv;
|
float distinv;
|
||||||
vec3_t p_normal;
|
vec3_t p_normal;
|
||||||
medge_t tedge;
|
medge_t tedge;
|
||||||
|
@ -623,7 +623,7 @@ R_RenderPoly (msurface_t *fa, int clipflags)
|
||||||
vec3_t local, transformed;
|
vec3_t local, transformed;
|
||||||
clipplane_t *pclip;
|
clipplane_t *pclip;
|
||||||
medge_t *pedges;
|
medge_t *pedges;
|
||||||
mplane_t *pplane;
|
plane_t *pplane;
|
||||||
mvertex_t verts[2][100]; // FIXME: do real number
|
mvertex_t verts[2][100]; // FIXME: do real number
|
||||||
polyvert_t pverts[100]; // FIXME: do real number, safely
|
polyvert_t pverts[100]; // FIXME: do real number, safely
|
||||||
int vertpage, newverts, newpage, lastvert;
|
int vertpage, newverts, newpage, lastvert;
|
||||||
|
@ -787,7 +787,7 @@ R_ZDrawSubmodelPolys (model_t *pmodel)
|
||||||
int i, numsurfaces;
|
int i, numsurfaces;
|
||||||
msurface_t *psurf;
|
msurface_t *psurf;
|
||||||
float dot;
|
float dot;
|
||||||
mplane_t *pplane;
|
plane_t *pplane;
|
||||||
|
|
||||||
psurf = &pmodel->surfaces[pmodel->firstmodelsurface];
|
psurf = &pmodel->surfaces[pmodel->firstmodelsurface];
|
||||||
numsurfaces = pmodel->nummodelsurfaces;
|
numsurfaces = pmodel->nummodelsurfaces;
|
||||||
|
|
|
@ -116,7 +116,7 @@ float screenAspect;
|
||||||
float verticalFieldOfView;
|
float verticalFieldOfView;
|
||||||
float xOrigin, yOrigin;
|
float xOrigin, yOrigin;
|
||||||
|
|
||||||
mplane_t screenedge[4];
|
plane_t screenedge[4];
|
||||||
|
|
||||||
// refresh flags
|
// refresh flags
|
||||||
int r_framecount = 1; // so frame counts initialized to 0 don't match
|
int r_framecount = 1; // so frame counts initialized to 0 don't match
|
||||||
|
|
|
@ -175,7 +175,7 @@ TransformVector (const vec3_t in, vec3_t out)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
R_TransformPlane (mplane_t *p, float *normal, float *dist)
|
R_TransformPlane (plane_t *p, float *normal, float *dist)
|
||||||
{
|
{
|
||||||
float d;
|
float d;
|
||||||
|
|
||||||
|
|
|
@ -155,7 +155,7 @@ R_RecursiveClipBPoly (bedge_t *pedges, mnode_t *pnode, msurface_t *psurf)
|
||||||
bedge_t *psideedges[2], *pnextedge, *ptedge;
|
bedge_t *psideedges[2], *pnextedge, *ptedge;
|
||||||
int i, side, lastside;
|
int i, side, lastside;
|
||||||
float dist, frac, lastdist;
|
float dist, frac, lastdist;
|
||||||
mplane_t *splitplane, tplane;
|
plane_t *splitplane, tplane;
|
||||||
mvertex_t *pvert, *plastvert, *ptvert;
|
mvertex_t *pvert, *plastvert, *ptvert;
|
||||||
mnode_t *pn;
|
mnode_t *pn;
|
||||||
|
|
||||||
|
@ -301,7 +301,7 @@ R_DrawSolidClippedSubmodelPolygons (model_t *pmodel)
|
||||||
vec_t dot;
|
vec_t dot;
|
||||||
msurface_t *psurf;
|
msurface_t *psurf;
|
||||||
int numsurfaces;
|
int numsurfaces;
|
||||||
mplane_t *pplane;
|
plane_t *pplane;
|
||||||
mvertex_t bverts[MAX_BMODEL_VERTS];
|
mvertex_t bverts[MAX_BMODEL_VERTS];
|
||||||
bedge_t bedges[MAX_BMODEL_EDGES], *pbedge;
|
bedge_t bedges[MAX_BMODEL_EDGES], *pbedge;
|
||||||
medge_t *pedge, *pedges;
|
medge_t *pedge, *pedges;
|
||||||
|
@ -370,7 +370,7 @@ R_DrawSubmodelPolygons (model_t *pmodel, int clipflags)
|
||||||
vec_t dot;
|
vec_t dot;
|
||||||
msurface_t *psurf;
|
msurface_t *psurf;
|
||||||
int numsurfaces;
|
int numsurfaces;
|
||||||
mplane_t *pplane;
|
plane_t *pplane;
|
||||||
|
|
||||||
// FIXME: use bounding-box-based frustum clipping info?
|
// FIXME: use bounding-box-based frustum clipping info?
|
||||||
|
|
||||||
|
@ -409,7 +409,7 @@ static inline int
|
||||||
get_side (mnode_t *node)
|
get_side (mnode_t *node)
|
||||||
{
|
{
|
||||||
// find which side of the node we are on
|
// find which side of the node we are on
|
||||||
mplane_t *plane = node->plane;
|
plane_t *plane = node->plane;
|
||||||
|
|
||||||
if (plane->type < 3)
|
if (plane->type < 3)
|
||||||
return (modelorg[plane->type] - plane->dist) < 0;
|
return (modelorg[plane->type] - plane->dist) < 0;
|
||||||
|
@ -560,7 +560,7 @@ R_RecursiveWorldNode (mnode_t *node, int clipflags)
|
||||||
{
|
{
|
||||||
int i, c, side, *pindex;
|
int i, c, side, *pindex;
|
||||||
vec3_t acceptpt, rejectpt;
|
vec3_t acceptpt, rejectpt;
|
||||||
mplane_t *plane;
|
plane_t *plane;
|
||||||
msurface_t *surf;
|
msurface_t *surf;
|
||||||
mleaf_t *pleaf;
|
mleaf_t *pleaf;
|
||||||
double d, dot;
|
double d, dot;
|
||||||
|
|
|
@ -346,7 +346,7 @@ R_RenderFace (msurface_t *fa, int clipflags)
|
||||||
{
|
{
|
||||||
int i, lindex;
|
int i, lindex;
|
||||||
unsigned int mask;
|
unsigned int mask;
|
||||||
mplane_t *pplane;
|
plane_t *pplane;
|
||||||
float distinv;
|
float distinv;
|
||||||
vec3_t p_normal;
|
vec3_t p_normal;
|
||||||
medge_t *pedges, tedge;
|
medge_t *pedges, tedge;
|
||||||
|
@ -513,7 +513,7 @@ R_RenderBmodelFace (bedge_t *pedges, msurface_t *psurf)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
unsigned int mask;
|
unsigned int mask;
|
||||||
mplane_t *pplane;
|
plane_t *pplane;
|
||||||
float distinv;
|
float distinv;
|
||||||
vec3_t p_normal;
|
vec3_t p_normal;
|
||||||
medge_t tedge;
|
medge_t tedge;
|
||||||
|
@ -618,7 +618,7 @@ R_RenderPoly (msurface_t *fa, int clipflags)
|
||||||
vec3_t local, transformed;
|
vec3_t local, transformed;
|
||||||
clipplane_t *pclip;
|
clipplane_t *pclip;
|
||||||
medge_t *pedges;
|
medge_t *pedges;
|
||||||
mplane_t *pplane;
|
plane_t *pplane;
|
||||||
mvertex_t verts[2][100]; // FIXME: do real number
|
mvertex_t verts[2][100]; // FIXME: do real number
|
||||||
polyvert_t pverts[100]; // FIXME: do real number, safely
|
polyvert_t pverts[100]; // FIXME: do real number, safely
|
||||||
int vertpage, newverts, newpage, lastvert;
|
int vertpage, newverts, newpage, lastvert;
|
||||||
|
@ -782,7 +782,7 @@ R_ZDrawSubmodelPolys (model_t *pmodel)
|
||||||
int i, numsurfaces;
|
int i, numsurfaces;
|
||||||
msurface_t *psurf;
|
msurface_t *psurf;
|
||||||
float dot;
|
float dot;
|
||||||
mplane_t *pplane;
|
plane_t *pplane;
|
||||||
|
|
||||||
psurf = &pmodel->surfaces[pmodel->firstmodelsurface];
|
psurf = &pmodel->surfaces[pmodel->firstmodelsurface];
|
||||||
numsurfaces = pmodel->nummodelsurfaces;
|
numsurfaces = pmodel->nummodelsurfaces;
|
||||||
|
|
|
@ -110,7 +110,7 @@ float screenAspect;
|
||||||
float verticalFieldOfView;
|
float verticalFieldOfView;
|
||||||
float xOrigin, yOrigin;
|
float xOrigin, yOrigin;
|
||||||
|
|
||||||
mplane_t screenedge[4];
|
plane_t screenedge[4];
|
||||||
|
|
||||||
// refresh flags
|
// refresh flags
|
||||||
VISIBLE int r_framecount = 1; // so frame counts initialized to 0 don't match
|
VISIBLE int r_framecount = 1; // so frame counts initialized to 0 don't match
|
||||||
|
|
|
@ -169,7 +169,7 @@ TransformVector (const vec3_t in, vec3_t out)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
R_TransformPlane (mplane_t *p, float *normal, float *dist)
|
R_TransformPlane (plane_t *p, float *normal, float *dist)
|
||||||
{
|
{
|
||||||
float d;
|
float d;
|
||||||
|
|
||||||
|
|
|
@ -390,7 +390,7 @@ SV_AddToFatPVS (vec3_t org, mnode_t *node)
|
||||||
int i;
|
int i;
|
||||||
float d;
|
float d;
|
||||||
byte *pvs;
|
byte *pvs;
|
||||||
mplane_t *plane;
|
plane_t *plane;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
// if this is a leaf, accumulate the pvs bits
|
// if this is a leaf, accumulate the pvs bits
|
||||||
|
|
|
@ -136,7 +136,7 @@ typedef struct {
|
||||||
|
|
||||||
static hull_t box_hull;
|
static hull_t box_hull;
|
||||||
static mclipnode_t box_clipnodes[6];
|
static mclipnode_t box_clipnodes[6];
|
||||||
static mplane_t box_planes[6];
|
static plane_t box_planes[6];
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -146,7 +146,7 @@ static mplane_t box_planes[6];
|
||||||
can just be stored out and get a proper hull_t structure.
|
can just be stored out and get a proper hull_t structure.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
SV_InitHull (hull_t *hull, mclipnode_t *clipnodes, mplane_t *planes)
|
SV_InitHull (hull_t *hull, mclipnode_t *clipnodes, plane_t *planes)
|
||||||
{
|
{
|
||||||
int side, i;
|
int side, i;
|
||||||
|
|
||||||
|
@ -412,7 +412,7 @@ SV_FindTouchedLeafs (edict_t *ent, mnode_t *node)
|
||||||
{
|
{
|
||||||
int sides;
|
int sides;
|
||||||
mleaf_t *leaf;
|
mleaf_t *leaf;
|
||||||
mplane_t *splitplane;
|
plane_t *splitplane;
|
||||||
edict_leaf_t *edict_leaf;
|
edict_leaf_t *edict_leaf;
|
||||||
|
|
||||||
if (node->contents == CONTENTS_SOLID)
|
if (node->contents == CONTENTS_SOLID)
|
||||||
|
@ -531,7 +531,7 @@ SV_HullPointContents (hull_t *hull, int num, const vec3_t p)
|
||||||
{
|
{
|
||||||
float d;
|
float d;
|
||||||
mclipnode_t *node;
|
mclipnode_t *node;
|
||||||
mplane_t *plane;
|
plane_t *plane;
|
||||||
|
|
||||||
while (num >= 0) {
|
while (num >= 0) {
|
||||||
//if (num < hull->firstclipnode || num > hull->lastclipnode)
|
//if (num < hull->firstclipnode || num > hull->lastclipnode)
|
||||||
|
|
|
@ -49,7 +49,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
||||||
|
|
||||||
static hull_t box_hull;
|
static hull_t box_hull;
|
||||||
static mclipnode_t box_clipnodes[6];
|
static mclipnode_t box_clipnodes[6];
|
||||||
static mplane_t box_planes[6];
|
static plane_t box_planes[6];
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -109,7 +109,7 @@ PM_HullPointContents (hull_t *hull, int num, const vec3_t p)
|
||||||
{
|
{
|
||||||
float d;
|
float d;
|
||||||
mclipnode_t *node;
|
mclipnode_t *node;
|
||||||
mplane_t *plane;
|
plane_t *plane;
|
||||||
|
|
||||||
while (num >= 0) {
|
while (num >= 0) {
|
||||||
node = hull->clipnodes + num;
|
node = hull->clipnodes + num;
|
||||||
|
@ -135,7 +135,7 @@ PM_PointContents (const vec3_t p)
|
||||||
int num;
|
int num;
|
||||||
mclipnode_t *node;
|
mclipnode_t *node;
|
||||||
hull_t *hull;
|
hull_t *hull;
|
||||||
mplane_t *plane;
|
plane_t *plane;
|
||||||
|
|
||||||
hull = &pmove.physents[0].model->hulls[0];
|
hull = &pmove.physents[0].model->hulls[0];
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ SV_AddToFatPVS (vec3_t org, mnode_t *node)
|
||||||
byte *pvs;
|
byte *pvs;
|
||||||
int i;
|
int i;
|
||||||
float d;
|
float d;
|
||||||
mplane_t *plane;
|
plane_t *plane;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
// if this is a leaf, accumulate the pvs bits
|
// if this is a leaf, accumulate the pvs bits
|
||||||
|
|
|
@ -136,7 +136,7 @@ typedef struct {
|
||||||
|
|
||||||
static hull_t box_hull;
|
static hull_t box_hull;
|
||||||
static mclipnode_t box_clipnodes[6];
|
static mclipnode_t box_clipnodes[6];
|
||||||
static mplane_t box_planes[6];
|
static plane_t box_planes[6];
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -146,7 +146,7 @@ static mplane_t box_planes[6];
|
||||||
can just be stored out and get a proper hull_t structure.
|
can just be stored out and get a proper hull_t structure.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
SV_InitHull (hull_t *hull, mclipnode_t *clipnodes, mplane_t *planes)
|
SV_InitHull (hull_t *hull, mclipnode_t *clipnodes, plane_t *planes)
|
||||||
{
|
{
|
||||||
int side, i;
|
int side, i;
|
||||||
|
|
||||||
|
@ -412,7 +412,7 @@ SV_FindTouchedLeafs (edict_t *ent, mnode_t *node)
|
||||||
{
|
{
|
||||||
int sides;
|
int sides;
|
||||||
mleaf_t *leaf;
|
mleaf_t *leaf;
|
||||||
mplane_t *splitplane;
|
plane_t *splitplane;
|
||||||
edict_leaf_t *edict_leaf;
|
edict_leaf_t *edict_leaf;
|
||||||
|
|
||||||
if (node->contents == CONTENTS_SOLID)
|
if (node->contents == CONTENTS_SOLID)
|
||||||
|
@ -531,7 +531,7 @@ SV_HullPointContents (hull_t *hull, int num, const vec3_t p)
|
||||||
{
|
{
|
||||||
float d;
|
float d;
|
||||||
mclipnode_t *node;
|
mclipnode_t *node;
|
||||||
mplane_t *plane;
|
plane_t *plane;
|
||||||
|
|
||||||
while (num >= 0) {
|
while (num >= 0) {
|
||||||
//if (num < hull->firstclipnode || num > hull->lastclipnode)
|
//if (num < hull->firstclipnode || num > hull->lastclipnode)
|
||||||
|
|
|
@ -34,12 +34,6 @@
|
||||||
*/
|
*/
|
||||||
//@{
|
//@{
|
||||||
|
|
||||||
typedef struct plane_s {
|
|
||||||
vec3_t normal;
|
|
||||||
vec_t dist;
|
|
||||||
int type;
|
|
||||||
} plane_t;
|
|
||||||
|
|
||||||
#define MAX_THREADS 4
|
#define MAX_THREADS 4
|
||||||
|
|
||||||
#define ON_EPSILON 0.05
|
#define ON_EPSILON 0.05
|
||||||
|
|
|
@ -51,11 +51,6 @@ extern pthread_mutex_t *my_mutex;
|
||||||
#define MAX_POINTS_ON_WINDING 64
|
#define MAX_POINTS_ON_WINDING 64
|
||||||
#define MAX_PORTALS_ON_CLUSTER 128
|
#define MAX_PORTALS_ON_CLUSTER 128
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
vec3_t normal;
|
|
||||||
float dist;
|
|
||||||
} plane_t;
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
qboolean original; // don't free, it's part of the portal
|
qboolean original; // don't free, it's part of the portal
|
||||||
int numpoints;
|
int numpoints;
|
||||||
|
|
Loading…
Reference in a new issue