int winding = 0;
for(i=0; i<nverts; i++) {
int next = NEXTIDX(i);
- winding += (pv[next].x - pv[i].x) * (pv[next].y + pv[i].y);
+ winding += ((pv[next].x - pv[i].x) >> 4) * ((pv[next].y + pv[i].y) >> 4);
}
/* +1 to avoid crashing due to off-by-one rounding errors in the rasterization */
uint32_t res, tmp;
if(winding < 0) {
+ // clockwise
edge = y0 > y1 ? left : right;
} else {
+ // counter-clockwise
edge = y0 > y1 ? right : left;
}
res = SCANEDGE(pv + i, pv + next, edge);