X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fgfxpoly%2Factive.c;h=ae570fd7db6cb0c464489dd601a9ce31a9163865;hb=bdad407fb79c2f7be9f3603694ebdeadc645b52d;hp=e9270e47951196251f2b639dbdfa989da63e4b6f;hpb=ae2bbf404cbdf63152d22f1b0824468d04f8f8ce;p=swftools.git diff --git a/lib/gfxpoly/active.c b/lib/gfxpoly/active.c index e9270e4..ae570fd 100644 --- a/lib/gfxpoly/active.c +++ b/lib/gfxpoly/active.c @@ -1,7 +1,9 @@ #include #include #include +#include "../../config.h" #include "../q.h" +#include "../types.h" #include "active.h" actlist_t* actlist_new() @@ -29,7 +31,7 @@ void actlist_dump(actlist_t*a, int32_t y) } lastx = x; } - fprintf(stderr, "[%d]", s->nr); + fprintf(stderr, "[%d]", (int)s->nr); s = s->right; if(s) fprintf(stderr, " "); else fprintf(stderr, " y=%d\n", y); @@ -98,7 +100,7 @@ segment_t* actlist_find(actlist_t*a, point_t p1, point_t p2) actlist_dump(a, p1.y); segment_t*s = a->list; while(s) { - fprintf(stderr, "[%d] %f/%f (%d,%d) -> (%d,%d)\n", s->nr, + fprintf(stderr, "[%d] %f/%f (%d,%d) -> (%d,%d)\n", SEGNR(s), single_cmp(s,p1), cmp(s,p1,p2), s->a.x, s->a.y, s->b.x, s->b.y); s = s->right; @@ -375,7 +377,7 @@ static void move_to_root(actlist_t*a, segment_t*s) } } -static int actlist_splay(actlist_t*a, point_t p1, point_t p2) +static void actlist_splay(actlist_t*a, point_t p1, point_t p2) { if(!a->list) return; @@ -503,7 +505,11 @@ void actlist_delete(actlist_t*a, segment_t*s) } else if(!a->root->rightchild) { a->root = a->root->leftchild; } else { +#ifdef HAVE_LRAND48 if(lrand48()&1) { +#else + if(((ptroff_t)s)&16) { +#endif // free up root->left->right segment_t*t = a->root->leftchild; while(t->rightchild) {