diff --git a/source/src/editing.cpp b/source/src/editing.cpp index a96a4b10..877bebab 100644 --- a/source/src/editing.cpp +++ b/source/src/editing.cpp @@ -162,7 +162,7 @@ VAR(tagnumfull, 0, 0, 100); VAR(taglife, 1, 30, 1000); // and have mercy with old graphics cards... -vector tagclipcubes; +vector tagclipcubes; bool showtagclipfocus = false; COMMANDF(showtagclipfocus, "d", (bool on) { showtagclipfocus = on; } ); VAR(showtagclips, 0, 1, 1); @@ -258,7 +258,7 @@ void cursorupdate() // called every frame fr const int xo[] = { 0, 0, 1, 1, 0 }, yo[] = {0, 1, 1, 0, 0 }; loopv(tagclipcubes) // all non-solid & have clips { - int x = tagclipcubes[i++]; int y = tagclipcubes[i]; + int x = tagclipcubes[i] & 0xFFFF, y = tagclipcubes[i] >> 16; ASSERT(!OUTBORD(x, y)); sqr *s = S(x,y), *o[9]; if(s->tag & TAGCLIP) linestyle(tagcliplinewidth, 0xFF, 0xFF, 0); // yello @@ -274,8 +274,8 @@ void cursorupdate() // called every frame fr bool clipped[9]; loopj(9) clipped[j] = !SOLID(o[j]) && (o[j]->tag & TAGANYCLIP) > 0; int h = s->floor - (s->type == FHF ? (s->vdelta + 3) / 4 : 0), c = s->ceil + (s->type == CHF ? (s->vdelta + 3) / 4 : 0); - loopk(4) if((!clipped[k] && !clipped[k+1]) || (clipped[k] && clipped[k+1] && !clipped[k + 5])) line(x + xo[k+1], y + yo[k+1], h, x + xo[k+1], y + yo[k+1], c); - for( ; h <= c; h++) + loopk(4) if((clipped[k] == clipped[k+1]) && !(clipped[k] && clipped[k + 5])) line(x + xo[k+1], y + yo[k+1], h, x + xo[k+1], y + yo[k+1], c); + for( ; h < c; h++) { int k = (h + x + y) & 3; if(k < 2 && !clipped[k]) line(x + xo[k], y + yo[k], h + 1, x + xo[k+1], y + yo[k+1], h); diff --git a/source/src/rendergl.cpp b/source/src/rendergl.cpp index 9df7f366..06b928fe 100644 --- a/source/src/rendergl.cpp +++ b/source/src/rendergl.cpp @@ -1125,7 +1125,7 @@ void gl_drawframe(int w, int h, float changelod, float curfps) glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); disablepolygonoffset(GL_POLYGON_OFFSET_LINE, false); } - extern vector tagclipcubes; + extern vector tagclipcubes; tagclipcubes.setsize(0); extern vector verts; diff --git a/source/src/worldrender.cpp b/source/src/worldrender.cpp index 99e4b996..fb149502 100644 --- a/source/src/worldrender.cpp +++ b/source/src/worldrender.cpp @@ -253,24 +253,24 @@ void render_seg_new(float vx, float vy, float vh, int mip, int x, int y, int xs, } }} - extern vector tagclipcubes; + extern vector tagclipcubes; extern bool showtagclipfocus; extern int showtagclips; if(editmode && !showtagclipfocus && showtagclips) LOOPH continue; // tag clips - loopi(1<tag & TAGANYCLIP) + t = tt; + for(int ix = ix1; ix < ix2; ix++, t++) { - tagclipcubes.add(ix); - tagclipcubes.add(iy); + if(t->tag & TAGANYCLIP && t->type != SOLID) tagclipcubes.add(ix + (iy << 16)); } } } + else if(s->tag & TAGANYCLIP && s->type != SOLID) tagclipcubes.add(xx + (yy << 16)); }} }