X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=lib%2Fgfxpoly%2Fpoly.h;h=2ea3ff4b6efdefd755b4690df1415137055913d4;hp=ac1ff376ca0858eab246d11bf96d047b2a99f8d7;hb=f7e9e8a9616f1ecb26776369fda6807cf8821a68;hpb=ae9783cbbddf61f59a1d43180be3999206e5b28f diff --git a/lib/gfxpoly/poly.h b/lib/gfxpoly/poly.h index ac1ff37..2ea3ff4 100644 --- a/lib/gfxpoly/poly.h +++ b/lib/gfxpoly/poly.h @@ -25,7 +25,9 @@ typedef struct _edge { point_t a; point_t b; fillstyle_t*style; +#ifdef DEBUG int tmp; +#endif struct _edge *next; } edge_t; @@ -33,13 +35,18 @@ typedef struct _windstate { char is_filled; int wind_nr; - int num_polygons; } windstate_t; +/* TODO: maybe we should merge windcontext and windrule */ +typedef struct _windcontext +{ + int num_polygons; +} windcontext_t; + typedef struct _windrule { - windstate_t (*start)(int num_polygons); - windstate_t (*add)(windstate_t left, fillstyle_t*edge, segment_dir_t dir, int polygon_nr); + windstate_t (*start)(windcontext_t* num_polygons); + windstate_t (*add)(windcontext_t*context, windstate_t left, fillstyle_t*edge, segment_dir_t dir, int polygon_nr); fillstyle_t* (*diff)(windstate_t*left, windstate_t*right); } windrule_t; @@ -50,12 +57,14 @@ typedef struct _segment { point_t b; point_t delta; double k; //k = a.x*b.y-a.y*b.x = delta.y*a.x - delta.x*a.y (=0 for points on the segment) - int minx, maxx; + int32_t minx, maxx; segment_dir_t dir; fillstyle_t*fs; fillstyle_t*fs_out; +#ifdef CHECKS char fs_out_ok; +#endif int polygon_nr; windstate_t wind; @@ -103,7 +112,7 @@ char gfxpoly_check(gfxpoly_t*poly); int gfxpoly_size(gfxpoly_t*poly); void gfxpoly_dump(gfxpoly_t*poly); gfxpoly_t* gfxpoly_save(gfxpoly_t*poly, const char*filename); -gfxpoly_t* gfxpoly_process(gfxpoly_t*poly, windrule_t*windrule); +gfxpoly_t* gfxpoly_process(gfxpoly_t*poly, windrule_t*windrule, windcontext_t*context); typedef struct _event { eventtype_t type;