X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fgfxpoly%2Ftest.c;h=b9062f5b8aab0bd25410662abf9af4cf4c1256b1;hb=002f2ed7c404339e11d669aa86ec998d8dd473a5;hp=e8c140c48d339312c7b6361997085bc66356e7fd;hpb=f5626be739a1e1b61f89d7a389be3c4b5d4d9128;p=swftools.git diff --git a/lib/gfxpoly/test.c b/lib/gfxpoly/test.c index e8c140c..b9062f5 100644 --- a/lib/gfxpoly/test.c +++ b/lib/gfxpoly/test.c @@ -1,10 +1,12 @@ #include #include +#include #include #include #include "../gfxtools.h" #include "poly.h" #include "convert.h" +#include "renderpoly.h" gfxline_t*mkstar(int x1, int y1, int x2, int y2) { @@ -44,55 +46,85 @@ int test1() matrix.m01=-sin(ua);matrix.m11=cos(ua); gfxline_transform(b, &matrix); - gfxpoly_t*poly = gfxpoly_fillToPoly(b); + gfxpoly_t*poly = gfxpoly_fillToPoly(b, 0.05); gfxline_free(box1); gfxline_free(box2); gfxline_free(box3); gfxline_free(star); gfxpoly_dump(poly); - gfxpoly_process(poly); + gfxpoly_process(poly, &windrule_evenodd); } -int test2() +int test_square(int width, int height, int num, double gridsize, char bitmaptest) { -#define N 50 -#define RANGE 150 int t; - gfxline_t* line = malloc(sizeof(gfxline_t)*N); - for(t=0;tedges; while(e) { - swf_ShapeSetMove(tag, s, e->a.x*20, e->a.y*20); - swf_ShapeSetLine(tag, s, e->b.x*20 - e->a.x*20, e->b.y*20 - e->a.y*20); + swf_ShapeSetMove(tag, s, e->a.x, e->a.y); + swf_ShapeSetLine(tag, s, e->b.x - e->a.x, e->b.y - e->a.y); e = e->next; } +#else + swf_ShapeSetAll(tag,s,0,0,ls,0,0); + edge_t*e = poly2->edges; + while(e) { + swf_ShapeSetMove(tag, s, e->a.x, e->a.y); + swf_ShapeSetLine(tag, s, e->b.x - e->a.x, e->b.y - e->a.y); + + swf_ShapeSetCircle(tag, s, e->a.x, e->a.y, 5*20, 5*20); + swf_ShapeSetCircle(tag, s, e->b.x, e->b.y, 5*20, 5*20); + e = e->next; + } +#endif + swf_ShapeSetEnd(tag); swf_ShapeFree(s);