- bring formatting in line with GZDoom's version of this function.

This commit is contained in:
Christoph Oelckers 2016-02-14 12:33:47 +01:00
parent a5f6c6c747
commit 993a840630

View file

@ -214,91 +214,92 @@ static void P_Add3DFloor(sector_t* sec, sector_t* sec2, line_t* master, int flag
//==========================================================================
static int P_Set3DFloor(line_t * line, int param, int param2, int alpha)
{
int s,i;
int s, i;
int flags;
int tag=line->args[0];
sector_t * sec = line->frontsector, * ss;
int tag = line->args[0];
sector_t * sec = line->frontsector, *ss;
FSectorTagIterator it(tag);
while ((s = it.Next()) >= 0)
FSectorTagIterator itr(tag);
while ((s = itr.Next()) >= 0)
{
ss=&sectors[s];
ss = &sectors[s];
if (param==0)
if (param == 0)
{
flags=FF_EXISTS|FF_RENDERALL|FF_SOLID|FF_INVERTSECTOR;
flags = FF_EXISTS | FF_RENDERALL | FF_SOLID | FF_INVERTSECTOR;
alpha = 255;
for (i=0;i<sec->linecount;i++)
for (i = 0; i < sec->linecount; i++)
{
line_t * l=sec->lines[i];
line_t * l = sec->lines[i];
if (l->special==Sector_SetContents && l->frontsector==sec)
if (l->special == Sector_SetContents && l->frontsector == sec)
{
alpha=clamp<int>(l->args[1], 0, 100);
alpha = clamp<int>(l->args[1], 0, 100);
if (l->args[2] & 1) flags &= ~FF_SOLID;
if (l->args[2] & 2) flags |= FF_SEETHROUGH;
if (l->args[2] & 4) flags |= FF_SHOOTTHROUGH;
if (l->args[2] & 8) flags |= FF_ADDITIVETRANS;
if (alpha!=100) flags|=FF_TRANSLUCENT;//|FF_BOTHPLANES|FF_ALLSIDES;
if (alpha != 100) flags |= FF_TRANSLUCENT;//|FF_BOTHPLANES|FF_ALLSIDES;
if (l->args[0])
{
// Yes, Vavoom's 3D-floor definitions suck!
// The content list changed in r1783 of Vavoom to be unified
// among all its supported games, so it has now ten different
// values instead of just five.
static DWORD vavoomcolors[]={VC_EMPTY,
static DWORD vavoomcolors[] = { VC_EMPTY,
VC_WATER, VC_LAVA, VC_NUKAGE, VC_SLIME, VC_HELLSLIME,
VC_BLOOD, VC_SLUDGE, VC_HAZARD, VC_BOOMWATER};
flags|=FF_SWIMMABLE|FF_BOTHPLANES|FF_ALLSIDES|FF_FLOOD;
VC_BLOOD, VC_SLUDGE, VC_HAZARD, VC_BOOMWATER };
flags |= FF_SWIMMABLE | FF_BOTHPLANES | FF_ALLSIDES | FF_FLOOD;
l->frontsector->ColorMap =
GetSpecialLights (l->frontsector->ColorMap->Color,
GetSpecialLights(l->frontsector->ColorMap->Color,
vavoomcolors[l->args[0]],
l->frontsector->ColorMap->Desaturate);
}
alpha=(alpha*255)/100;
alpha = (alpha * 255) / 100;
break;
}
}
}
else if (param==4)
else if (param == 4)
{
flags=FF_EXISTS|FF_RENDERPLANES|FF_INVERTPLANES|FF_NOSHADE|FF_FIX;
alpha=255;
flags = FF_EXISTS | FF_RENDERPLANES | FF_INVERTPLANES | FF_NOSHADE | FF_FIX;
if (param2 & 1) flags |= FF_SEETHROUGH; // marker for allowing missing texture checks
alpha = 255;
}
else
{
static const int defflags[]= {0,
static const int defflags[] = { 0,
FF_SOLID,
FF_SWIMMABLE|FF_BOTHPLANES|FF_ALLSIDES|FF_SHOOTTHROUGH|FF_SEETHROUGH,
FF_SHOOTTHROUGH|FF_SEETHROUGH,
FF_SWIMMABLE | FF_BOTHPLANES | FF_ALLSIDES | FF_SHOOTTHROUGH | FF_SEETHROUGH,
FF_SHOOTTHROUGH | FF_SEETHROUGH,
};
flags = defflags[param&3] | FF_EXISTS|FF_RENDERALL;
flags = defflags[param & 3] | FF_EXISTS | FF_RENDERALL;
if (param&4) flags |= FF_ALLSIDES|FF_BOTHPLANES;
if (param&16) flags ^= FF_SEETHROUGH;
if (param&32) flags ^= FF_SHOOTTHROUGH;
if (param & 4) flags |= FF_ALLSIDES | FF_BOTHPLANES;
if (param & 16) flags ^= FF_SEETHROUGH;
if (param & 32) flags ^= FF_SHOOTTHROUGH;
if (param2&1) flags |= FF_NOSHADE;
if (param2&2) flags |= FF_DOUBLESHADOW;
if (param2&4) flags |= FF_FOG;
if (param2&8) flags |= FF_THINFLOOR;
if (param2&16) flags |= FF_UPPERTEXTURE;
if (param2&32) flags |= FF_LOWERTEXTURE;
if (param2&64) flags |= FF_ADDITIVETRANS|FF_TRANSLUCENT;
if (param2 & 1) flags |= FF_NOSHADE;
if (param2 & 2) flags |= FF_DOUBLESHADOW;
if (param2 & 4) flags |= FF_FOG;
if (param2 & 8) flags |= FF_THINFLOOR;
if (param2 & 16) flags |= FF_UPPERTEXTURE;
if (param2 & 32) flags |= FF_LOWERTEXTURE;
if (param2 & 64) flags |= FF_ADDITIVETRANS | FF_TRANSLUCENT;
// if flooding is used the floor must be non-solid and is automatically made shootthrough and seethrough
if ((param2&128) && !(flags & FF_SOLID)) flags |= FF_FLOOD|FF_SEETHROUGH|FF_SHOOTTHROUGH;
if (param2&512) flags |= FF_FADEWALLS;
if ((param2 & 128) && !(flags & FF_SOLID)) flags |= FF_FLOOD | FF_SEETHROUGH | FF_SHOOTTHROUGH;
if (param2 & 512) flags |= FF_FADEWALLS;
if (param2&1024) flags |= FF_RESET;
FTextureID tex = line->sidedef[0]->GetTexture(side_t::top);
if (!tex.Exists() && alpha<255)
if (!tex.Exists() && alpha < 255)
{
alpha = -tex.GetIndex();
}
alpha = clamp(alpha, 0, 255);
if (alpha==0) flags&=~(FF_RENDERALL|FF_BOTHPLANES|FF_ALLSIDES);
else if (alpha!=255) flags|=FF_TRANSLUCENT;
if (alpha == 0) flags &= ~(FF_RENDERALL | FF_BOTHPLANES | FF_ALLSIDES);
else if (alpha != 255) flags |= FF_TRANSLUCENT;
}
P_Add3DFloor(ss, sec, line, flags, alpha);