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");
248 for (b = node->
children[0]->brushlist; b; b = next) {
void FreePortal(portal_t *p)
void RemovePortalFromNode(portal_t *portal, node_t *l)
Removes references to the given portal from the given node.
bspbrush_t * BrushFromBounds(const vec3_t mins, const vec3_t maxs)
Creates a new axial brush.
void FreeBrushList(bspbrush_t *brushes)
void FreeBrush(bspbrush_t *brushes)
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 SplitBrush(const bspbrush_t *brush, uint16_t planenum, bspbrush_t **front, bspbrush_t **back)
Generates two new brushes, leaving the original unchanged.
uint32_t BrushListCalcContents(bspbrush_t *brushlist)
Collects the contentsflags of the brushes in the given list.
void BrushlistCalcStats(bspbrush_t *brushlist, AABB &blBox)
Counts the faces and calculate the aabb.
void SplitBrushList(bspbrush_t *brushes, uint16_t planenum, bspbrush_t **front, bspbrush_t **back)
void setNegativeVolume()
Sets mins and maxs to their starting points before using addPoint.
void add(const vec3_t point)
If the point is outside the box, expand the box to accommodate it.
void Sys_Error(const char *error,...)
#define Mem_AllocType(type)
struct portal_s * portals
struct node_s * children[2]
struct portal_s * next[2]
void FreeTree(tree_t *tree)
static node_t * BuildTree_r(node_t *node, bspbrush_t *brushes)
static void FreeTreePortals_r(node_t *node)
static void FreeTree_r(node_t *node)
static void LeafNode(node_t *node, bspbrush_t *brushes)
tree_t * BuildTree(bspbrush_t *brushlist, const vec3_t mins, const vec3_t maxs)
The incoming list will be freed before exiting.
void PruneNodes(node_t *node)
tree_t * AllocTree(void)
Allocates a tree and initializes it.
static void CheckPlaneAgainstParents(uint16_t pnum, const node_t *node)
static void PruneNodes_r(node_t *node)
Will cut solid nodes by recursing down the bsp tree.