UFO: Alien Invasion
tree.cpp File Reference
#include "bsp.h"
Include dependency graph for tree.cpp:

Go to the source code of this file.

Functions

node_tAllocNode (void)
 
static void FreeTreePortals_r (node_t *node)
 
static void FreeTree_r (node_t *node)
 
tree_tAllocTree (void)
 Allocates a tree and initializes it. More...
 
void FreeTree (tree_t *tree)
 
static void CheckPlaneAgainstParents (uint16_t pnum, const node_t *node)
 
static void LeafNode (node_t *node, bspbrush_t *brushes)
 
static node_tBuildTree_r (node_t *node, bspbrush_t *brushes)
 
tree_tBuildTree (bspbrush_t *brushlist, const vec3_t mins, const vec3_t maxs)
 The incoming list will be freed before exiting. More...
 
static void PruneNodes_r (node_t *node)
 Will cut solid nodes by recursing down the bsp tree. More...
 
void PruneNodes (node_t *node)
 

Variables

int c_nodes
 
int c_nonvis
 
static int c_pruned
 

Function Documentation

◆ AllocNode()

node_t * AllocNode ( void  )
See also
AllocBrush
AllocTree

Definition at line 34 of file tree.cpp.

References Mem_AllocType.

Referenced by BuildTree(), and BuildTree_r().

◆ AllocTree()

tree_t * AllocTree ( void  )

Allocates a tree and initializes it.

Definition at line 92 of file tree.cpp.

References tree_t::aabb, Mem_AllocType, and AABB::setNegativeVolume().

Referenced by BuildTree().

◆ BuildTree()

tree_t * BuildTree ( bspbrush_t brushlist,
const vec3_t  mins,
const vec3_t  maxs 
)

◆ BuildTree_r()

◆ CheckPlaneAgainstParents()

static void CheckPlaneAgainstParents ( uint16_t  pnum,
const node_t node 
)
static

Definition at line 110 of file tree.cpp.

References node_t::parent, node_t::planenum, and Sys_Error().

Referenced by BuildTree_r().

◆ FreeTree()

void FreeTree ( tree_t tree)

Definition at line 102 of file tree.cpp.

References FreeTree_r(), FreeTreePortals_r(), tree_t::headnode, and Mem_Free.

Referenced by ConstructLevelNodes_r(), and ProcessSubModel().

◆ FreeTree_r()

◆ FreeTreePortals_r()

static void FreeTreePortals_r ( node_t node)
static

◆ LeafNode()

static void LeafNode ( node_t node,
bspbrush_t brushes 
)
static

◆ PruneNodes()

void PruneNodes ( node_t node)
See also
PruneNodes_r

Definition at line 261 of file tree.cpp.

References c_pruned, PruneNodes_r(), VERB_EXTRA, and Verb_Printf().

Referenced by ConstructLevelNodes_r().

◆ PruneNodes_r()

static void PruneNodes_r ( node_t node)
static

Will cut solid nodes by recursing down the bsp tree.

See also
PruneNodes
Todo:
free stuff

Definition at line 222 of file tree.cpp.

References node_t::brushlist, c_pruned, node_t::children, node_t::contentFlags, CONTENTS_SOLID, node_t::faces, bspbrush_t::next, node_t::planenum, PLANENUM_LEAF, PruneNodes_r(), and Sys_Error().

Referenced by PruneNodes(), and PruneNodes_r().

Variable Documentation

◆ c_nodes

int c_nodes

Definition at line 27 of file tree.cpp.

Referenced by BuildTree(), BuildTree_r(), and FreeTree_r().

◆ c_nonvis

int c_nonvis

Definition at line 28 of file tree.cpp.

Referenced by BuildTree(), and SelectSplitSide().

◆ c_pruned

int c_pruned
static

Definition at line 216 of file tree.cpp.

Referenced by PruneNodes(), and PruneNodes_r().