mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-11-25 13:21:27 +00:00
- adjustments for recent ZDoom changes.
This commit is contained in:
parent
a602e47261
commit
df6ffe6418
2 changed files with 51 additions and 49 deletions
|
@ -150,9 +150,10 @@ static int LS_Sector_SetPlaneReflection (line_t *ln, AActor *it, bool backSide,
|
|||
int arg0, int arg1, int arg2, int arg3, int arg4)
|
||||
{
|
||||
// Sector_SetPlaneReflection (tag, floor, ceiling)
|
||||
int secnum = -1;
|
||||
int secnum;
|
||||
FSectorTagIterator itr(arg0);
|
||||
|
||||
while ((secnum = P_FindSectorFromTag (arg0, secnum)) >= 0)
|
||||
while ((secnum = itr.Next()) >= 0)
|
||||
{
|
||||
sector_t * s = §ors[secnum];
|
||||
if (s->floorplane.a==0 && s->floorplane.b==0) s->reflect[sector_t::floor] = arg1/255.f;
|
||||
|
|
|
@ -216,90 +216,91 @@ 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;
|
||||
|
||||
for (s=-1; (s = P_FindSectorFromTag(tag,s)) >= 0;)
|
||||
FSectorTagIterator itr(tag);
|
||||
while ((s = itr.Next()) >= 0)
|
||||
{
|
||||
ss=§ors[s];
|
||||
ss = §ors[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;
|
||||
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;
|
||||
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;
|
||||
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);
|
||||
|
|
Loading…
Reference in a new issue