loop optimizations

also cut some overshooting lines
This commit is contained in:
ac-stef
2014-01-31 00:53:12 +01:00
parent d258b7c186
commit e69a94cdd8
3 changed files with 14 additions and 14 deletions
+9 -9
View File
@@ -253,24 +253,24 @@ void render_seg_new(float vx, float vy, float vh, int mip, int x, int y, int xs,
}
}}
extern vector<short> tagclipcubes;
extern vector<int> tagclipcubes;
extern bool showtagclipfocus;
extern int showtagclips;
if(editmode && !showtagclipfocus && showtagclips) LOOPH continue; // tag clips
loopi(1<<mip)
if(mip)
{
int iy = (yy<<mip) + i;
loopj(1<<mip)
int ix1 = xx<<mip, ix2 = (xx+1)<<mip, iy1 = yy<<mip, iy2 = (yy+1)<<mip;
sqr *tt = S(ix1, iy1), *t;
for(int iy = iy1; iy < iy2; iy++, tt += ssize)
{
int ix = (xx<<mip) + j;
sqr *t = S(ix, iy);
if(!SOLID(t) && t->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));
}}
}