Remove commented out code

This commit is contained in:
Magnus Norddahl 2017-01-09 14:52:50 +01:00
parent bb2806c9ca
commit 4eac238d26
1 changed files with 0 additions and 129 deletions

View File

@ -696,135 +696,6 @@ static bool sv_compare2d(vissprite_t *a, vissprite_t *b)
DVector2(b->deltax, b->deltay).LengthSquared();
}
#if 0
static drawseg_t **drawsegsorter;
static int drawsegsortersize = 0;
// Sort vissprites by leftmost column, left to right
static int sv_comparex (const void *arg1, const void *arg2)
{
return (*(vissprite_t **)arg2)->x1 - (*(vissprite_t **)arg1)->x1;
}
// Sort drawsegs by rightmost column, left to right
static int sd_comparex (const void *arg1, const void *arg2)
{
return (*(drawseg_t **)arg2)->x2 - (*(drawseg_t **)arg1)->x2;
}
// Split up vissprites that intersect drawsegs
void R_SplitVisSprites ()
{
size_t start, stop;
size_t numdrawsegs = ds_p - firstdrawseg;
size_t numsprites;
size_t spr, dseg, dseg2;
if (!r_splitsprites)
return;
if (numdrawsegs == 0 || vissprite_p - firstvissprite == 0)
return;
// Sort drawsegs from left to right
if (numdrawsegs > drawsegsortersize)
{
if (drawsegsorter != NULL)
delete[] drawsegsorter;
drawsegsortersize = numdrawsegs * 2;
drawsegsorter = new drawseg_t *[drawsegsortersize];
}
for (dseg = dseg2 = 0; dseg < numdrawsegs; ++dseg)
{
// Drawsegs that don't clip any sprites don't need to be considered.
if (firstdrawseg[dseg].silhouette)
{
drawsegsorter[dseg2++] = &firstdrawseg[dseg];
}
}
numdrawsegs = dseg2;
if (numdrawsegs == 0)
{
return;
}
qsort (drawsegsorter, numdrawsegs, sizeof(drawseg_t *), sd_comparex);
// Now sort vissprites from left to right, and walk them simultaneously
// with the drawsegs, splitting any that intersect.
start = firstvissprite - vissprites;
int p = 0;
do
{
p++;
R_SortVisSprites (sv_comparex, start);
stop = vissprite_p - vissprites;
numsprites = stop - start;
spr = dseg = 0;
do
{
vissprite_t *vis = spritesorter[spr], *vis2;
// Skip drawsegs until we get to one that doesn't end before the sprite
// begins.
while (dseg < numdrawsegs && drawsegsorter[dseg]->x2 <= vis->x1)
{
dseg++;
}
// Now split the sprite against any drawsegs it intersects
for (dseg2 = dseg; dseg2 < numdrawsegs; dseg2++)
{
drawseg_t *ds = drawsegsorter[dseg2];
if (ds->x1 > vis->x2 || ds->x2 < vis->x1)
continue;
if ((vis->idepth < ds->siz1) != (vis->idepth < ds->siz2))
{ // The drawseg is crossed; find the x where the intersection occurs
int cross = Scale (vis->idepth - ds->siz1, ds->sx2 - ds->sx1, ds->siz2 - ds->siz1) + ds->sx1 + 1;
/* if (cross < ds->x1 || cross > ds->x2)
{ // The original seg is crossed, but the drawseg is not
continue;
}
*/ if (cross <= vis->x1 || cross >= vis->x2)
{ // Don't create 0-sized sprites
continue;
}
vis->bSplitSprite = true;
// Create a new vissprite for the right part of the sprite
vis2 = R_NewVisSprite ();
*vis2 = *vis;
vis2->startfrac += vis2->xiscale * (cross - vis2->x1);
vis->x2 = cross-1;
vis2->x1 = cross;
//vis2->alpha /= 2;
//vis2->RenderStyle = STYLE_Add;
if (vis->idepth < ds->siz1)
{ // Left is in back, right is in front
vis->sector = ds->curline->backsector;
vis2->sector = ds->curline->frontsector;
}
else
{ // Right is in front, left is in back
vis->sector = ds->curline->frontsector;
vis2->sector = ds->curline->backsector;
}
}
}
}
while (dseg < numdrawsegs && ++spr < numsprites);
// Repeat for any new sprites that were added.
}
while (start = stop, stop != vissprite_p - vissprites);
}
#endif
#ifdef __GNUC__
static void swap(vissprite_t *&a, vissprite_t *&b)
{