qbsp: flag when a surface/node is a detail separator

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
This commit is contained in:
Kevin Shanahan 2013-02-22 15:57:47 +10:30
parent 32b94e4843
commit da3aa26ee5
2 changed files with 6 additions and 1 deletions

View File

@ -396,6 +396,7 @@ typedef struct surface_s {
vec3_t mins, maxs;
bool onnode; // true if surface has already been used
// as a splitting node
bool detail_separator; // true if generated by a detail brush
face_t *faces; // links to all faces on either side of the surf
} surface_t;
@ -420,6 +421,7 @@ typedef struct node_s {
int visleafnum; // -1 = solid
int valid; // for flood filling
int occupied; // entity number in leaf for outside filling
bool detail_separator; // for vis portal generation
} node_t;
//=============================================================================

View File

@ -358,8 +358,10 @@ ChoosePlaneFromList(surface_t *surfaces, vec3_t mins, vec3_t maxs)
}
/* If we found a candidate on first pass, don't do a second pass */
if (bestsurface)
if (pass > 0 && bestsurface) {
bestsurface->detail_separator = true;
break;
}
}
return bestsurface;
@ -704,6 +706,7 @@ PartitionSurfaces(surface_t *surfaces, node_t *node)
node->children[0] = AllocMem(NODE, 1, true);
node->children[1] = AllocMem(NODE, 1, true);
node->planenum = split->planenum;
node->detail_separator = split->detail_separator;
splitplane = &map.planes[split->planenum];