X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=lib%2Fgfxpoly%2Fpoly.h;h=6e4c7e40c1a34b6752bb0b5fdf279932d801aa2b;hp=2a76a4c3476fc7403d2a64549215c6b611cf5238;hb=de3641737991ed13571eb947068472cf73001032;hpb=ae7c92fe5721f97e786a8bbe9153eadbf292460d diff --git a/lib/gfxpoly/poly.h b/lib/gfxpoly/poly.h index 2a76a4c..6e4c7e4 100644 --- a/lib/gfxpoly/poly.h +++ b/lib/gfxpoly/poly.h @@ -4,6 +4,9 @@ #include #include "../q.h" +//#define DEBUG +//#define CHECKS + typedef enum {DIR_UP, DIR_DOWN} segment_dir_t; typedef enum {EVENT_CROSS, EVENT_END, EVENT_CORNER, EVENT_START, EVENT_HORIZONTAL} eventtype_t; typedef enum {SLOPE_POSITIVE, SLOPE_NEGATIVE} slope_t; @@ -88,10 +91,13 @@ typedef struct _gfxpoly { edge_t*edges; } gfxpoly_t; +void gfxpoly_fail(char*expr, char*file, int line, const char*function); + gfxpoly_t* gfxpoly_new(double gridsize); 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); typedef struct _event { @@ -101,4 +107,14 @@ typedef struct _event { segment_t*s2; } event_t; +#ifndef CHECKS +#ifdef assert +#undef assert +#endif +#define assert(x) +#else +#define assert(x) ((x)?0:gfxpoly_fail(__STRING(x), __FILE__, __LINE__, __PRETTY_FUNCTION__)) +#endif + + #endif