From b90aa624f59079e21cbfc1b84bde5aaf6deee2d0 Mon Sep 17 00:00:00 2001 From: Nev3r Date: Wed, 11 Mar 2020 10:06:11 +0100 Subject: [PATCH] Convert line specials 100-146. --- extras/conf/Includes/SRB222_linedefs.cfg | 85 +++++++++ src/p_setup.c | 109 +++++++++++ src/p_spec.c | 222 +++++------------------ 3 files changed, 241 insertions(+), 175 deletions(-) diff --git a/extras/conf/Includes/SRB222_linedefs.cfg b/extras/conf/Includes/SRB222_linedefs.cfg index 9f6613620..7bbb02ac3 100644 --- a/extras/conf/Includes/SRB222_linedefs.cfg +++ b/extras/conf/Includes/SRB222_linedefs.cfg @@ -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 { title = "Slope"; diff --git a/src/p_setup.c b/src/p_setup.c index 734fe4386..eeaef10a9 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2684,6 +2684,115 @@ static void P_ConvertBinaryMap(void) { 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 if (lines[i].text) { diff --git a/src/p_spec.c b/src/p_spec.c index b04a8d66e..1985356d4 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -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)); break; - case 100: // FOF (solid, opaque, shadows) - P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_CUTLEVEL, secthinkers); - break; - - case 101: // FOF (solid, opaque, no shadows) - P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_NOSHADE|FF_CUTLEVEL, secthinkers); - break; - - case 102: // TL block: FOF (solid, translucent) - ffloorflags = FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_NOSHADE|FF_TRANSLUCENT|FF_EXTRA|FF_CUTEXTRA; - - // Draw the 'insides' of the block too - if (lines[i].flags & ML_NOCLIMB) + case 100: // FOF (solid) + ffloorflags = FF_EXISTS | FF_SOLID; + if (lines[i].args[1] == 0) + ffloorflags |= FF_RENDERALL; + if (lines[i].args[1] == 1) + ffloorflags |= FF_RENDERSIDES; + if (lines[i].args[1] == 2) + ffloorflags |= FF_RENDERPLANES; + //Translucency settings are irrelevant for invisible FOFs + if (lines[i].args[1] != 3) { - ffloorflags |= FF_CUTLEVEL|FF_BOTHPLANES|FF_ALLSIDES; - ffloorflags &= ~(FF_EXTRA|FF_CUTEXTRA); + if (lines[i].args[2] == 0) + { + 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); - break; - - case 103: // Solid FOF with no floor/ceiling (quite possibly useless) - P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERSIDES|FF_NOSHADE|FF_CUTLEVEL, secthinkers); - break; - - case 104: // 3D Floor type that doesn't draw sides - // If line has no-climb set, give it shadows, otherwise don't - ffloorflags = FF_EXISTS|FF_SOLID|FF_RENDERPLANES|FF_CUTLEVEL; - if (!(lines[i].flags & ML_NOCLIMB)) + if (lines[i].args[3] & 1) + ffloorflags |= FF_REVERSEPLATFORM; + if (lines[i].args[3] & 2) + ffloorflags |= FF_PLATFORM; + if (lines[i].args[3] & 4) + ffloorflags &= ~FF_BLOCKPLAYER; + if (lines[i].args[3] & 8) + ffloorflags &= ~FF_BLOCKOTHERS; + if (lines[i].args[4]) ffloorflags |= FF_NOSHADE; - P_AddFakeFloorsByLine(i, ffloorflags, secthinkers); break; - case 105: // FOF (solid, invisible) - P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_NOSHADE, secthinkers); - break; - - case 120: // Opaque water - ffloorflags = FF_EXISTS|FF_RENDERALL|FF_SWIMMABLE|FF_BOTHPLANES|FF_ALLSIDES|FF_CUTEXTRA|FF_EXTRA|FF_CUTSPRITES; - if (lines[i].flags & ML_NOCLIMB) + case 120: // FOF (water) + ffloorflags = FF_EXISTS | FF_RENDERPLANES | FF_SWIMMABLE | FF_BOTHPLANES | FF_CUTEXTRA | FF_EXTRA | FF_CUTSPRITES; + if (!(lines[i].args[1] & 1)) + ffloorflags |= FF_TRANSLUCENT; + if (!(lines[i].args[1] & 2)) + ffloorflags |= FF_RENDERSIDES | FF_ALLSIDES; + if (lines[i].args[1] & 4) ffloorflags |= FF_DOUBLESHADOW; - if (lines[i].flags & ML_EFFECT4) + if (lines[i].args[1] & 8) ffloorflags |= FF_COLORMAPONLY; - if (lines[i].flags & ML_EFFECT5) + if (!(lines[i].args[1] & 16)) ffloorflags |= FF_RIPPLE; + if (lines[i].args[1] & 32) + ffloorflags |= FF_GOOWATER; P_AddFakeFloorsByLine(i, ffloorflags, secthinkers); 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 151: // Adjustable air bobbing platform P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_CUTLEVEL, secthinkers);