- edge_t* s = poly->edges;
- dict_t*d = dict_new2(&point_type);
- while(s) {
- if(!dict_contains(d, &s->a)) {
- dict_put(d, &s->a, (void*)(ptroff_t)1);
- } else {
- int count = (ptroff_t)dict_lookup(d, &s->a);
- dict_del(d, &s->a);
- count++;
- dict_put(d, &s->a, (void*)(ptroff_t)count);
- }
- if(!dict_contains(d, &s->b)) {
- dict_put(d, &s->b, (void*)(ptroff_t)1);
- } else {
- int count = (ptroff_t)dict_lookup(d, &s->b);
- dict_del(d, &s->b);
- count++;
- dict_put(d, &s->b, (void*)(ptroff_t)count);
- }
- s = s->next;
- }
- DICT_ITERATE_ITEMS(d, point_t*, p, void*, c) {
- int count = (ptroff_t)c;
- if(count&1) {
- fprintf(stderr, "Point (%f,%f) occurs %d times\n", p->x*poly->gridsize, p->y*poly->gridsize, count);
- dict_destroy(d);
- return 0;
- }
- }
- dict_destroy(d);
- return 1;
-}
-
-char gfxcompactpoly_check(gfxcompactpoly_t*poly)
-{