mirror of
https://github.com/UberGames/GtkRadiant.git
synced 2024-11-24 21:01:24 +00:00
Adding winding_logging.patch to disappearing_sliver regression test that
helps log the vertex coords. git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@372 8a3a26a2-13c4-0310-b231-cf6edde360e5
This commit is contained in:
parent
c5449b8cc5
commit
538e4a59fc
2 changed files with 88 additions and 3 deletions
|
@ -103,9 +103,7 @@ ChopWindingInPlace() calls in the above stack trace:
|
|||
(87.989571 -891.969116 -768.174316)
|
||||
(133.998917 -1014.997314 0.000000)
|
||||
|
||||
(If you want to print this out for yourself, print out the coordinates of the
|
||||
winding_t "w" parameter right after the ChopWindingInPlace() call in
|
||||
CreateBrushWindings() in brush.c.)
|
||||
(If you want to print this out for yourself, use winding_logging.patch.)
|
||||
|
||||
The same vertices after the bugfix have the following coordinates:
|
||||
|
||||
|
|
|
@ -0,0 +1,87 @@
|
|||
Index: tools/quake3/q3map2/brush.c
|
||||
===================================================================
|
||||
--- tools/quake3/q3map2/brush.c (revision 371)
|
||||
+++ tools/quake3/q3map2/brush.c (working copy)
|
||||
@@ -356,17 +356,29 @@
|
||||
winding_t *w;
|
||||
side_t *side;
|
||||
plane_t *plane;
|
||||
+
|
||||
+ static int brushord = -1;
|
||||
+ brushord++;
|
||||
+
|
||||
+ Sys_Printf("In CreateBrushWindings() for brush %i\n", brushord);
|
||||
|
||||
-
|
||||
/* walk the list of brush sides */
|
||||
for( i = 0; i < brush->numsides; i++ )
|
||||
{
|
||||
+ Sys_Printf(" Handling side %i on the brush\n", i);
|
||||
+
|
||||
/* get side and plane */
|
||||
side = &brush->sides[ i ];
|
||||
plane = &mapplanes[ side->planenum ];
|
||||
|
||||
/* make huge winding */
|
||||
w = BaseWindingForPlane( plane->normal, plane->dist );
|
||||
+
|
||||
+ Sys_Printf(" Before clipping we have:\n");
|
||||
+ int z;
|
||||
+ for (z = 0; z < w->numpoints; z++) {
|
||||
+ Sys_Printf(" (%.8f %.8f %.8f)\n", w->p[z][0], w->p[z][1], w->p[z][2]);
|
||||
+ }
|
||||
|
||||
/* walk the list of brush sides */
|
||||
for( j = 0; j < brush->numsides && w != NULL; j++ )
|
||||
@@ -379,6 +391,11 @@
|
||||
continue;
|
||||
plane = &mapplanes[ brush->sides[ j ].planenum ^ 1 ];
|
||||
ChopWindingInPlace( &w, plane->normal, plane->dist, 0 ); // CLIP_EPSILON );
|
||||
+
|
||||
+ Sys_Printf(" After clipping w/ side %i we have:\n", j);
|
||||
+ for (z = 0; z < w->numpoints; z++) {
|
||||
+ Sys_Printf(" (%.8f %.8f %.8f)\n", w->p[z][0], w->p[z][1], w->p[z][2]);
|
||||
+ }
|
||||
|
||||
/* ydnar: fix broken windings that would generate trifans */
|
||||
FixWinding( w );
|
||||
Index: tools/quake3/q3map2/map.c
|
||||
===================================================================
|
||||
--- tools/quake3/q3map2/map.c (revision 371)
|
||||
+++ tools/quake3/q3map2/map.c (working copy)
|
||||
@@ -803,7 +803,11 @@
|
||||
char shader[ MAX_QPATH ];
|
||||
int flags;
|
||||
|
||||
+ static int brushord = -1;
|
||||
+ brushord++;
|
||||
|
||||
+ Sys_Printf("In ParseRawBrush() for brush %i\n", brushord);
|
||||
+
|
||||
/* initial setup */
|
||||
buildBrush->numsides = 0;
|
||||
buildBrush->detail = qfalse;
|
||||
@@ -812,9 +816,12 @@
|
||||
if( g_bBrushPrimit == BPRIMIT_NEWBRUSHES )
|
||||
MatchToken( "{" );
|
||||
|
||||
+ int sideord = -1;
|
||||
+
|
||||
/* parse sides */
|
||||
while( 1 )
|
||||
{
|
||||
+ sideord++;
|
||||
if( !GetToken( qtrue ) )
|
||||
break;
|
||||
if( !strcmp( token, "}" ) )
|
||||
@@ -917,6 +924,10 @@
|
||||
}
|
||||
|
||||
/* find the plane number */
|
||||
+ Sys_Printf(" Side %i:\n", sideord);
|
||||
+ Sys_Printf(" (%f %f %f)\n", planePoints[0][0], planePoints[0][1], planePoints[0][2]);
|
||||
+ Sys_Printf(" (%f %f %f)\n", planePoints[1][0], planePoints[1][1], planePoints[1][2]);
|
||||
+ Sys_Printf(" (%f %f %f)\n", planePoints[2][0], planePoints[2][1], planePoints[2][2]);
|
||||
planenum = MapPlaneFromPoints( planePoints );
|
||||
side->planenum = planenum;
|
||||
|
Loading…
Reference in a new issue