mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-21 18:01:15 +00:00
[mode] Go back to using dclipnode_t everywhere
It was added only because FitzQuake used it in its pre-bsp2 large-map support. That support has been hidden in bspfile.c for some time now. This doesn't gain much other than having one less type to worry about. Well tested on Conflagrant Rodent (the map that caused the need for mclipnode_t in the first place).
This commit is contained in:
parent
688f17fda3
commit
925300716b
12 changed files with 36 additions and 41 deletions
|
@ -207,13 +207,8 @@ typedef struct mleaf_s {
|
|||
byte ambient_sound_level[NUM_AMBIENTS];
|
||||
} mleaf_t;
|
||||
|
||||
typedef struct mclipnode_s {
|
||||
unsigned planenum;
|
||||
int children[2];
|
||||
} mclipnode_t;
|
||||
|
||||
typedef struct hull_s {
|
||||
mclipnode_t *clipnodes;
|
||||
dclipnode_t *clipnodes;
|
||||
plane_t *planes;
|
||||
int firstclipnode;
|
||||
int lastclipnode;
|
||||
|
@ -256,7 +251,7 @@ typedef struct mod_brush_s {
|
|||
int *surfedges;
|
||||
|
||||
unsigned numclipnodes;
|
||||
mclipnode_t *clipnodes;
|
||||
dclipnode_t *clipnodes;
|
||||
|
||||
unsigned nummarksurfaces;
|
||||
msurface_t **marksurfaces;
|
||||
|
|
|
@ -82,7 +82,7 @@ extern areanode_t sv_areanodes[AREA_NODES];
|
|||
|
||||
void SV_FreeAllEdictLeafs (void);
|
||||
|
||||
void SV_InitHull (hull_t *hull, mclipnode_t *clipnodes, plane_t *planes);
|
||||
void SV_InitHull (hull_t *hull, dclipnode_t *clipnodes, plane_t *planes);
|
||||
|
||||
void SV_ClearWorld (void);
|
||||
// called after the world model has been loaded, before linking any entities
|
||||
|
|
|
@ -818,7 +818,7 @@ static void
|
|||
Mod_LoadClipnodes (model_t *mod, bsp_t *bsp)
|
||||
{
|
||||
dclipnode_t *in;
|
||||
mclipnode_t *out;
|
||||
dclipnode_t *out;
|
||||
hull_t *hull;
|
||||
int count, i;
|
||||
mod_brush_t *brush = &mod->brush;
|
||||
|
@ -891,7 +891,7 @@ Mod_LoadClipnodes (model_t *mod, bsp_t *bsp)
|
|||
static void
|
||||
Mod_MakeHull0 (model_t *mod)
|
||||
{
|
||||
mclipnode_t *out;
|
||||
dclipnode_t *out;
|
||||
hull_t *hull;
|
||||
int count, i, j;
|
||||
mnode_t *in, *child;
|
||||
|
|
|
@ -45,7 +45,7 @@ MOD_Alloc_Hull (int nodes, int planes)
|
|||
int size, i;
|
||||
|
||||
size = sizeof (hull_t);
|
||||
size += sizeof (mclipnode_t) * nodes + sizeof (plane_t) * planes;
|
||||
size += sizeof (dclipnode_t) * nodes + sizeof (plane_t) * planes;
|
||||
size *= MAX_MAP_HULLS;
|
||||
size += sizeof (clip_hull_t);
|
||||
|
||||
|
@ -55,11 +55,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 = (mclipnode_t *) &ch->hulls[i - 1][1];
|
||||
ch->hulls[0]->clipnodes = (dclipnode_t *) &ch->hulls[i - 1][1];
|
||||
ch->hulls[0]->planes = (plane_t *) &ch->hulls[0]->clipnodes[nodes];
|
||||
for (i = 1; i < MAX_MAP_HULLS; i++) {
|
||||
ch->hulls[i]->clipnodes =
|
||||
(mclipnode_t *) &ch->hulls[i - 1]->planes[planes];
|
||||
(dclipnode_t *) &ch->hulls[i - 1]->planes[planes];
|
||||
ch->hulls[i]->planes = (plane_t *) &ch->hulls[i]->clipnodes[nodes];
|
||||
}
|
||||
return ch;
|
||||
|
@ -74,7 +74,7 @@ MOD_Free_Hull (clip_hull_t *ch)
|
|||
static void
|
||||
recurse_clip_tree (hull_t *hull, int num, int depth)
|
||||
{
|
||||
mclipnode_t *node;
|
||||
dclipnode_t *node;
|
||||
|
||||
if (num < 0) {
|
||||
if (depth > hull->depth)
|
||||
|
|
|
@ -111,7 +111,7 @@ add_portal (clipport_t *portal, clipleaf_t *front, clipleaf_t *back)
|
|||
static clipleaf_t *
|
||||
carve_leaf (hull_t *hull, nodeleaf_t *nodeleafs, clipleaf_t *leaf, int num)
|
||||
{
|
||||
mclipnode_t *node;
|
||||
dclipnode_t *node;
|
||||
plane_t *plane;
|
||||
winding_t *winding, *fw, *bw;
|
||||
clipport_t *portal;
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
// |ss\ .
|
||||
// 0 1
|
||||
|
||||
static mclipnode_t clipnodes_simple_wedge[] = {
|
||||
static dclipnode_t clipnodes_simple_wedge[] = {
|
||||
{ 0, { 1, CONTENTS_EMPTY}},
|
||||
{ 1, {CONTENTS_EMPTY, CONTENTS_SOLID}},
|
||||
};
|
||||
|
@ -34,7 +34,7 @@ hull_t hull_simple_wedge = {
|
|||
// sss|sss| |sss
|
||||
// 0 1 2
|
||||
|
||||
static mclipnode_t clipnodes_tpp1[] = {
|
||||
static dclipnode_t clipnodes_tpp1[] = {
|
||||
{ 0, { 1, CONTENTS_SOLID}},
|
||||
{ 1, { 2, CONTENTS_SOLID}},
|
||||
{ 2, {CONTENTS_SOLID, CONTENTS_EMPTY}},
|
||||
|
@ -60,7 +60,7 @@ hull_t hull_tpp1 = {
|
|||
// sss|sss| |sss
|
||||
// 1 0 2
|
||||
|
||||
static mclipnode_t clipnodes_tpp2[] = {
|
||||
static dclipnode_t clipnodes_tpp2[] = {
|
||||
{ 0, { 2, 1}},
|
||||
{ 1, {CONTENTS_SOLID, CONTENTS_SOLID}},
|
||||
{ 2, {CONTENTS_SOLID, CONTENTS_EMPTY}},
|
||||
|
@ -86,7 +86,7 @@ hull_t hull_tpp2 = {
|
|||
// sss| |www|sss
|
||||
// 1 0 2
|
||||
|
||||
static mclipnode_t clipnodes_tppw[] = {
|
||||
static dclipnode_t clipnodes_tppw[] = {
|
||||
{ 0, { 2, 1}},
|
||||
{ 1, {CONTENTS_EMPTY, CONTENTS_SOLID}},
|
||||
{ 2, {CONTENTS_SOLID, CONTENTS_WATER}},
|
||||
|
@ -112,7 +112,7 @@ hull_t hull_tppw = {
|
|||
// |sss
|
||||
// ---+--- 0
|
||||
// ss0,0ss
|
||||
static mclipnode_t clipnodes_step1[] = {
|
||||
static dclipnode_t clipnodes_step1[] = {
|
||||
{ 0, { 1, CONTENTS_SOLID}},
|
||||
{ 1, {CONTENTS_EMPTY, 2}},
|
||||
{ 2, {CONTENTS_SOLID, CONTENTS_EMPTY}},
|
||||
|
@ -139,7 +139,7 @@ hull_t hull_step1 = {
|
|||
// |sss
|
||||
// ---+sss 2
|
||||
// ss0,0ss
|
||||
static mclipnode_t clipnodes_step2[] = {
|
||||
static dclipnode_t clipnodes_step2[] = {
|
||||
{ 0, { 1, 2}},
|
||||
{ 1, {CONTENTS_EMPTY, CONTENTS_SOLID}},
|
||||
{ 2, {CONTENTS_EMPTY, CONTENTS_SOLID}},
|
||||
|
@ -166,7 +166,7 @@ hull_t hull_step2 = {
|
|||
// sss|
|
||||
// sss+--- 1
|
||||
// ss0,0ss
|
||||
static mclipnode_t clipnodes_step3[] = {
|
||||
static dclipnode_t clipnodes_step3[] = {
|
||||
{ 0, { 1, 2}},
|
||||
{ 1, {CONTENTS_EMPTY, CONTENTS_SOLID}},
|
||||
{ 2, {CONTENTS_EMPTY, CONTENTS_SOLID}},
|
||||
|
@ -195,7 +195,7 @@ hull_t hull_step3 = {
|
|||
// |sss
|
||||
// ---+--- 0
|
||||
// ss0,0ss
|
||||
static mclipnode_t clipnodes_covered_step[] = {
|
||||
static dclipnode_t clipnodes_covered_step[] = {
|
||||
{ 0, { 1, CONTENTS_SOLID}},
|
||||
{ 1, { 3, 2}},
|
||||
{ 2, {CONTENTS_SOLID, CONTENTS_EMPTY}},
|
||||
|
@ -225,7 +225,7 @@ hull_t hull_covered_step = {
|
|||
// 0,0+--- 1
|
||||
// /ssss
|
||||
// 2 ssss
|
||||
static mclipnode_t clipnodes_ramp[] = {
|
||||
static dclipnode_t clipnodes_ramp[] = {
|
||||
{ 0, { 1, 2}},
|
||||
{ 1, {CONTENTS_EMPTY, CONTENTS_SOLID}},
|
||||
{ 2, {CONTENTS_EMPTY, CONTENTS_SOLID}},
|
||||
|
@ -254,7 +254,7 @@ hull_t hull_ramp = {
|
|||
// ss|sss|ss
|
||||
// -8 8
|
||||
// looking at plane 0: back of 0 is empty, front of 0 has above hole
|
||||
static mclipnode_t clipnodes_hole[] = {
|
||||
static dclipnode_t clipnodes_hole[] = {
|
||||
{ 0, { 1, CONTENTS_EMPTY}},
|
||||
{ 1, {CONTENTS_SOLID, 2}},
|
||||
{ 2, { 3, CONTENTS_SOLID}},
|
||||
|
@ -284,7 +284,7 @@ hull_t hull_hole = {
|
|||
// |sss|
|
||||
// ---+---+--- 0
|
||||
// ss0,0s8,0ss
|
||||
static mclipnode_t clipnodes_ridge[] = {
|
||||
static dclipnode_t clipnodes_ridge[] = {
|
||||
{ 0, { 1, CONTENTS_SOLID}},
|
||||
{ 1, {CONTENTS_EMPTY, 2}},
|
||||
{ 2, { 3, CONTENTS_EMPTY}},
|
||||
|
@ -320,7 +320,7 @@ hull_t hull_ridge = {
|
|||
// 0 -------.------- -20
|
||||
// sssssssssssssss
|
||||
// sssssssssssssss
|
||||
static mclipnode_t clipnodes_cave[] = {
|
||||
static dclipnode_t clipnodes_cave[] = {
|
||||
{ 0, { 1, CONTENTS_SOLID}},
|
||||
{ 1, { 2, 3}},
|
||||
{ 2, {CONTENTS_SOLID, 4}},
|
||||
|
|
|
@ -5,7 +5,7 @@ static int
|
|||
HullPointContents (hull_t *hull, int num, const vec3_t p)
|
||||
{
|
||||
float d;
|
||||
mclipnode_t *node;
|
||||
dclipnode_t *node;
|
||||
mplane_t *plane;
|
||||
|
||||
while (num >= 0)
|
||||
|
@ -37,7 +37,7 @@ HullPointContents (hull_t *hull, int num, const vec3_t p)
|
|||
static qboolean
|
||||
SV_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f, const vec3_t p1, const vec3_t p2, trace_t *trace)
|
||||
{
|
||||
mclipnode_t *node;
|
||||
dclipnode_t *node;
|
||||
mplane_t *plane;
|
||||
float t1, t2;
|
||||
float frac;
|
||||
|
|
|
@ -94,7 +94,7 @@ MOD_TraceLine (hull_t *hull, int num,
|
|||
int side, empty, solid;
|
||||
tracestack_t *tstack;
|
||||
tracestack_t tracestack[256];
|
||||
mclipnode_t *node;
|
||||
dclipnode_t *node;
|
||||
mplane_t *plane, *split_plane;
|
||||
|
||||
VectorCopy (start_point, start);
|
||||
|
|
|
@ -786,7 +786,7 @@ MOD_TraceLine (hull_t *hull, int num,
|
|||
int side;
|
||||
tracestack_t *tstack;
|
||||
tracestack_t *tracestack;
|
||||
mclipnode_t *node;
|
||||
dclipnode_t *node;
|
||||
plane_t *plane;
|
||||
clipleaf_t *leaf;
|
||||
trace_state_t trace_state;
|
||||
|
@ -927,7 +927,7 @@ MOD_HullContents (hull_t *hull, int num, const vec3_t origin, trace_t *trace)
|
|||
// follow origin down the bsp tree to find the "central" leaf
|
||||
while (num >= 0) {
|
||||
vec_t d;
|
||||
mclipnode_t *node;
|
||||
dclipnode_t *node;
|
||||
plane_t *plane;
|
||||
|
||||
node = hull->clipnodes + num;
|
||||
|
|
|
@ -135,7 +135,7 @@ typedef struct {
|
|||
/* HULL BOXES */
|
||||
|
||||
static hull_t box_hull;
|
||||
static mclipnode_t box_clipnodes[6];
|
||||
static dclipnode_t box_clipnodes[6];
|
||||
static plane_t box_planes[6];
|
||||
|
||||
|
||||
|
@ -146,7 +146,7 @@ static plane_t box_planes[6];
|
|||
can just be stored out and get a proper hull_t structure.
|
||||
*/
|
||||
void
|
||||
SV_InitHull (hull_t *hull, mclipnode_t *clipnodes, plane_t *planes)
|
||||
SV_InitHull (hull_t *hull, dclipnode_t *clipnodes, plane_t *planes)
|
||||
{
|
||||
int side, i;
|
||||
|
||||
|
@ -532,7 +532,7 @@ int
|
|||
SV_HullPointContents (hull_t *hull, int num, const vec3_t p)
|
||||
{
|
||||
float d;
|
||||
mclipnode_t *node;
|
||||
dclipnode_t *node;
|
||||
plane_t *plane;
|
||||
|
||||
while (num >= 0) {
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
#include "world.h"
|
||||
|
||||
static hull_t box_hull;
|
||||
static mclipnode_t box_clipnodes[6];
|
||||
static dclipnode_t box_clipnodes[6];
|
||||
static plane_t box_planes[6];
|
||||
|
||||
|
||||
|
@ -107,7 +107,7 @@ inline int
|
|||
PM_HullPointContents (hull_t *hull, int num, const vec3_t p)
|
||||
{
|
||||
float d;
|
||||
mclipnode_t *node;
|
||||
dclipnode_t *node;
|
||||
plane_t *plane;
|
||||
|
||||
while (num >= 0) {
|
||||
|
@ -132,7 +132,7 @@ PM_PointContents (const vec3_t p)
|
|||
{
|
||||
float d;
|
||||
int num;
|
||||
mclipnode_t *node;
|
||||
dclipnode_t *node;
|
||||
hull_t *hull;
|
||||
plane_t *plane;
|
||||
|
||||
|
|
|
@ -135,7 +135,7 @@ typedef struct {
|
|||
/* HULL BOXES */
|
||||
|
||||
static hull_t box_hull;
|
||||
static mclipnode_t box_clipnodes[6];
|
||||
static dclipnode_t box_clipnodes[6];
|
||||
static plane_t box_planes[6];
|
||||
|
||||
|
||||
|
@ -146,7 +146,7 @@ static plane_t box_planes[6];
|
|||
can just be stored out and get a proper hull_t structure.
|
||||
*/
|
||||
void
|
||||
SV_InitHull (hull_t *hull, mclipnode_t *clipnodes, plane_t *planes)
|
||||
SV_InitHull (hull_t *hull, dclipnode_t *clipnodes, plane_t *planes)
|
||||
{
|
||||
int side, i;
|
||||
|
||||
|
@ -532,7 +532,7 @@ int
|
|||
SV_HullPointContents (hull_t *hull, int num, const vec3_t p)
|
||||
{
|
||||
float d;
|
||||
mclipnode_t *node;
|
||||
dclipnode_t *node;
|
||||
plane_t *plane;
|
||||
|
||||
while (num >= 0) {
|
||||
|
|
Loading…
Reference in a new issue