X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=lib%2Fgfxpoly%2Fpoly.c;h=26218ab39fe12d0dc5052eec41d98cd1d4c679ef;hp=1ef8618d357bbd46fbbbcfca522704b30796f2f8;hb=ba166d59c4c6672c8cb65c881193bb104c629bf7;hpb=ae9783cbbddf61f59a1d43180be3999206e5b28f diff --git a/lib/gfxpoly/poly.c b/lib/gfxpoly/poly.c index 1ef8618..26218ab 100644 --- a/lib/gfxpoly/poly.c +++ b/lib/gfxpoly/poly.c @@ -67,7 +67,10 @@ typedef struct _status { #endif } status_t; -int compare_events_simple(const void*_a,const void*_b) +/* compare_events_simple differs from compare_events in that it schedules + events from left to right regardless of type. It's only used in horizontal + processing, in order to get an x-wise sorting of the current scanline */ +static int compare_events_simple(const void*_a,const void*_b) { event_t* a = (event_t*)_a; event_t* b = (event_t*)_b; @@ -83,7 +86,7 @@ int compare_events_simple(const void*_a,const void*_b) return 0; } -int compare_events(const void*_a,const void*_b) +static int compare_events(const void*_a,const void*_b) { event_t* a = (event_t*)_a; event_t* b = (event_t*)_b; @@ -300,9 +303,9 @@ void gfxpoly_enqueue(edge_t*list, heap_t*queue, windstate_t initial, int polygon continue; } segment_t*s = segment_new(l->a.x, l->a.y, l->b.x, l->b.y, initial, polygon_nr); +#ifdef DEBUG if(l->tmp) s->nr = l->tmp; -#ifdef DEBUG fprintf(stderr, "[%d] (%d,%d) -> (%d,%d) %s\n", s->nr, s->a.x, s->a.y, s->b.x, s->b.y, s->dir==DIR_UP?"up":"down"); @@ -528,7 +531,9 @@ static void insert_point_into_segment(status_t*status, segment_t*s, point_t p) // omit horizontal lines if(s->pos.y != p.y) { edge_t*e = rfx_calloc(sizeof(edge_t)); +#ifdef DEBUG e->tmp = s->nr; +#endif e->a = s->pos; e->b = p; assert(e->a.y != e->b.y); @@ -543,9 +548,6 @@ static void insert_point_into_segment(status_t*status, segment_t*s, point_t p) s->pos = p; } -/* by restricting the recalculation of line segments to a range between the lowest - and the highest modified segment, we only do about a 33% overprocessing of fill - styles. (update: that statistic might be outdated now that xmin/xmax are double) */ typedef struct _segrange { double xmin; segment_t*segmin; @@ -969,7 +971,6 @@ static void add_horizontals(gfxpoly_t*poly, windrule_t*windrule) actlist_dump(actlist, y-1); #endif #ifdef CHECKS - /* FIXME: this actually fails sometimes */ actlist_verify(actlist, y-1); #endif do {