From 093022b3ec12dd86a913dea6dd40cc613e02ecd4 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Fri, 7 Sep 2018 17:28:40 +0200 Subject: [PATCH] more elegant tinf handling --- polygons.cpp | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/polygons.cpp b/polygons.cpp index f4fc53c9..2bd4af42 100644 --- a/polygons.cpp +++ b/polygons.cpp @@ -965,29 +965,22 @@ void dqi_poly::draw() { return; } glLineWidth(linewidthat(tC0(V), linewidth, flags)); - if(tinf && offset && !nofill) { + dqi_poly npoly = (*this); + npoly.V = Id; + npoly.tab = &glcoords; + npoly.offset = 0; + npoly.cnt = isize(glcoords); + if(nofill) npoly.color = 0, npoly.tinf = NULL; + npoly.flags = poly_flags; + if(npoly.tinf && offset) { vector tv; for(int i=0; itvertices[offset+i]); swap(tinf->tvertices, tv); - dqi_poly npoly = (*this); - npoly.V = Id; - npoly.tab = &glcoords; - npoly.offset = 0; - npoly.cnt = isize(glcoords); - npoly.flags = poly_flags; npoly.gldraw(); swap(tinf->tvertices, tv); } else { - dqi_poly npoly = (*this); - npoly.V = Id; - npoly.tab = &glcoords; - npoly.offset = 0; - npoly.cnt = isize(glcoords); - npoly.flags = poly_flags; - npoly.gldraw(); - if(nofill) npoly.color = 0, npoly.tinf = NULL; npoly.gldraw(); } continue;