- if(l->tmp)
- s->nr = l->tmp;
- fprintf(stderr, "[%d] (%d,%d) -> (%d,%d) %s\n",
- s->nr, s->a.x, s->a.y, s->b.x, s->b.y,
- s->dir==DIR_UP?"up":"down");
+ /*if(l->tmp)
+ s->nr = l->tmp;*/
+ fprintf(stderr, "[%d] (%d,%d) -> (%d,%d) %s (stroke %08x, %d more to come)\n",
+ s->nr, s->a.x, s->a.y, s->b.x, s->b.y,
+ s->dir==DIR_UP?"up":"down", stroke, stroke->num_points - 1 - pos);
+#endif
+ event_t* e = event_new();
+ e->type = s->delta.y ? EVENT_START : EVENT_HORIZONTAL;
+ e->p = s->a;
+ e->s1 = s;
+ e->s2 = 0;
+
+ if(queue) queue_put(queue, e);
+ else hqueue_put(hqueue, e);
+
+ if(e->type != EVENT_HORIZONTAL) {
+ break;
+ }
+ }
+ if(s) {
+ s->stroke = stroke;
+ s->stroke_pos = pos;
+ }
+}
+
+static void gfxpoly_enqueue(gfxpoly_t*p, queue_t*queue, hqueue_t*hqueue, int polygon_nr)
+{
+ int t;
+ gfxpolystroke_t*stroke = p->strokes;
+ for(;stroke;stroke=stroke->next) {
+ assert(stroke->num_points > 1);
+
+#ifdef CHECKS
+ int s;
+ for(s=0;s<stroke->num_points-1;s++) {
+ assert(stroke->points[s].y <= stroke->points[s+1].y);
+ }