MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / NewBSPNode

Function NewBSPNode

Descent3/bsp.cpp:134–158  ·  view source on GitHub ↗

Allocates memory for a bspnode Returns pointer to node

Source from the content-addressed store, hash-verified

132// Allocates memory for a bspnode
133// Returns pointer to node
134bspnode *NewBSPNode(void) {
135 bspnode *node;
136
137 if ((node = (bspnode *)mem_malloc(sizeof(bspnode))) == NULL) {
138 return NULL;
139 }
140
141 /* Initialize the node, set its variables to zero */
142
143 node->type = BSP_NODE;
144 node->polylist = NULL;
145 node->num_polys = 0;
146 node->node_facenum = 0;
147 node->node_roomnum = 0;
148 node->node_subnum = 0;
149
150 node->plane.a = 0.0;
151 node->plane.b = 0.0;
152 node->plane.c = 0.0;
153 node->plane.d = 0.0;
154 node->front = NULL;
155 node->back = NULL;
156
157 return node;
158}
159
160// Allocates memory for a polygon
161// Returns pointer to polygon

Callers 4

LoadBSPNodeFunction · 0.85
BuildBSPNodeFunction · 0.85
BuildBSPTreeFunction · 0.85
BuildSingleBSPTreeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected