From eae31edb38afaa5a765d6ffebd4468d2ed1a468d Mon Sep 17 00:00:00 2001 From: Trammell hudson Date: Sat, 3 Mar 2018 14:21:07 -0500 Subject: [PATCH] quiet down the output --- camera.c | 2 -- hiddenwire.c | 9 +++------ tri.c | 32 ++++++++++++++++---------------- 3 files changed, 19 insertions(+), 24 deletions(-) diff --git a/camera.c b/camera.c index 0e17873..5b779b2 100644 --- a/camera.c +++ b/camera.c @@ -158,7 +158,5 @@ camera_project( v_out->p[1] = p.p[1]; v_out->p[2] = p.p[2]; - v3_print(*v_out); - return 1; } diff --git a/hiddenwire.c b/hiddenwire.c index 35c36b0..a28e3d4 100644 --- a/hiddenwire.c +++ b/hiddenwire.c @@ -319,16 +319,13 @@ int main( } // if it has any off-screen coords, reject it -/* if (!onscreen(&tri->p[0], width, height) || !onscreen(&tri->p[1], width, height) || !onscreen(&tri->p[2], width, height)) { -tri_print(tri); offscreen++; goto reject; } -*/ // prune the small triangles in the screen space if (tri_area_2d(tri) < prune) @@ -357,6 +354,8 @@ reject: reject_early: continue; } + + if (debug > 3) for(tri_t * t = zlist ; t ; t = t->next) tri_print(t); @@ -366,7 +365,6 @@ reject_early: // drop any triangles that are totally occluded by another // triangle. this reduces the amount of work for later rejected = 0; -#if 0 for(tri_t * t = zlist ; t ; t = t->next) { tri_t * t2_next; @@ -387,7 +385,6 @@ reject_early: } if (debug) fprintf(stderr, "Rejected %d fully occluded triangles\n", rejected); -#endif // generate a list of segments, dropping any coplanar ones @@ -446,7 +443,7 @@ reject_early: int processed = 0; while(slist) { - if (debug && ++processed % 1 == 0) + if (debug && ++processed % 1000 == 0) fprintf(stderr, "Hidden %d\n", processed); seg_t * s = slist; diff --git a/tri.c b/tri.c index 0d8cd6e..d721182 100644 --- a/tri.c +++ b/tri.c @@ -361,8 +361,6 @@ if(0) fprintf(stderr, "collision: %.0f,%.0f,%.0f->%.0f,%.0f,%.0f %.0f,%.0f,%.0f- } -#if 0 - /* * Fast check to see if t2 is entire occluded by t. */ @@ -405,7 +403,6 @@ tri_behind( // they are all on the same side return 0; } -#endif @@ -657,8 +654,11 @@ tri_seg_intersect( s->p[1] = is[1]; } -fprintf(stderr, "SPLIT: "); -seg_print(*new_seg); + if (tri_debug > 3) + { + fprintf(stderr, "SPLIT: "); + seg_print(*new_seg); + } return tri_split; } @@ -671,15 +671,16 @@ tri_seg_hidden( ) { int count = 0; - fprintf(stderr, "TEST: "); - seg_print(s); + if (tri_debug > 2) + { + fprintf(stderr, "TEST: "); + seg_print(s); + } for( const tri_t * t = zlist ; t ; t = t->next ) { seg_t * new_seg = NULL; - //tri_print(t); tri_intersect_t type = tri_seg_intersect(t, s, &new_seg); - //fprintf(stderr, "rc=%d\n", type); // if there is no intersection or if the segment has // been clipped on one side, keep looking @@ -687,8 +688,7 @@ tri_seg_hidden( continue; if (type == tri_clipped) { - //fprintf(stderr, "CLIP: "); - seg_print(s); + //seg_print(s); continue; } @@ -707,11 +707,11 @@ tri_seg_hidden( if (type == tri_split) { static int recursive; - if (tri_debug > 4) fprintf(stderr, "RECURSIVE %d\n", recursive++); - int new_count = tri_seg_hidden(t->next, new_seg, slist_visible); - if (tri_debug > 4) fprintf(stderr, "END %d: %d segments\n", --recursive, new_count); - if (tri_debug > 4) fprintf(stderr, "CLIP: "); - if (tri_debug > 4) seg_print(s); + int new_count = tri_seg_hidden( + t->next, + new_seg, + slist_visible + ); count += new_count; continue; }