projects
/
dosdemo
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
e0a94da
)
fixed bug introduced by the last bugfix
author
John Tsiombikas
<nuclear@mutantstargoat.com>
Sat, 15 Sep 2018 17:15:17 +0000
(20:15 +0300)
committer
John Tsiombikas
<nuclear@mutantstargoat.com>
Sat, 15 Sep 2018 17:15:17 +0000
(20:15 +0300)
src/polytmpl.h
patch
|
blob
|
history
diff --git
a/src/polytmpl.h
b/src/polytmpl.h
index
2147666
..
55096ef
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) >> 8) * ((pv[next].y + pv[i].y) >> 8);
+ 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 */
}
/* +1 to avoid crashing due to off-by-one rounding errors in the rasterization */
@@
-143,8
+143,10
@@
void POLYFILL(struct pvertex *pv, int nverts)
uint32_t res, tmp;
if(winding < 0) {
uint32_t res, tmp;
if(winding < 0) {
+ // clockwise
edge = y0 > y1 ? left : right;
} else {
edge = y0 > y1 ? left : right;
} else {
+ // counter-clockwise
edge = y0 > y1 ? right : left;
}
res = SCANEDGE(pv + i, pv + next, edge);
edge = y0 > y1 ? right : left;
}
res = SCANEDGE(pv + i, pv + next, edge);