- struct pvertex *edge = y0 > y1 ? left : right;
- uint32_t res = SCANEDGE(pv + i, pv + next, edge);
- uint32_t tmp = (res >> 16) & 0xffff;
+ struct pvertex *edge;
+ uint32_t res, tmp;
+
+ if(winding < 0) {
+ edge = y0 > y1 ? left : right;
+ } else {
+ edge = y0 > y1 ? right : left;
+ }
+ res = SCANEDGE(pv + i, pv + next, edge);
+ tmp = (res >> 16) & 0xffff;