]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - tools/quake3/q3map2/facebsp.c
reduce more diff noise
[xonotic/netradiant.git] / tools / quake3 / q3map2 / facebsp.c
index e35f289206b658ba708fa309d244a84edd1dd4fd..e5390ede45a1fcc32da6a2893b4df1d17674e161 100644 (file)
@@ -77,12 +77,12 @@ void    FreeBspFace( face_t *f ) {
  */
 
 static void SelectSplitPlaneNum( node_t *node, face_t *list, int *splitPlaneNum, int *compileFlags ){
  */
 
 static void SelectSplitPlaneNum( node_t *node, face_t *list, int *splitPlaneNum, int *compileFlags ){
-       face_t      *split;
-       face_t      *check;
-       face_t      *bestSplit;
+       face_t *split;
+       face_t *check;
+       face_t *bestSplit;
        int splits, facing, front, back;
        int side;
        int splits, facing, front, back;
        int side;
-       plane_t     *plane;
+       plane_t *plane;
        int value, bestValue;
        int i;
        vec3_t normal;
        int value, bestValue;
        int i;
        vec3_t normal;
@@ -90,9 +90,6 @@ static void SelectSplitPlaneNum( node_t *node, face_t *list, int *splitPlaneNum,
        int planenum;
        float sizeBias;
 
        int planenum;
        float sizeBias;
 
-       //int frontC,backC,splitsC,facingC;
-
-
        /* ydnar: set some defaults */
        *splitPlaneNum = -1; /* leaf */
        *compileFlags = 0;
        /* ydnar: set some defaults */
        *splitPlaneNum = -1; /* leaf */
        *compileFlags = 0;
@@ -179,10 +176,6 @@ static void SelectSplitPlaneNum( node_t *node, face_t *list, int *splitPlaneNum,
                if ( value > bestValue ) {
                        bestValue = value;
                        bestSplit = split;
                if ( value > bestValue ) {
                        bestValue = value;
                        bestSplit = split;
-                       //frontC=front;
-                       //backC=back;
-                       //splitsC=splits;
-                       //facingC=facing;
                }
        }
 
                }
        }
 
@@ -191,24 +184,10 @@ static void SelectSplitPlaneNum( node_t *node, face_t *list, int *splitPlaneNum,
                return;
        }
 
                return;
        }
 
-       //Sys_FPrintf (SYS_VRB, "F: %d B:%d S:%d FA:%ds\n",frontC,backC,splitsC,facingC );
-
        /* set best split data */
        *splitPlaneNum = bestSplit->planenum;
        *compileFlags = bestSplit->compileFlags;
 
        /* set best split data */
        *splitPlaneNum = bestSplit->planenum;
        *compileFlags = bestSplit->compileFlags;
 
-#if 0
-       if ( bestSplit->compileFlags & C_DETAIL ) {
-               for ( split = list; split; split = split->next )
-                       if ( !( split->compileFlags & C_DETAIL ) ) {
-                               Sys_FPrintf( SYS_ERR, "DON'T DO SUCH SPLITS (1)\n" );
-                       }
-       }
-       if ( ( node->compileFlags & C_DETAIL ) && !( bestSplit->compileFlags & C_DETAIL ) ) {
-               Sys_FPrintf( SYS_ERR, "DON'T DO SUCH SPLITS (2)\n" );
-       }
-#endif
-
        if ( *splitPlaneNum > -1 ) {
                mapplanes[ *splitPlaneNum ].counter++;
        }
        if ( *splitPlaneNum > -1 ) {
                mapplanes[ *splitPlaneNum ].counter++;
        }
@@ -248,9 +227,6 @@ void BuildFaceTree_r( node_t *node, face_t *list ){
        winding_t   *frontWinding, *backWinding;
        int i;
        int splitPlaneNum, compileFlags;
        winding_t   *frontWinding, *backWinding;
        int i;
        int splitPlaneNum, compileFlags;
-#if 0
-       qboolean isstruct = qfalse;
-#endif
 
 
        /* count faces left */
 
 
        /* count faces left */
@@ -286,19 +262,14 @@ void BuildFaceTree_r( node_t *node, face_t *list ){
                        continue;
                }
 
                        continue;
                }
 
-#if 0
-               if ( !( split->compileFlags & C_DETAIL ) ) {
-                       isstruct = 1;
-               }
-#endif
-
                /* determine which side the face falls on */
                side = WindingOnPlaneSide( split->w, plane->normal, plane->dist );
 
                /* switch on side */
                if ( side == SIDE_CROSS ) {
                /* determine which side the face falls on */
                side = WindingOnPlaneSide( split->w, plane->normal, plane->dist );
 
                /* switch on side */
                if ( side == SIDE_CROSS ) {
+                       /* strict; if no winding is left, we have a "virtually identical" plane and don't want to split by it */
                        ClipWindingEpsilonStrict( split->w, plane->normal, plane->dist, CLIP_EPSILON * 2,
                        ClipWindingEpsilonStrict( split->w, plane->normal, plane->dist, CLIP_EPSILON * 2,
-                                                                         &frontWinding, &backWinding ); /* strict; if no winding is left, we have a "virtually identical" plane and don't want to split by it */
+                                                               &frontWinding, &backWinding );
                        if ( frontWinding ) {
                                newFace = AllocBspFace();
                                newFace->w = frontWinding;
                        if ( frontWinding ) {
                                newFace = AllocBspFace();
                                newFace->w = frontWinding;
@@ -351,25 +322,10 @@ void BuildFaceTree_r( node_t *node, face_t *list ){
                }
        }
 
                }
        }
 
-#if 0
-       if ( ( node->compileFlags & C_DETAIL ) && isstruct ) {
-               Sys_FPrintf( SYS_ERR, "I am detail, my child is structural, this is a wtf1\n", node->has_structural_children );
-       }
-#endif
-
        for ( i = 0 ; i < 2 ; i++ ) {
                BuildFaceTree_r( node->children[i], childLists[i] );
                node->has_structural_children |= node->children[i]->has_structural_children;
        }
        for ( i = 0 ; i < 2 ; i++ ) {
                BuildFaceTree_r( node->children[i], childLists[i] );
                node->has_structural_children |= node->children[i]->has_structural_children;
        }
-
-#if 0
-       if ( ( node->compileFlags & C_DETAIL ) && !( node->children[0]->compileFlags & C_DETAIL ) && node->children[0]->planenum != PLANENUM_LEAF ) {
-               Sys_FPrintf( SYS_ERR, "I am detail, my child is structural\n", node->has_structural_children );
-       }
-       if ( ( node->compileFlags & C_DETAIL ) && isstruct ) {
-               Sys_FPrintf( SYS_ERR, "I am detail, my child is structural, this is a wtf2\n", node->has_structural_children );
-       }
-#endif
 }
 
 
 }