1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-06-09 01:44:08 +00:00

more elegant tinf handling

This commit is contained in:
Zeno Rogue 2018-09-07 17:28:40 +02:00
parent 04554a436f
commit 093022b3ec

View File

@ -965,29 +965,22 @@ void dqi_poly::draw() {
return; return;
} }
glLineWidth(linewidthat(tC0(V), linewidth, flags)); 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<glvertex> tv; vector<glvertex> tv;
for(int i=0; i<cnt; i++) for(int i=0; i<cnt; i++)
tv.push_back(tinf->tvertices[offset+i]); tv.push_back(tinf->tvertices[offset+i]);
swap(tinf->tvertices, tv); 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(); npoly.gldraw();
swap(tinf->tvertices, tv); swap(tinf->tvertices, tv);
} }
else { 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(); npoly.gldraw();
} }
continue; continue;