::zerowing-base=422
[divverent/netradiant.git] / regression_tests / q3map2 / disappearing_sliver / winding_logging.patch
1 Index: tools/quake3/q3map2/brush.c
2 ===================================================================
3 --- tools/quake3/q3map2/brush.c (revision 391)
4 +++ tools/quake3/q3map2/brush.c (working copy)
5 @@ -421,10 +421,16 @@
6         side_t          *side;
7         plane_t         *plane;
8         
9 -       
10 +       static  int     brushord = -1;
11 +       brushord++;
12 +
13 +       Sys_Printf("In CreateBrushWindings() for brush %i\n", brushord);        
14 +
15         /* walk the list of brush sides */
16         for( i = 0; i < brush->numsides; i++ )
17         {
18 +               Sys_Printf("    Handling side %i on the brush\n", i);
19 +
20                 /* get side and plane */
21                 side = &brush->sides[ i ];
22                 plane = &mapplanes[ side->planenum ];
23 @@ -435,7 +441,13 @@
24  #else
25                 w = BaseWindingForPlane( plane->normal, plane->dist );
26  #endif
27 -               
28 +
29 +               Sys_Printf("        Before clipping we have:\n");
30 +               int z;
31 +               for (z = 0; z < w->numpoints; z++) {
32 +                       Sys_Printf("            (%.8f %.8f %.8f)\n", w->p[z][0], w->p[z][1], w->p[z][2]);
33 +               }
34 +
35                 /* walk the list of brush sides */
36                 for( j = 0; j < brush->numsides && w != NULL; j++ )
37                 {
38 @@ -451,7 +463,20 @@
39  #else
40                         ChopWindingInPlace( &w, plane->normal, plane->dist, 0 ); // CLIP_EPSILON );
41  #endif
42 -                       
43 +
44 +                       Sys_Printf("        After clipping w/ side %i we have:\n", j);
45 +                       if (w)
46 +                       {
47 +                               for (z = 0; z < w->numpoints; z++)
48 +                               {
49 +                                       Sys_Printf("            (%.8f %.8f %.8f)\n", w->p[z][0], w->p[z][1], w->p[z][2]);
50 +                               }
51 +                       }
52 +                       else
53 +                       {
54 +                               Sys_Printf("            winding is NULL\n");
55 +                       }
56 +
57                         /* ydnar: fix broken windings that would generate trifans */
58  #if EXPERIMENTAL_HIGH_PRECISION_MATH_Q3MAP2_FIXES
59                         FixWindingAccu(w);
60 Index: tools/quake3/q3map2/map.c
61 ===================================================================
62 --- tools/quake3/q3map2/map.c   (revision 391)
63 +++ tools/quake3/q3map2/map.c   (working copy)
64 @@ -803,7 +803,11 @@
65         char                    shader[ MAX_QPATH ];
66         int                             flags;
67         
68 +       static  int     brushord = -1;
69 +       brushord++;
70         
71 +       Sys_Printf("In ParseRawBrush() for brush %i\n", brushord);
72 +
73         /* initial setup */
74         buildBrush->numsides = 0;
75         buildBrush->detail = qfalse;
76 @@ -812,9 +816,12 @@
77         if( g_bBrushPrimit == BPRIMIT_NEWBRUSHES )
78                 MatchToken( "{" );
79         
80 +       int sideord = -1;
81 +
82         /* parse sides */
83         while( 1 )
84         {
85 +               sideord++;
86                 if( !GetToken( qtrue ) )
87                         break;
88                 if( !strcmp( token, "}" ) )
89 @@ -917,7 +924,16 @@
90                 }
91                 
92                 /* find the plane number */
93 +               Sys_Printf("    Side %i:\n", sideord);
94 +               Sys_Printf("        (%f %f %f)\n", planePoints[0][0], planePoints[0][1], planePoints[0][2]);
95 +               Sys_Printf("        (%f %f %f)\n", planePoints[1][0], planePoints[1][1], planePoints[1][2]);
96 +               Sys_Printf("        (%f %f %f)\n", planePoints[2][0], planePoints[2][1], planePoints[2][2]);
97                 planenum = MapPlaneFromPoints( planePoints );
98 +               Sys_Printf("        normal: (%.10f %.10f %.10f)\n",
99 +                               mapplanes[planenum].normal[0],
100 +                               mapplanes[planenum].normal[1],
101 +                               mapplanes[planenum].normal[2]);
102 +               Sys_Printf("        dist: %.10f\n", mapplanes[planenum].dist);
103                 side->planenum = planenum;
104                 
105                 /* bp: get the texture mapping for this texturedef / plane combination */