mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-16 17:51:31 +00:00
Revise setup of solid FOFs
This commit is contained in:
parent
4055aae3b0
commit
61d903cb5b
2 changed files with 55 additions and 45 deletions
|
@ -2813,25 +2813,27 @@ static void P_ConvertBinaryMap(void)
|
|||
else if (lines[i].special == 103)
|
||||
lines[i].args[1] = 1;
|
||||
|
||||
//Tangibility
|
||||
if (lines[i].flags & ML_EFFECT1)
|
||||
lines[i].args[2] |= 8;
|
||||
if (lines[i].flags & ML_EFFECT2)
|
||||
lines[i].args[2] |= 4;
|
||||
|
||||
//Translucency
|
||||
if (lines[i].special == 102)
|
||||
{
|
||||
lines[i].args[2] = (lines[i].flags & ML_NOCLIMB) ? 2 : 1;
|
||||
lines[i].args[3] |= 1;
|
||||
if (lines[i].flags & ML_NOCLIMB)
|
||||
lines[i].args[1] |= 4;
|
||||
if (sides[lines[i].sidenum[0]].toptexture > 0)
|
||||
lines[i].alpha = (sides[lines[i].sidenum[0]].toptexture << FRACBITS)/255;
|
||||
else
|
||||
lines[i].alpha = FRACUNIT/2;
|
||||
}
|
||||
|
||||
//Tangibility
|
||||
if (lines[i].flags & ML_EFFECT1)
|
||||
lines[i].args[3] |= 8;
|
||||
if (lines[i].flags & ML_EFFECT2)
|
||||
lines[i].args[3] |= 4;
|
||||
|
||||
//Shadow?
|
||||
if (lines[i].special != 100 && (lines[i].special != 104 || !(lines[i].flags & ML_NOCLIMB)))
|
||||
lines[i].args[4] = 1;
|
||||
lines[i].args[3] |= 1;
|
||||
|
||||
lines[i].special = 100;
|
||||
break;
|
||||
|
@ -2887,27 +2889,34 @@ static void P_ConvertBinaryMap(void)
|
|||
else if (lines[i].special == 146)
|
||||
lines[i].args[1] = 1;
|
||||
|
||||
//Tangibility
|
||||
if (lines[i].special <= 142)
|
||||
lines[i].args[2] |= 2;
|
||||
else if (lines[i].special <= 145)
|
||||
lines[i].args[2] |= 1;
|
||||
else
|
||||
lines[i].args[2] |= 3;
|
||||
|
||||
if (lines[i].flags & ML_EFFECT1)
|
||||
lines[i].args[2] |= 8;
|
||||
if (lines[i].flags & ML_EFFECT2)
|
||||
lines[i].args[2] |= 4;
|
||||
|
||||
//Translucency
|
||||
if (lines[i].special == 141 || lines[i].special == 142 || lines[i].special == 144 || lines[i].special == 145)
|
||||
{
|
||||
lines[i].args[2] = (lines[i].flags & ML_EFFECT2) ? 2 : 1;
|
||||
lines[i].args[3] |= 1;
|
||||
if (lines[i].flags & ML_NOCLIMB)
|
||||
lines[i].args[1] |= 4;
|
||||
if (sides[lines[i].sidenum[0]].toptexture > 0)
|
||||
lines[i].alpha = (sides[lines[i].sidenum[0]].toptexture << FRACBITS)/255;
|
||||
else
|
||||
lines[i].alpha = FRACUNIT/2;
|
||||
}
|
||||
|
||||
//Tangibility
|
||||
if (lines[i].special <= 142)
|
||||
lines[i].args[3] |= 2;
|
||||
else if (lines[i].special <= 145)
|
||||
lines[i].args[3] |= 1;
|
||||
else
|
||||
lines[i].args[3] |= 3;
|
||||
|
||||
//Shadow?
|
||||
if (lines[i].special != 146 && (lines[i].flags & ML_NOCLIMB))
|
||||
lines[i].args[4] = 1;
|
||||
lines[i].args[3] |= 2;
|
||||
|
||||
lines[i].special = 100;
|
||||
break;
|
||||
|
|
55
src/p_spec.c
55
src/p_spec.c
|
@ -6757,43 +6757,44 @@ void P_SpawnSpecials(boolean fromnetsave)
|
|||
ffloorflags = FF_EXISTS|FF_SOLID|FF_RENDERALL;
|
||||
|
||||
//Visibility settings
|
||||
if (lines[i].args[1] & 1)
|
||||
if (lines[i].args[1] & 1) //Don't render planes
|
||||
ffloorflags &= ~FF_RENDERPLANES;
|
||||
if (lines[i].args[1] & 2)
|
||||
if (lines[i].args[1] & 2) //Don't render sides
|
||||
ffloorflags &= ~FF_RENDERSIDES;
|
||||
|
||||
//Translucency settings are irrelevant for invisible FOFs
|
||||
if (lines[i].args[1] != 3)
|
||||
if (lines[i].args[1] & 4) //Render insides
|
||||
{
|
||||
if (lines[i].args[2] == 0) //Opaque
|
||||
{
|
||||
if (lines[i].args[3] & 7)
|
||||
{
|
||||
//At least partially intangible: You can see it from the inside
|
||||
ffloorflags |= FF_ALLSIDES;
|
||||
//Unless the planes are invisible, render both sides.
|
||||
if (!(lines[i].args[1] & 1))
|
||||
ffloorflags |= FF_BOTHPLANES;
|
||||
}
|
||||
else
|
||||
ffloorflags |= FF_CUTLEVEL;
|
||||
}
|
||||
if (lines[i].args[2] == 1) //Translucent, don't render insides
|
||||
ffloorflags |= FF_TRANSLUCENT|FF_EXTRA|FF_CUTEXTRA;
|
||||
if (lines[i].args[2] == 2) //Translucent, render insides
|
||||
ffloorflags |= FF_TRANSLUCENT|FF_CUTEXTRA|FF_BOTHPLANES|FF_ALLSIDES;
|
||||
if (ffloorflags & FF_RENDERPLANES)
|
||||
ffloorflags |= FF_BOTHPLANES;
|
||||
if (ffloorflags & FF_RENDERSIDES)
|
||||
ffloorflags |= FF_ALLSIDES;
|
||||
}
|
||||
|
||||
if (lines[i].args[3] & 1)
|
||||
//Tangibility settings
|
||||
if (lines[i].args[2] & 1) //Intangible from top
|
||||
ffloorflags |= FF_REVERSEPLATFORM;
|
||||
if (lines[i].args[3] & 2)
|
||||
if (lines[i].args[2] & 2) //Intangible from bottom
|
||||
ffloorflags |= FF_PLATFORM;
|
||||
if (lines[i].args[3] & 4)
|
||||
if (lines[i].args[2] & 4) //Don't block player
|
||||
ffloorflags &= ~FF_BLOCKPLAYER;
|
||||
if (lines[i].args[3] & 8)
|
||||
if (lines[i].args[2] & 8) //Don't block others
|
||||
ffloorflags &= ~FF_BLOCKOTHERS;
|
||||
if (lines[i].args[4])
|
||||
|
||||
//Appearance settings
|
||||
if ((lines[i].args[3] & 1) && (ffloorflags & FF_RENDERALL)) //Translucent
|
||||
ffloorflags |= FF_TRANSLUCENT;
|
||||
if (lines[i].args[3] & 2) //Don't cast shadow
|
||||
ffloorflags |= FF_NOSHADE;
|
||||
|
||||
//Cutting options
|
||||
if (ffloorflags & FF_RENDERALL)
|
||||
{
|
||||
//If translucent or player can enter it, cut inner walls
|
||||
if ((ffloorflags & FF_TRANSLUCENT) || (lines[i].args[2] & 7))
|
||||
ffloorflags |= FF_CUTEXTRA|FF_EXTRA;
|
||||
else
|
||||
ffloorflags |= FF_CUTLEVEL;
|
||||
}
|
||||
|
||||
P_AddFakeFloorsByLine(i, ffloorflags, secthinkers);
|
||||
break;
|
||||
|
||||
|
|
Loading…
Reference in a new issue