projects
/
dosdemo
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed overdlow when calculating winding of large polygons in the
[dosdemo]
/
src
/
polytmpl.h
diff --git
a/src/polytmpl.h
b/src/polytmpl.h
index
d61ac8e
..
2147666
100644
(file)
--- a/
src/polytmpl.h
+++ b/
src/polytmpl.h
@@
-96,7
+96,7
@@
void POLYFILL(struct pvertex *pv, int nverts)
int winding = 0;
for(i=0; i<nverts; i++) {
int next = NEXTIDX(i);
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) >> 8) * ((pv[next].y + pv[i].y) >> 8);
}
/* +1 to avoid crashing due to off-by-one rounding errors in the rasterization */
}
/* +1 to avoid crashing due to off-by-one rounding errors in the rasterization */