50 for (p = node->
portals; p; p = nextp) {
51 const int s = (p->
nodes[1] == node);
74 for (f = node->
faces; f; f = nextf) {
122 node->
side =
nullptr;
155 node->
side = bestside;
162 for (i = 0; i < 2; i++) {
172 for (i = 0; i < 2; i++) {
234 Sys_Error(
"node->faces seperating CONTENTS_SOLID");
243 Sys_Error(
"PruneNodes: node->brushlist");
void setNegativeVolume()
Sets mins and maxs to their starting points before using addPoint.
void Sys_Error(const char *error,...)
tree_t * BuildTree(bspbrush_t *brushlist, const vec3_t mins, const vec3_t maxs)
The incoming list will be freed before exiting.
void SplitBrushList(bspbrush_t *brushes, uint16_t planenum, bspbrush_t **front, bspbrush_t **back)
bspbrush_t * BrushFromBounds(const vec3_t mins, const vec3_t maxs)
Creates a new axial brush.
static void LeafNode(node_t *node, bspbrush_t *brushes)
static node_t * BuildTree_r(node_t *node, bspbrush_t *brushes)
struct portal_s * next[2]
void FreePortal(portal_t *p)
void FreeBrushList(bspbrush_t *brushes)
static void FreeTreePortals_r(node_t *node)
void BrushlistCalcStats(bspbrush_t *brushlist, AABB &blBox)
Counts the faces and calculate the aabb.
uint32_t BrushListCalcContents(bspbrush_t *brushlist)
Collects the contentsflags of the brushes in the given list.
side_t * SelectSplitSide(bspbrush_t *brushes, bspbrush_t *volume)
Using a heuristic, choses one of the sides out of the brushlist to partition the brushes with...
void add(const vec3_t point)
If the point is outside the box, expand the box to accommodate it.
static void CheckPlaneAgainstParents(uint16_t pnum, const node_t *node)
struct node_s * children[2]
void FreeBrush(bspbrush_t *brushes)
tree_t * AllocTree(void)
Allocates a tree and initializes it.
struct portal_s * portals
void SplitBrush(const bspbrush_t *brush, uint16_t planenum, bspbrush_t **front, bspbrush_t **back)
Generates two new brushes, leaving the original unchanged.
void RemovePortalFromNode(portal_t *portal, node_t *l)
Removes references to the given portal from the given node.
void PruneNodes(node_t *node)
static void FreeTree_r(node_t *node)
void FreeTree(tree_t *tree)
#define Mem_AllocType(type)
static void PruneNodes_r(node_t *node)
Will cut solid nodes by recursing down the bsp tree.