quiet down the output

This commit is contained in:
Trammell hudson 2018-03-03 14:21:07 -05:00
parent 8ae1fbf612
commit eae31edb38
Failed to extract signature
3 changed files with 19 additions and 24 deletions

View File

@ -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;
}

View File

@ -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;

32
tri.c
View File

@ -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;
}