Create and use mclipnode_t.

I didn't realize this was a critical part of fitzquake's large map
support. This should fix the non-solid brush entities in Conflagrant
Rodent.
This commit is contained in:
Bill Currie 2010-11-29 09:36:21 +09:00
parent 85c693d2b8
commit 8831a109a4
8 changed files with 24 additions and 18 deletions

View file

@ -190,8 +190,13 @@ typedef struct mleaf_s {
byte ambient_sound_level[NUM_AMBIENTS];
} mleaf_t;
typedef struct mclipnode_s {
int planenum;
int children[2];
} mclipnode_t;
typedef struct hull_s {
dclipnode_t *clipnodes;
mclipnode_t *clipnodes;
mplane_t *planes;
int firstclipnode;
int lastclipnode;
@ -376,7 +381,7 @@ typedef struct model_s {
int *surfedges;
int numclipnodes;
dclipnode_t *clipnodes;
mclipnode_t *clipnodes;
int nummarksurfaces;
msurface_t **marksurfaces;

View file

@ -71,7 +71,7 @@ typedef struct areanode_s {
extern areanode_t sv_areanodes[AREA_NODES];
void SV_InitHull (hull_t *hull, dclipnode_t *clipnodes, mplane_t *planes);
void SV_InitHull (hull_t *hull, mclipnode_t *clipnodes, mplane_t *planes);
void SV_ClearWorld (void);
// called after the world model has been loaded, before linking any entities

View file

@ -685,7 +685,8 @@ Mod_LoadLeafs (bsp_t *bsp)
static void
Mod_LoadClipnodes (bsp_t *bsp)
{
dclipnode_t *in, *out;
dclipnode_t *in;
mclipnode_t *out;
hull_t *hull;
int count, i;
@ -756,7 +757,7 @@ Mod_LoadClipnodes (bsp_t *bsp)
static void
Mod_MakeHull0 (void)
{
dclipnode_t *out;
mclipnode_t *out;
hull_t *hull;
int count, i, j;
mnode_t *in, *child;

View file

@ -47,7 +47,7 @@ MOD_Alloc_Hull (int nodes, int planes)
int size, i;
size = sizeof (hull_t);
size += sizeof (dclipnode_t) * nodes + sizeof (mplane_t) * planes;
size += sizeof (mclipnode_t) * nodes + sizeof (mplane_t) * planes;
size *= MAX_MAP_HULLS;
size += sizeof (clip_hull_t);
@ -57,11 +57,11 @@ MOD_Alloc_Hull (int nodes, int planes)
ch->hulls[0] = (hull_t *) &ch[1];
for (i = 1; i < MAX_MAP_HULLS; i++)
ch->hulls[i] = &ch->hulls[i - 1][1];
ch->hulls[0]->clipnodes = (dclipnode_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];
for (i = 1; i < MAX_MAP_HULLS; i++) {
ch->hulls[i]->clipnodes =
(dclipnode_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];
}
return ch;

View file

@ -101,7 +101,7 @@ MOD_TraceLine (hull_t *hull, int num,
int side, empty, solid;
tracestack_t *tstack;
tracestack_t tracestack[256];
dclipnode_t *node;
mclipnode_t *node;
mplane_t *plane, *split_plane;
VectorCopy (start_point, start);

View file

@ -70,7 +70,7 @@ typedef struct {
/* HULL BOXES */
static hull_t box_hull;
static dclipnode_t box_clipnodes[6];
static mclipnode_t box_clipnodes[6];
static mplane_t box_planes[6];
@ -81,7 +81,7 @@ static mplane_t box_planes[6];
can just be stored out and get a proper hull_t structure.
*/
void
SV_InitHull (hull_t *hull, dclipnode_t *clipnodes, mplane_t *planes)
SV_InitHull (hull_t *hull, mclipnode_t *clipnodes, mplane_t *planes)
{
int side, i;
@ -435,7 +435,7 @@ int
SV_HullPointContents (hull_t *hull, int num, const vec3_t p)
{
float d;
dclipnode_t *node;
mclipnode_t *node;
mplane_t *plane;
while (num >= 0) {

View file

@ -48,7 +48,7 @@ static __attribute__ ((used)) const char rcsid[] =
#include "world.h"
static hull_t box_hull;
static dclipnode_t box_clipnodes[6];
static mclipnode_t box_clipnodes[6];
static mplane_t box_planes[6];
@ -108,7 +108,7 @@ inline int
PM_HullPointContents (hull_t *hull, int num, const vec3_t p)
{
float d;
dclipnode_t *node;
mclipnode_t *node;
mplane_t *plane;
while (num >= 0) {
@ -133,7 +133,7 @@ PM_PointContents (const vec3_t p)
{
float d;
int num;
dclipnode_t *node;
mclipnode_t *node;
hull_t *hull;
mplane_t *plane;

View file

@ -70,7 +70,7 @@ typedef struct {
/* HULL BOXES */
static hull_t box_hull;
static dclipnode_t box_clipnodes[6];
static mclipnode_t box_clipnodes[6];
static mplane_t box_planes[6];
@ -81,7 +81,7 @@ static mplane_t box_planes[6];
can just be stored out and get a proper hull_t structure.
*/
void
SV_InitHull (hull_t *hull, dclipnode_t *clipnodes, mplane_t *planes)
SV_InitHull (hull_t *hull, mclipnode_t *clipnodes, mplane_t *planes)
{
int side, i;
@ -423,7 +423,7 @@ int
SV_HullPointContents (hull_t *hull, int num, const vec3_t p)
{
float d;
dclipnode_t *node;
mclipnode_t *node;
mplane_t *plane;
while (num >= 0) {