Convert line specials 100-146.

This commit is contained in:
Nev3r 2020-03-11 10:06:11 +01:00
parent 68f60f3c29
commit b90aa624f5
3 changed files with 241 additions and 175 deletions

View file

@ -2484,6 +2484,91 @@ udmf
} }
} }
fofgeneric
{
title = "FOF (generic)";
100
{
title = "Solid";
prefix = "(100)";
flags8text = "[3] Slope skew sides";
3dfloor = true;
3dfloorflags = "19F";
arg0
{
title = "Sector tag";
type = 13;
}
arg1
{
title = "Visibility";
type = 11;
enum
{
0 = "Fully visible";
1 = "Sides only";
2 = "Planes only";
3 = "Invisible";
}
}
arg2
{
title = "Translucency";
type = 11;
enum
{
0 = "Opaque";
1 = "Translucent, no insides";
2 = "Translucent, insides";
}
}
arg3
{
title = "Tangibility";
type = 12;
enum = "tangibility";
}
arg4
{
title = "Shadow?";
type = 11;
enum = "yesno";
}
}
120
{
title = "Water";
prefix = "(120)";
flags8text = "[3] Slope skew sides";
3dfloor = true;
3dfloorflags = "8F39";
flags643dfloorflagsadd = "20000";
flags5123dfloorflagsadd = "80000000";
flags10243dfloorflagsadd = "40000000";
arg0
{
title = "Sector tag";
type = 13;
}
arg1
{
title = "Flags";
type = 12;
enum
{
1 = "Opaque";
2 = "No sides";
4 = "Separate light level";
8 = "Use target light level";
16 = "No ripple effect";
32 = "Goo physics";
}
}
}
}
slope slope
{ {
title = "Slope"; title = "Slope";

View file

@ -2684,6 +2684,115 @@ static void P_ConvertBinaryMap(void)
{ {
switch (lines[i].special) switch (lines[i].special)
{ {
case 100: //FOF: solid, opaque, shadowcasting
case 101: //FOF: solid, opaque, non-shadowcasting
case 102: //FOF: solid, translucent
case 103: //FOF: solid, sides only
case 104: //FOF: solid, no sides
case 105: //FOF: solid, invisible
lines[i].args[0] = lines[i].tag;
//Visibility
if (lines[i].special == 105)
lines[i].args[1] = 3;
else if (lines[i].special == 104)
lines[i].args[1] = 2;
else if (lines[i].special == 103)
lines[i].args[1] = 1;
else
lines[i].args[1] = 0;
//Translucency
if (lines[i].special == 102)
{
lines[i].args[2] = (lines[i].flags & ML_NOCLIMB) ? 2 : 1;
lines[i].alpha = (sides[lines[i].sidenum[0]].toptexture << FRACBITS) / 255;
}
else
lines[i].args[2] = 0;
//Tangibility
if (lines[i].flags & ML_EFFECT1)
lines[i].args[3] |= 8;
if (lines[i].flags & ML_EFFECT2)
lines[i].args[3] |= 4;
//Shadow?
lines[i].args[4] = (lines[i].special == 100) ? 0 : 1;
lines[i].special = 100;
break;
case 120: //FOF: water, opaque
case 121: //FOF: water, translucent
case 122: //FOF: water, opaque, no sides
case 123: //FOF: water, translucent, no sides
case 124: //FOF: goo water, translucent
case 125: //FOF: goo water, translucent, no sides
lines[i].args[0] = lines[i].tag;
//Opaque?
if (lines[i].special == 120 || lines[i].special == 122)
lines[i].args[1] |= 1;
else
lines[i].alpha = (sides[lines[i].sidenum[0]].toptexture << FRACBITS) / 255;
//No sides?
if (lines[i].special == 122 || lines[i].special == 123 || lines[i].special == 125)
lines[i].args[1] |= 2;
//Flags
if (lines[i].flags & ML_NOCLIMB)
lines[i].args[1] |= 4;
if (lines[i].flags & ML_EFFECT4)
lines[i].args[1] |= 8;
if (!(lines[i].flags & ML_EFFECT5))
lines[i].args[1] |= 16;
//Goo?
if (lines[i].special >= 124)
lines[i].args[1] |= 32;
lines[i].special = 120;
break;
case 140: //FOF: intangible from bottom, opaque
case 141: //FOF: intangible from bottom, translucent
case 142: //FOF: intangible from bottom, translucent, no sides
case 143: //FOF: intangible from top, opaque
case 144: //FOF: intangible from top, translucent
case 145: //FOF: intangible from top, translucent, no sides
case 146: //FOF: only tangible from sides
lines[i].args[0] = lines[i].tag;
//Visibility
if (lines[i].special == 142 || lines[i].special == 145)
lines[i].args[1] = 2;
else if (lines[i].special == 146)
lines[i].args[1] = 1;
else
lines[i].args[1] = 0;
//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].alpha = (sides[lines[i].sidenum[0]].toptexture << FRACBITS) / 255;
}
else
lines[i].args[2] = 0;
//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?
lines[i].args[4] = (lines[i].special != 146 && lines[i].flags & ML_NOCLIMB) ? 1 : 0;
lines[i].special = 100;
break;
case 443: //Call Lua function case 443: //Call Lua function
if (lines[i].text) if (lines[i].text)
{ {

View file

@ -6754,194 +6754,66 @@ void P_SpawnSpecials(boolean fromnetsave)
P_AddPlaneDisplaceThinker(pd_both, P_AproxDistance(lines[i].dx, lines[i].dy)>>8, sides[lines[i].sidenum[0]].sector-sectors, s, !!(lines[i].flags & ML_NOCLIMB)); P_AddPlaneDisplaceThinker(pd_both, P_AproxDistance(lines[i].dx, lines[i].dy)>>8, sides[lines[i].sidenum[0]].sector-sectors, s, !!(lines[i].flags & ML_NOCLIMB));
break; break;
case 100: // FOF (solid, opaque, shadows) case 100: // FOF (solid)
P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_CUTLEVEL, secthinkers); ffloorflags = FF_EXISTS | FF_SOLID;
break; if (lines[i].args[1] == 0)
ffloorflags |= FF_RENDERALL;
case 101: // FOF (solid, opaque, no shadows) if (lines[i].args[1] == 1)
P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_NOSHADE|FF_CUTLEVEL, secthinkers); ffloorflags |= FF_RENDERSIDES;
break; if (lines[i].args[1] == 2)
ffloorflags |= FF_RENDERPLANES;
case 102: // TL block: FOF (solid, translucent) //Translucency settings are irrelevant for invisible FOFs
ffloorflags = FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_NOSHADE|FF_TRANSLUCENT|FF_EXTRA|FF_CUTEXTRA; if (lines[i].args[1] != 3)
// Draw the 'insides' of the block too
if (lines[i].flags & ML_NOCLIMB)
{ {
ffloorflags |= FF_CUTLEVEL|FF_BOTHPLANES|FF_ALLSIDES; if (lines[i].args[2] == 0)
ffloorflags &= ~(FF_EXTRA|FF_CUTEXTRA); {
if (lines[i].args[3] & 3)
{
//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)
ffloorflags |= FF_TRANSLUCENT | FF_EXTRA | FF_CUTEXTRA;
if (lines[i].args[2] == 2)
ffloorflags |= FF_TRANSLUCENT | FF_CUTLEVEL | FF_BOTHPLANES | FF_ALLSIDES;
} }
P_AddFakeFloorsByLine(i, ffloorflags, secthinkers); if (lines[i].args[3] & 1)
break; ffloorflags |= FF_REVERSEPLATFORM;
if (lines[i].args[3] & 2)
case 103: // Solid FOF with no floor/ceiling (quite possibly useless) ffloorflags |= FF_PLATFORM;
P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERSIDES|FF_NOSHADE|FF_CUTLEVEL, secthinkers); if (lines[i].args[3] & 4)
break; ffloorflags &= ~FF_BLOCKPLAYER;
if (lines[i].args[3] & 8)
case 104: // 3D Floor type that doesn't draw sides ffloorflags &= ~FF_BLOCKOTHERS;
// If line has no-climb set, give it shadows, otherwise don't if (lines[i].args[4])
ffloorflags = FF_EXISTS|FF_SOLID|FF_RENDERPLANES|FF_CUTLEVEL;
if (!(lines[i].flags & ML_NOCLIMB))
ffloorflags |= FF_NOSHADE; ffloorflags |= FF_NOSHADE;
P_AddFakeFloorsByLine(i, ffloorflags, secthinkers); P_AddFakeFloorsByLine(i, ffloorflags, secthinkers);
break; break;
case 105: // FOF (solid, invisible) case 120: // FOF (water)
P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_NOSHADE, secthinkers); ffloorflags = FF_EXISTS | FF_RENDERPLANES | FF_SWIMMABLE | FF_BOTHPLANES | FF_CUTEXTRA | FF_EXTRA | FF_CUTSPRITES;
break; if (!(lines[i].args[1] & 1))
ffloorflags |= FF_TRANSLUCENT;
case 120: // Opaque water if (!(lines[i].args[1] & 2))
ffloorflags = FF_EXISTS|FF_RENDERALL|FF_SWIMMABLE|FF_BOTHPLANES|FF_ALLSIDES|FF_CUTEXTRA|FF_EXTRA|FF_CUTSPRITES; ffloorflags |= FF_RENDERSIDES | FF_ALLSIDES;
if (lines[i].flags & ML_NOCLIMB) if (lines[i].args[1] & 4)
ffloorflags |= FF_DOUBLESHADOW; ffloorflags |= FF_DOUBLESHADOW;
if (lines[i].flags & ML_EFFECT4) if (lines[i].args[1] & 8)
ffloorflags |= FF_COLORMAPONLY; ffloorflags |= FF_COLORMAPONLY;
if (lines[i].flags & ML_EFFECT5) if (!(lines[i].args[1] & 16))
ffloorflags |= FF_RIPPLE; ffloorflags |= FF_RIPPLE;
if (lines[i].args[1] & 32)
ffloorflags |= FF_GOOWATER;
P_AddFakeFloorsByLine(i, ffloorflags, secthinkers); P_AddFakeFloorsByLine(i, ffloorflags, secthinkers);
break; break;
case 121: // TL water
ffloorflags = FF_EXISTS|FF_RENDERALL|FF_TRANSLUCENT|FF_SWIMMABLE|FF_BOTHPLANES|FF_ALLSIDES|FF_CUTEXTRA|FF_EXTRA|FF_CUTSPRITES;
if (lines[i].flags & ML_NOCLIMB)
ffloorflags |= FF_DOUBLESHADOW;
if (lines[i].flags & ML_EFFECT4)
ffloorflags |= FF_COLORMAPONLY;
if (lines[i].flags & ML_EFFECT5)
ffloorflags |= FF_RIPPLE;
P_AddFakeFloorsByLine(i, ffloorflags, secthinkers);
break;
case 122: // Opaque water, no sides
ffloorflags = FF_EXISTS|FF_RENDERPLANES|FF_SWIMMABLE|FF_BOTHPLANES|FF_CUTEXTRA|FF_EXTRA|FF_CUTSPRITES;
if (lines[i].flags & ML_NOCLIMB)
ffloorflags |= FF_DOUBLESHADOW;
if (lines[i].flags & ML_EFFECT4)
ffloorflags |= FF_COLORMAPONLY;
if (lines[i].flags & ML_EFFECT5)
ffloorflags |= FF_RIPPLE;
P_AddFakeFloorsByLine(i, ffloorflags, secthinkers);
break;
case 123: // TL water, no sides
ffloorflags = FF_EXISTS|FF_RENDERPLANES|FF_TRANSLUCENT|FF_SWIMMABLE|FF_BOTHPLANES|FF_CUTEXTRA|FF_EXTRA|FF_CUTSPRITES;
if (lines[i].flags & ML_NOCLIMB)
ffloorflags |= FF_DOUBLESHADOW;
if (lines[i].flags & ML_EFFECT4)
ffloorflags |= FF_COLORMAPONLY;
if (lines[i].flags & ML_EFFECT5)
ffloorflags |= FF_RIPPLE;
P_AddFakeFloorsByLine(i, ffloorflags, secthinkers);
break;
case 124: // goo water
ffloorflags = FF_EXISTS|FF_RENDERALL|FF_TRANSLUCENT|FF_SWIMMABLE|FF_GOOWATER|FF_BOTHPLANES|FF_ALLSIDES|FF_CUTEXTRA|FF_EXTRA|FF_CUTSPRITES;
if (lines[i].flags & ML_NOCLIMB)
ffloorflags |= FF_DOUBLESHADOW;
if (lines[i].flags & ML_EFFECT4)
ffloorflags |= FF_COLORMAPONLY;
if (lines[i].flags & ML_EFFECT5)
ffloorflags |= FF_RIPPLE;
P_AddFakeFloorsByLine(i, ffloorflags, secthinkers);
break;
case 125: // goo water, no sides
ffloorflags = FF_EXISTS|FF_RENDERPLANES|FF_TRANSLUCENT|FF_SWIMMABLE|FF_GOOWATER|FF_BOTHPLANES|FF_CUTEXTRA|FF_EXTRA|FF_CUTSPRITES;
if (lines[i].flags & ML_NOCLIMB)
ffloorflags |= FF_DOUBLESHADOW;
if (lines[i].flags & ML_EFFECT4)
ffloorflags |= FF_COLORMAPONLY;
if (lines[i].flags & ML_EFFECT5)
ffloorflags |= FF_RIPPLE;
P_AddFakeFloorsByLine(i, ffloorflags, secthinkers);
break;
case 140: // 'Platform' - You can jump up through it
// If line has no-climb set, don't give it shadows, otherwise do
ffloorflags = FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_PLATFORM|FF_BOTHPLANES|FF_ALLSIDES;
if (lines[i].flags & ML_NOCLIMB)
ffloorflags |= FF_NOSHADE;
P_AddFakeFloorsByLine(i, ffloorflags, secthinkers);
break;
case 141: // Translucent "platform"
// If line has no-climb set, don't give it shadows, otherwise do
ffloorflags = FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_PLATFORM|FF_TRANSLUCENT|FF_EXTRA|FF_CUTEXTRA;
if (lines[i].flags & ML_NOCLIMB)
ffloorflags |= FF_NOSHADE;
// Draw the 'insides' of the block too
if (lines[i].flags & ML_EFFECT2)
{
ffloorflags |= FF_CUTLEVEL|FF_BOTHPLANES|FF_ALLSIDES;
ffloorflags &= ~(FF_EXTRA|FF_CUTEXTRA);
}
P_AddFakeFloorsByLine(i, ffloorflags, secthinkers);
break;
case 142: // Translucent "platform" with no sides
ffloorflags = FF_EXISTS|FF_SOLID|FF_RENDERPLANES|FF_TRANSLUCENT|FF_PLATFORM|FF_EXTRA|FF_CUTEXTRA;
if (lines[i].flags & ML_NOCLIMB) // shade it unless no-climb
ffloorflags |= FF_NOSHADE;
// Draw the 'insides' of the block too
if (lines[i].flags & ML_EFFECT2)
{
ffloorflags |= FF_CUTLEVEL|FF_BOTHPLANES|FF_ALLSIDES;
ffloorflags &= ~(FF_EXTRA|FF_CUTEXTRA);
}
P_AddFakeFloorsByLine(i, ffloorflags, secthinkers);
break;
case 143: // 'Reverse platform' - You fall through it
// If line has no-climb set, don't give it shadows, otherwise do
ffloorflags = FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_REVERSEPLATFORM|FF_BOTHPLANES|FF_ALLSIDES;
if (lines[i].flags & ML_NOCLIMB)
ffloorflags |= FF_NOSHADE;
P_AddFakeFloorsByLine(i, ffloorflags, secthinkers);
break;
case 144: // Translucent "reverse platform"
// If line has no-climb set, don't give it shadows, otherwise do
ffloorflags = FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_REVERSEPLATFORM|FF_TRANSLUCENT|FF_EXTRA|FF_CUTEXTRA;
if (lines[i].flags & ML_NOCLIMB)
ffloorflags |= FF_NOSHADE;
// Draw the 'insides' of the block too
if (lines[i].flags & ML_EFFECT2)
{
ffloorflags |= FF_CUTLEVEL|FF_BOTHPLANES|FF_ALLSIDES;
ffloorflags &= ~(FF_EXTRA|FF_CUTEXTRA);
}
P_AddFakeFloorsByLine(i, ffloorflags, secthinkers);
break;
case 145: // Translucent "reverse platform" with no sides
ffloorflags = FF_EXISTS|FF_SOLID|FF_RENDERPLANES|FF_TRANSLUCENT|FF_REVERSEPLATFORM|FF_EXTRA|FF_CUTEXTRA;
if (lines[i].flags & ML_NOCLIMB) // shade it unless no-climb
ffloorflags |= FF_NOSHADE;
// Draw the 'insides' of the block too
if (lines[i].flags & ML_EFFECT2)
{
ffloorflags |= FF_CUTLEVEL|FF_BOTHPLANES|FF_ALLSIDES;
ffloorflags &= ~(FF_EXTRA|FF_CUTEXTRA);
}
P_AddFakeFloorsByLine(i, ffloorflags, secthinkers);
break;
case 146: // Intangible floor/ceiling with solid sides (fences/hoops maybe?)
P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERSIDES|FF_ALLSIDES|FF_INTANGIBLEFLATS, secthinkers);
break;
case 150: // Air bobbing platform case 150: // Air bobbing platform
case 151: // Adjustable air bobbing platform case 151: // Adjustable air bobbing platform
P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_CUTLEVEL, secthinkers); P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_CUTLEVEL, secthinkers);