From: John Tsiombikas Date: Sat, 1 Oct 2016 12:27:47 +0000 (+0300) Subject: polyfill debugging mode X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=commitdiff_plain;h=9bdd6ddccd850f8a7dd2942c0b7088b77f41af0e polyfill debugging mode --- diff --git a/src/polyfill.c b/src/polyfill.c index 215cd78..3608b33 100644 --- a/src/polyfill.c +++ b/src/polyfill.c @@ -46,7 +46,7 @@ void polyfill_wire(struct pvertex *verts, int nverts) } } -#define NEXTIDX(x) ((x) ? (x) - 1 : nverts - 1) +#define NEXTIDX(x) (((x) - 1 + nverts) % nverts) #define PREVIDX(x) (((x) + 1) % nverts) #define CALC_EDGE(which) \ @@ -116,7 +116,7 @@ void polyfill_flat(struct pvertex *pv, int nverts) pixptr = (uint16_t*)fb_pixels + sline * fb_width + x; for(i=0; i