TINYGL: Fix off-by-one in TGL_LINE_LOOP/TGL_LINE_STRIP .

Also, draw last line from last point to first instead of first point to
last as the latter leaves an unpainted pixel for some reason.
This commit is contained in:
Vincent Pelletier 2016-07-11 14:48:51 +00:00
parent 98696865df
commit 46fa5eb373

View file

@ -393,10 +393,10 @@ void RasterizationDrawCall::execute(bool restoreState) const {
break;
case TGL_LINE_STRIP:
case TGL_LINE_LOOP:
for(int i = 0; i < cnt; i++) {
for(int i = 0; i < cnt - 1; i++) {
gl_draw_line(c, &c->vertex[i], &c->vertex[i + 1]);
}
gl_draw_line(c, &c->vertex[0], &c->vertex[cnt - 1]);
gl_draw_line(c, &c->vertex[cnt - 1], &c->vertex[0]);
break;
case TGL_TRIANGLES:
for(int i = 0; i < cnt / 3; i++) {