29 #include "../../../idlib/precompiled.h"
77 for (p=node->
portals ; p ; p=nextp)
79 s = (p->
nodes[1] == node);
132 for (i=0 ; i<
depth ; i++)
149 plane[0], plane[1], plane[2], plane[3] );
163 memset( f, 0,
sizeof(*f) );
186 #define BLOCK_SIZE 1024
191 int splits, facing, front, back;
194 int value, bestValue;
206 for (
int axis = 0; axis < 3; axis++ ) {
212 if ( dist > node->
bounds[0][axis] + 1.0f && dist < node->bounds[1][axis] - 1.0f ) {
213 plane[0] = plane[1] = plane[2] = 0.0f;
229 for ( split = list ; split ; split = split->
next ) {
236 for ( split = list ; split ; split = split->
next ) {
240 if ( havePortals != split->
portal ) {
248 for ( check = list ; check ; check = check->
next ) {
263 value = 5*facing - 5*splits;
268 if ( value > bestValue ) {
274 if ( bestValue == -999999 ) {
298 if ( splitPlaneNum == -1 ) {
307 childLists[0] =
NULL;
308 childLists[1] =
NULL;
309 for ( split = list ; split ; split = next ) {
321 if ( frontWinding ) {
323 newFace->
w = frontWinding;
324 newFace->
next = childLists[0];
326 childLists[0] = newFace;
330 newFace->
w = backWinding;
331 newFace->
next = childLists[1];
333 childLists[1] = newFace;
337 split->
next = childLists[0];
338 childLists[0] = split;
340 split->
next = childLists[1];
341 childLists[1] = split;
347 for ( i = 0 ; i < 2 ; i++ ) {
354 for ( i = 0 ; i < 3 ; i++ ) {
362 for ( i = 0 ; i < 2 ; i++ ) {
390 for ( face = list ; face ; face = face->
next ) {
408 common->
Printf(
"%5.1f seconds faceBsp\n", ( end - start ) / 1000.0 );
428 for ( ; list ; list = list->
next ) {
436 for ( i = 0 ; i < b->
numsides ; i++ ) {
472 for ( ; list ; list = list->
next ) {
480 for ( i = 0 ; i < b->
numsides ; i++ ) {
GLsizei const GLfloat * value
void PrintTree_r(node_t *node, int depth)
tree_t * FaceBSP(bspface_t *list)
float Distance(const idVec3 &v) const
void BuildFaceTree_r(node_t *node, bspface_t *list)
int Sys_Milliseconds(void)
int FindFloatPlane(const idPlane &plane, bool *fixedDegeneracies=NULL)
struct uPortal_s * next[2]
GLint GLint GLsizei GLsizei GLsizei depth
void RemovePortalFromNode(uPortal_t *portal, node_t *l)
bspface_t * MakeVisibleBspFaceList(primitive_t *list)
int PlaneSide(const idPlane &plane, const float epsilon=ON_EPSILON) const
const idMaterial * material
bool AddPoint(const idVec3 &v)
void FreeTree_r(node_t *node)
GLuint GLuint GLsizei count
int GetNumPoints(void) const
struct node_s * children[2]
GLubyte GLubyte GLubyte GLubyte w
int SelectSplitPlaneNum(node_t *node, bspface_t *list)
static float Fabs(float f)
struct uPortal_s * portals
const int GetContentFlags(void) const
void FreeTreePortals_r(node_t *node)
virtual void Printf(const char *fmt,...) id_attribute((format(printf
void FreeBspFace(bspface_t *f)
int Split(const idPlane &plane, const float epsilon, idWinding **front, idWinding **back) const
struct primitive_s * next
struct bspbrush_s * original
void FreeBrushList(uBrush_t *brushes)
node_t * NodeForPoint(node_t *node, idVec3 origin)
void FreePortal(uPortal_t *p)
void FreeTree(tree_t *tree)
idWinding * Copy(void) const
#define PLANETYPE_TRUEAXIAL
void * Mem_Alloc(const int size)
bspface_t * AllocBspFace(void)
struct bspbrush_s * brush
dmapGlobals_t dmapGlobals
bspface_t * MakeStructuralBspFaceList(primitive_t *list)