From a74a73cac1d6df28434065a4a8f132c93e9a8c0a Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Fri, 7 Sep 2018 15:17:48 +0200 Subject: [PATCH] fixed a bug with infront graphics (caused by draw() changing the parameter) --- polygons.cpp | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/polygons.cpp b/polygons.cpp index a6bd053a..377d5b58 100644 --- a/polygons.cpp +++ b/polygons.cpp @@ -960,22 +960,25 @@ void dqi_poly::draw() { for(int i=0; itvertices[offset+i]); swap(tinf->tvertices, tv); - V = Id; - tab = &glcoords; - offset = 0; - cnt = isize(glcoords); - flags = poly_flags; - gldraw(); + 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 { - V = Id; - tab = &glcoords; - offset = 0; - cnt = isize(glcoords); - if(nofill) color = 0, tinf = NULL; - flags = poly_flags; - gldraw(); + 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; }