From fc4b79c0de8bb32d69003692dd90c6f319939889 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Sat, 4 Jun 2022 10:59:42 +0200 Subject: [PATCH 1/5] Fix custom FOF flag conversion in binary maps --- src/p_setup.c | 81 +++++++++++++++++++++++++++++++++++++++++++++++++-- src/r_defs.h | 41 ++++++++++++++++++++++++++ 2 files changed, 120 insertions(+), 2 deletions(-) diff --git a/src/p_setup.c b/src/p_setup.c index 89b419953..4a822027b 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -3989,6 +3989,81 @@ static void P_SetBinaryFOFAlpha(line_t *line) } } +static INT32 P_GetFOFFlags(INT32 oldflags) +{ + INT32 result = 0; + if (oldflags & FF_OLD_EXISTS) + result |= FF_EXISTS; + if (oldflags & FF_OLD_BLOCKPLAYER) + result |= FF_BLOCKPLAYER; + if (oldflags & FF_OLD_BLOCKOTHERS) + result |= FF_BLOCKOTHERS; + if (oldflags & FF_OLD_RENDERSIDES) + result |= FF_RENDERSIDES; + if (oldflags & FF_OLD_RENDERPLANES) + result |= FF_RENDERPLANES; + if (oldflags & FF_OLD_SWIMMABLE) + result |= FF_SWIMMABLE; + if (oldflags & FF_OLD_NOSHADE) + result |= FF_NOSHADE; + if (oldflags & FF_OLD_CUTSOLIDS) + result |= FF_CUTSOLIDS; + if (oldflags & FF_OLD_CUTEXTRA) + result |= FF_CUTEXTRA; + if (oldflags & FF_OLD_CUTSPRITES) + result |= FF_CUTSPRITES; + if (oldflags & FF_OLD_BOTHPLANES) + result |= FF_BOTHPLANES; + if (oldflags & FF_OLD_EXTRA) + result |= FF_EXTRA; + if (oldflags & FF_OLD_TRANSLUCENT) + result |= FF_TRANSLUCENT; + if (oldflags & FF_OLD_FOG) + result |= FF_FOG; + if (oldflags & FF_OLD_INVERTPLANES) + result |= FF_INVERTPLANES; + if (oldflags & FF_OLD_ALLSIDES) + result |= FF_ALLSIDES; + if (oldflags & FF_OLD_INVERTSIDES) + result |= FF_INVERTSIDES; + if (oldflags & FF_OLD_DOUBLESHADOW) + result |= FF_DOUBLESHADOW; + if (oldflags & FF_OLD_FLOATBOB) + result |= FF_FLOATBOB; + if (oldflags & FF_OLD_NORETURN) + result |= FF_NORETURN; + if (oldflags & FF_OLD_CRUMBLE) + result |= FF_CRUMBLE; + if (oldflags & FF_OLD_GOOWATER) + result |= FF_GOOWATER; + if (oldflags & FF_OLD_MARIO) + result |= FF_MARIO; + if (oldflags & FF_OLD_BUSTUP) + result |= FF_BUSTUP; + if (oldflags & FF_OLD_QUICKSAND) + result |= FF_QUICKSAND; + if (oldflags & FF_OLD_PLATFORM) + result |= FF_PLATFORM; + if (oldflags & FF_OLD_REVERSEPLATFORM) + result |= FF_REVERSEPLATFORM; + if (oldflags & FF_OLD_RIPPLE) + result |= FF_RIPPLE; + if (oldflags & FF_OLD_COLORMAPONLY) + result |= FF_COLORMAPONLY; + return result; +} + +static INT32 P_GetFOFBustflags(INT32 oldflags) +{ + if (oldflags & FF_OLD_SHATTER) + return TMFB_TOUCH; + if (oldflags & FF_OLD_SPINBUST) + return TMFB_SPIN; + if (oldflags & FF_OLD_STRONGBUST) + return TMFB_STRONG; + return TMFB_REGULAR; +} + static void P_ConvertBinaryLinedefTypes(void) { size_t i; @@ -4635,10 +4710,12 @@ static void P_ConvertBinaryLinedefTypes(void) I_Error("Custom FOF (tag %d) found without a linedef back side!", tag); lines[i].args[0] = tag; - lines[i].args[3] = sides[lines[i].sidenum[1]].toptexture; + lines[i].args[3] = P_GetFOFFlags(sides[lines[i].sidenum[1]].toptexture); if (lines[i].flags & ML_EFFECT6) lines[i].args[3] |= FF_SPLAT; - lines[i].args[4] = sides[lines[i].sidenum[1]].midtexture; + lines[i].args[4] = P_GetFOFBustflags(sides[lines[i].sidenum[1]].toptexture); + if (sides[lines[i].sidenum[1]].toptexture & FF_OLD_SHATTERBOTTOM) + lines[i].args[4] |= TMFB_ONLYBOTTOM; if (lines[i].args[3] & FF_TRANSLUCENT) { P_SetBinaryFOFAlpha(&lines[i]); diff --git a/src/r_defs.h b/src/r_defs.h index 9788e6b58..76fcaf2fc 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -152,6 +152,47 @@ typedef enum FF_SPLAT = 0x40000000, ///< Use splat flat renderer (treat cyan pixels as invisible) } ffloortype_e; +typedef enum +{ + FF_OLD_EXISTS = 0x1, + FF_OLD_BLOCKPLAYER = 0x2, + FF_OLD_BLOCKOTHERS = 0x4, + FF_OLD_SOLID = 0x6, + FF_OLD_RENDERSIDES = 0x8, + FF_OLD_RENDERPLANES = 0x10, + FF_OLD_RENDERALL = 0x18, + FF_OLD_SWIMMABLE = 0x20, + FF_OLD_NOSHADE = 0x40, + FF_OLD_CUTSOLIDS = 0x80, + FF_OLD_CUTEXTRA = 0x100, + FF_OLD_CUTLEVEL = 0x180, + FF_OLD_CUTSPRITES = 0x200, + FF_OLD_BOTHPLANES = 0x400, + FF_OLD_EXTRA = 0x800, + FF_OLD_TRANSLUCENT = 0x1000, + FF_OLD_FOG = 0x2000, + FF_OLD_INVERTPLANES = 0x4000, + FF_OLD_ALLSIDES = 0x8000, + FF_OLD_INVERTSIDES = 0x10000, + FF_OLD_DOUBLESHADOW = 0x20000, + FF_OLD_FLOATBOB = 0x40000, + FF_OLD_NORETURN = 0x80000, + FF_OLD_CRUMBLE = 0x100000, + FF_OLD_SHATTERBOTTOM = 0x200000, + FF_OLD_GOOWATER = 0x200000, + FF_OLD_MARIO = 0x400000, + FF_OLD_BUSTUP = 0x800000, + FF_OLD_QUICKSAND = 0x1000000, + FF_OLD_PLATFORM = 0x2000000, + FF_OLD_REVERSEPLATFORM = 0x4000000, + FF_OLD_INTANGIBLEFLATS = 0x6000000, + FF_OLD_SHATTER = 0x8000000, + FF_OLD_SPINBUST = 0x10000000, + FF_OLD_STRONGBUST = 0x20000000, + FF_OLD_RIPPLE = 0x40000000, + FF_OLD_COLORMAPONLY = 0x80000000, +} oldffloortype_e; + typedef enum { FB_PUSHABLES = 0x1, // Bustable by pushables From 8d4baace534038ef5aee7c996fe0f3004b299a8e Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Sun, 31 Jul 2022 12:04:42 +0200 Subject: [PATCH 2/5] Add Lua backwards compatibility for FOF flags --- src/deh_tables.c | 112 ++++++--- src/hardware/hw_main.c | 76 +++---- src/lua_maplib.c | 178 ++++++++++++++- src/p_enemy.c | 2 +- src/p_floor.c | 28 +-- src/p_map.c | 52 ++--- src/p_maputl.c | 24 +- src/p_mobj.c | 88 ++++---- src/p_saveg.c | 8 +- src/p_setup.c | 74 +++--- src/p_sight.c | 18 +- src/p_spec.c | 502 ++++++++++++++++++++--------------------- src/p_spec.h | 4 +- src/p_user.c | 50 ++-- src/r_bsp.c | 30 +-- src/r_defs.h | 80 +++---- src/r_draw8.c | 2 +- src/r_plane.c | 14 +- src/r_segs.c | 98 ++++---- src/r_things.c | 6 +- 20 files changed, 828 insertions(+), 618 deletions(-) diff --git a/src/deh_tables.c b/src/deh_tables.c index 106e51785..302fa4245 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -5326,42 +5326,82 @@ struct int_const_s const INT_CONST[] = { {"SKSJUMP",SKSJUMP}, // 3D Floor/Fake Floor/FOF/whatever flags - {"FF_EXISTS",FF_EXISTS}, ///< Always set, to check for validity. - {"FF_BLOCKPLAYER",FF_BLOCKPLAYER}, ///< Solid to player, but nothing else - {"FF_BLOCKOTHERS",FF_BLOCKOTHERS}, ///< Solid to everything but player - {"FF_SOLID",FF_SOLID}, ///< Clips things. - {"FF_RENDERSIDES",FF_RENDERSIDES}, ///< Renders the sides. - {"FF_RENDERPLANES",FF_RENDERPLANES}, ///< Renders the floor/ceiling. - {"FF_RENDERALL",FF_RENDERALL}, ///< Renders everything. - {"FF_SWIMMABLE",FF_SWIMMABLE}, ///< Is a water block. - {"FF_NOSHADE",FF_NOSHADE}, ///< Messes with the lighting? - {"FF_CUTSOLIDS",FF_CUTSOLIDS}, ///< Cuts out hidden solid pixels. - {"FF_CUTEXTRA",FF_CUTEXTRA}, ///< Cuts out hidden translucent pixels. - {"FF_CUTLEVEL",FF_CUTLEVEL}, ///< Cuts out all hidden pixels. - {"FF_CUTSPRITES",FF_CUTSPRITES}, ///< Final step in making 3D water. - {"FF_BOTHPLANES",FF_BOTHPLANES}, ///< Render inside and outside planes. - {"FF_EXTRA",FF_EXTRA}, ///< Gets cut by ::FF_CUTEXTRA. - {"FF_TRANSLUCENT",FF_TRANSLUCENT}, ///< See through! - {"FF_FOG",FF_FOG}, ///< Fog "brush." - {"FF_INVERTPLANES",FF_INVERTPLANES}, ///< Only render inside planes. - {"FF_ALLSIDES",FF_ALLSIDES}, ///< Render inside and outside sides. - {"FF_INVERTSIDES",FF_INVERTSIDES}, ///< Only render inside sides. - {"FF_DOUBLESHADOW",FF_DOUBLESHADOW}, ///< Make two lightlist entries to reset light? - {"FF_FLOATBOB",FF_FLOATBOB}, ///< Floats on water and bobs if you step on it. - {"FF_NORETURN",FF_NORETURN}, ///< Used with ::FF_CRUMBLE. Will not return to its original position after falling. - {"FF_CRUMBLE",FF_CRUMBLE}, ///< Falls 2 seconds after being stepped on, and randomly brings all touching crumbling 3dfloors down with it, providing their master sectors share the same tag (allows crumble platforms above or below, to also exist). - {"FF_GOOWATER",FF_GOOWATER}, ///< Used with ::FF_SWIMMABLE. Makes thick bouncey goop. - {"FF_MARIO",FF_MARIO}, ///< Acts like a question block when hit from underneath. Goodie spawned at top is determined by master sector. - {"FF_BUSTUP",FF_BUSTUP}, ///< You can spin through/punch this block and it will crumble! - {"FF_QUICKSAND",FF_QUICKSAND}, ///< Quicksand! - {"FF_PLATFORM",FF_PLATFORM}, ///< You can jump up through this to the top. - {"FF_REVERSEPLATFORM",FF_REVERSEPLATFORM}, ///< A fall-through floor in normal gravity, a platform in reverse gravity. - {"FF_INTANGIBLEFLATS",FF_INTANGIBLEFLATS}, ///< Both flats are intangible, but the sides are still solid. - {"FF_INTANGABLEFLATS",FF_INTANGIBLEFLATS}, ///< Both flats are intangable, but the sides are still solid. - {"FF_RIPPLE",FF_RIPPLE}, ///< Ripple the flats - {"FF_COLORMAPONLY",FF_COLORMAPONLY}, ///< Only copy the colormap, not the lightlevel - {"FF_BOUNCY",FF_BOUNCY}, ///< Bounces players - {"FF_SPLAT",FF_SPLAT}, ///< Use splat flat renderer (treat cyan pixels as invisible) + {"FOF_EXISTS",FOF_EXISTS}, ///< Always set, to check for validity. + {"FOF_BLOCKPLAYER",FOF_BLOCKPLAYER}, ///< Solid to player, but nothing else + {"FOF_BLOCKOTHERS",FOF_BLOCKOTHERS}, ///< Solid to everything but player + {"FOF_SOLID",FOF_SOLID}, ///< Clips things. + {"FOF_RENDERSIDES",FOF_RENDERSIDES}, ///< Renders the sides. + {"FOF_RENDERPLANES",FOF_RENDERPLANES}, ///< Renders the floor/ceiling. + {"FOF_RENDERALL",FOF_RENDERALL}, ///< Renders everything. + {"FOF_SWIMMABLE",FOF_SWIMMABLE}, ///< Is a water block. + {"FOF_NOSHADE",FOF_NOSHADE}, ///< Messes with the lighting? + {"FOF_CUTSOLIDS",FOF_CUTSOLIDS}, ///< Cuts out hidden solid pixels. + {"FOF_CUTEXTRA",FOF_CUTEXTRA}, ///< Cuts out hidden translucent pixels. + {"FOF_CUTLEVEL",FOF_CUTLEVEL}, ///< Cuts out all hidden pixels. + {"FOF_CUTSPRITES",FOF_CUTSPRITES}, ///< Final step in making 3D water. + {"FOF_BOTHPLANES",FOF_BOTHPLANES}, ///< Render inside and outside planes. + {"FOF_EXTRA",FOF_EXTRA}, ///< Gets cut by ::FOF_CUTEXTRA. + {"FOF_TRANSLUCENT",FOF_TRANSLUCENT}, ///< See through! + {"FOF_FOG",FOF_FOG}, ///< Fog "brush." + {"FOF_INVERTPLANES",FOF_INVERTPLANES}, ///< Only render inside planes. + {"FOF_ALLSIDES",FOF_ALLSIDES}, ///< Render inside and outside sides. + {"FOF_INVERTSIDES",FOF_INVERTSIDES}, ///< Only render inside sides. + {"FOF_DOUBLESHADOW",FOF_DOUBLESHADOW}, ///< Make two lightlist entries to reset light? + {"FOF_FLOATBOB",FOF_FLOATBOB}, ///< Floats on water and bobs if you step on it. + {"FOF_NORETURN",FOF_NORETURN}, ///< Used with ::FOF_CRUMBLE. Will not return to its original position after falling. + {"FOF_CRUMBLE",FOF_CRUMBLE}, ///< Falls 2 seconds after being stepped on, and randomly brings all touching crumbling 3dfloors down with it, providing their master sectors share the same tag (allows crumble platforms above or below, to also exist). + {"FOF_GOOWATER",FOF_GOOWATER}, ///< Used with ::FOF_SWIMMABLE. Makes thick bouncey goop. + {"FOF_MARIO",FOF_MARIO}, ///< Acts like a question block when hit from underneath. Goodie spawned at top is determined by master sector. + {"FOF_BUSTUP",FOF_BUSTUP}, ///< You can spin through/punch this block and it will crumble! + {"FOF_QUICKSAND",FOF_QUICKSAND}, ///< Quicksand! + {"FOF_PLATFORM",FOF_PLATFORM}, ///< You can jump up through this to the top. + {"FOF_REVERSEPLATFORM",FOF_REVERSEPLATFORM}, ///< A fall-through floor in normal gravity, a platform in reverse gravity. + {"FOF_INTANGIBLEFLATS",FOF_INTANGIBLEFLATS}, ///< Both flats are intangible, but the sides are still solid. + {"FF_INTANGABLEFLATS",FOF_INTANGIBLEFLATS}, ///< Both flats are intangable, but the sides are still solid. //TODO + {"FOF_RIPPLE",FOF_RIPPLE}, ///< Ripple the flats + {"FOF_COLORMAPONLY",FOF_COLORMAPONLY}, ///< Only copy the colormap, not the lightlevel + {"FOF_BOUNCY",FOF_BOUNCY}, ///< Bounces players + {"FOF_SPLAT",FOF_SPLAT}, ///< Use splat flat renderer (treat cyan pixels as invisible) + + // Old FOF flags for backwards compatibility + {"FF_EXISTS",FF_OLD_EXISTS}, + {"FF_BLOCKPLAYER",FF_OLD_BLOCKPLAYER}, + {"FF_BLOCKOTHERS",FF_OLD_BLOCKOTHERS}, + {"FF_SOLID",FF_OLD_SOLID}, + {"FF_RENDERSIDES",FF_OLD_RENDERSIDES}, + {"FF_RENDERPLANES",FF_OLD_RENDERPLANES}, + {"FF_RENDERALL",FF_OLD_RENDERALL}, + {"FF_SWIMMABLE",FF_OLD_SWIMMABLE}, + {"FF_NOSHADE",FF_OLD_NOSHADE}, + {"FF_CUTSOLIDS",FF_OLD_CUTSOLIDS}, + {"FF_CUTEXTRA",FF_OLD_CUTEXTRA}, + {"FF_CUTLEVEL",FF_OLD_CUTLEVEL}, + {"FF_CUTSPRITES",FF_OLD_CUTSPRITES}, + {"FF_BOTHPLANES",FF_OLD_BOTHPLANES}, + {"FF_EXTRA",FF_OLD_EXTRA}, + {"FF_TRANSLUCENT",FF_OLD_TRANSLUCENT}, + {"FF_FOG",FF_OLD_FOG}, + {"FF_INVERTPLANES",FF_OLD_INVERTPLANES}, + {"FF_ALLSIDES",FF_OLD_ALLSIDES}, + {"FF_INVERTSIDES",FF_OLD_INVERTSIDES}, + {"FF_DOUBLESHADOW",FF_OLD_DOUBLESHADOW}, + {"FF_FLOATBOB",FF_OLD_FLOATBOB}, + {"FF_NORETURN",FF_OLD_NORETURN}, + {"FF_CRUMBLE",FF_OLD_CRUMBLE}, + {"FF_SHATTERBOTTOM",FF_OLD_SHATTERBOTTOM}, + {"FF_GOOWATER",FF_OLD_GOOWATER}, + {"FF_MARIO",FF_OLD_MARIO}, + {"FF_BUSTUP",FF_OLD_BUSTUP}, + {"FF_QUICKSAND",FF_OLD_QUICKSAND}, + {"FF_PLATFORM",FF_OLD_PLATFORM}, + {"FF_REVERSEPLATFORM",FF_OLD_REVERSEPLATFORM}, + {"FF_INTANGIBLEFLATS",FF_OLD_INTANGIBLEFLATS}, + {"FF_INTANGABLEFLATS",FF_OLD_INTANGIBLEFLATS}, + {"FF_SHATTER",FF_OLD_SHATTER}, + {"FF_SPINBUST",FF_OLD_SPINBUST}, + {"FF_STRONGBUST",FF_OLD_STRONGBUST}, + {"FF_RIPPLE",FF_OLD_RIPPLE}, + {"FF_COLORMAPONLY",FF_OLD_COLORMAPONLY}, // FOF bustable flags {"FB_PUSHABLES",FB_PUSHABLES}, diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index a6b08812b..0a5dc7f7b 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -887,9 +887,9 @@ static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum, if (endtop < endrealbot && top < realbot) return; - if (!(list[i].flags & FF_NOSHADE)) + if (!(list[i].flags & FOF_NOSHADE)) { - if (pfloor && (pfloor->flags & FF_FOG)) + if (pfloor && (pfloor->fofflags & FOF_FOG)) { lightnum = HWR_CalcWallLight(pfloor->master->frontsector->lightlevel, v1x, v1y, v2x, v2y); colormap = pfloor->master->frontsector->extra_colormap; @@ -903,13 +903,13 @@ static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum, solid = false; - if ((sector->lightlist[i].flags & FF_CUTSOLIDS) && !(cutflag & FF_EXTRA)) + if ((sector->lightlist[i].flags & FOF_CUTSOLIDS) && !(cutflag & FOF_EXTRA)) solid = true; - else if ((sector->lightlist[i].flags & FF_CUTEXTRA) && (cutflag & FF_EXTRA)) + else if ((sector->lightlist[i].flags & FOF_CUTEXTRA) && (cutflag & FOF_EXTRA)) { - if (sector->lightlist[i].flags & FF_EXTRA) + if (sector->lightlist[i].flags & FOF_EXTRA) { - if ((sector->lightlist[i].flags & (FF_FOG|FF_SWIMMABLE)) == (cutflag & (FF_FOG|FF_SWIMMABLE))) // Only merge with your own types + if ((sector->lightlist[i].flags & (FOF_FOG|FOF_SWIMMABLE)) == (cutflag & (FOF_FOG|FOF_SWIMMABLE))) // Only merge with your own types solid = true; } else @@ -978,7 +978,7 @@ static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum, wallVerts[0].y = bot; wallVerts[1].y = endbot; - if (cutflag & FF_FOG) + if (cutflag & FOF_FOG) HWR_AddTransparentWall(wallVerts, Surf, texnum, PF_Fog|PF_NoTexture|polyflags, true, lightnum, colormap); else if (polyflags & (PF_Translucent|PF_Additive|PF_Subtractive|PF_ReverseSubtract|PF_Multiplicative|PF_Environment)) HWR_AddTransparentWall(wallVerts, Surf, texnum, polyflags, false, lightnum, colormap); @@ -1007,7 +1007,7 @@ static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum, wallVerts[0].y = bot; wallVerts[1].y = endbot; - if (cutflag & FF_FOG) + if (cutflag & FOF_FOG) HWR_AddTransparentWall(wallVerts, Surf, texnum, PF_Fog|PF_NoTexture|polyflags, true, lightnum, colormap); else if (polyflags & (PF_Translucent|PF_Additive|PF_Subtractive|PF_ReverseSubtract|PF_Multiplicative|PF_Environment)) HWR_AddTransparentWall(wallVerts, Surf, texnum, polyflags, false, lightnum, colormap); @@ -1192,7 +1192,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom wallVerts[1].y = FIXED_TO_FLOAT(worldhighslope); if (gl_frontsector->numlights) - HWR_SplitWall(gl_frontsector, wallVerts, gl_toptexture, &Surf, FF_CUTLEVEL, NULL, 0); + HWR_SplitWall(gl_frontsector, wallVerts, gl_toptexture, &Surf, FOF_CUTLEVEL, NULL, 0); else if (grTex->mipmap.flags & TF_TRANSPARENT) HWR_AddTransparentWall(wallVerts, &Surf, gl_toptexture, PF_Environment, false, lightnum, colormap); else @@ -1258,7 +1258,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom wallVerts[1].y = FIXED_TO_FLOAT(worldbottomslope); if (gl_frontsector->numlights) - HWR_SplitWall(gl_frontsector, wallVerts, gl_bottomtexture, &Surf, FF_CUTLEVEL, NULL, 0); + HWR_SplitWall(gl_frontsector, wallVerts, gl_bottomtexture, &Surf, FOF_CUTLEVEL, NULL, 0); else if (grTex->mipmap.flags & TF_TRANSPARENT) HWR_AddTransparentWall(wallVerts, &Surf, gl_bottomtexture, PF_Environment, false, lightnum, colormap); else @@ -1465,9 +1465,9 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom if (gl_frontsector->numlights) { if (!(blendmode & PF_Masked)) - HWR_SplitWall(gl_frontsector, wallVerts, gl_midtexture, &Surf, FF_TRANSLUCENT, NULL, blendmode); + HWR_SplitWall(gl_frontsector, wallVerts, gl_midtexture, &Surf, FOF_TRANSLUCENT, NULL, blendmode); else - HWR_SplitWall(gl_frontsector, wallVerts, gl_midtexture, &Surf, FF_CUTLEVEL, NULL, blendmode); + HWR_SplitWall(gl_frontsector, wallVerts, gl_midtexture, &Surf, FOF_CUTLEVEL, NULL, blendmode); } else if (!(blendmode & PF_Masked)) HWR_AddTransparentWall(wallVerts, &Surf, gl_midtexture, blendmode, false, lightnum, colormap); @@ -1549,7 +1549,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom // I don't think that solid walls can use translucent linedef types... if (gl_frontsector->numlights) - HWR_SplitWall(gl_frontsector, wallVerts, gl_midtexture, &Surf, FF_CUTLEVEL, NULL, 0); + HWR_SplitWall(gl_frontsector, wallVerts, gl_midtexture, &Surf, FOF_CUTLEVEL, NULL, 0); else { if (grTex->mipmap.flags & TF_TRANSPARENT) @@ -1613,9 +1613,9 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom if (bothsides) continue; - if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERSIDES)) + if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_RENDERSIDES)) continue; - if (!(rover->flags & FF_ALLSIDES) && rover->flags & FF_INVERTSIDES) + if (!(rover->fofflags & FOF_ALLSIDES) && rover->fofflags & FOF_INVERTSIDES) continue; SLOPEPARAMS(*rover->t_slope, high1, highslope1, *rover->topheight) @@ -1656,7 +1656,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom wallVerts[2].y = FIXED_TO_FLOAT(hS); wallVerts[0].y = FIXED_TO_FLOAT(l); wallVerts[1].y = FIXED_TO_FLOAT(lS); - if (rover->flags & FF_FOG) + if (rover->fofflags & FOF_FOG) { wallVerts[3].t = wallVerts[2].t = 0; wallVerts[0].t = wallVerts[1].t = 0; @@ -1715,7 +1715,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom wallVerts[0].s = wallVerts[3].s = cliplow * grTex->scaleX; wallVerts[2].s = wallVerts[1].s = cliphigh * grTex->scaleX; } - if (rover->flags & FF_FOG) + if (rover->fofflags & FOF_FOG) { FBITFIELD blendmode; @@ -1727,7 +1727,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom Surf.PolyColor.s.alpha = HWR_FogBlockAlpha(rover->master->frontsector->lightlevel, rover->master->frontsector->extra_colormap); if (gl_frontsector->numlights) - HWR_SplitWall(gl_frontsector, wallVerts, 0, &Surf, rover->flags, rover, blendmode); + HWR_SplitWall(gl_frontsector, wallVerts, 0, &Surf, rover->fofflags, rover, blendmode); else HWR_AddTransparentWall(wallVerts, &Surf, 0, blendmode, true, lightnum, colormap); } @@ -1735,14 +1735,14 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom { FBITFIELD blendmode = PF_Masked; - if ((rover->flags & FF_TRANSLUCENT && rover->alpha < 256) || rover->blend) + if ((rover->fofflags & FOF_TRANSLUCENT && rover->alpha < 256) || rover->blend) { blendmode = rover->blend ? HWR_GetBlendModeFlag(rover->blend) : PF_Translucent; Surf.PolyColor.s.alpha = (UINT8)rover->alpha-1 > 255 ? 255 : rover->alpha-1; } if (gl_frontsector->numlights) - HWR_SplitWall(gl_frontsector, wallVerts, texnum, &Surf, rover->flags, rover, blendmode); + HWR_SplitWall(gl_frontsector, wallVerts, texnum, &Surf, rover->fofflags, rover, blendmode); else { if (blendmode != PF_Masked) @@ -1770,9 +1770,9 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom if (bothsides) continue; - if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERSIDES)) + if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_RENDERSIDES)) continue; - if (!(rover->flags & FF_ALLSIDES || rover->flags & FF_INVERTSIDES)) + if (!(rover->fofflags & FOF_ALLSIDES || rover->fofflags & FOF_INVERTSIDES)) continue; SLOPEPARAMS(*rover->t_slope, high1, highslope1, *rover->topheight) @@ -1812,7 +1812,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom wallVerts[2].y = FIXED_TO_FLOAT(hS); wallVerts[0].y = FIXED_TO_FLOAT(l); wallVerts[1].y = FIXED_TO_FLOAT(lS); - if (rover->flags & FF_FOG) + if (rover->fofflags & FOF_FOG) { wallVerts[3].t = wallVerts[2].t = 0; wallVerts[0].t = wallVerts[1].t = 0; @@ -1838,7 +1838,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom wallVerts[2].s = wallVerts[1].s = cliphigh * grTex->scaleX; } - if (rover->flags & FF_FOG) + if (rover->fofflags & FOF_FOG) { FBITFIELD blendmode; @@ -1850,7 +1850,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom Surf.PolyColor.s.alpha = HWR_FogBlockAlpha(rover->master->frontsector->lightlevel, rover->master->frontsector->extra_colormap); if (gl_backsector->numlights) - HWR_SplitWall(gl_backsector, wallVerts, 0, &Surf, rover->flags, rover, blendmode); + HWR_SplitWall(gl_backsector, wallVerts, 0, &Surf, rover->fofflags, rover, blendmode); else HWR_AddTransparentWall(wallVerts, &Surf, 0, blendmode, true, lightnum, colormap); } @@ -1858,14 +1858,14 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom { FBITFIELD blendmode = PF_Masked; - if ((rover->flags & FF_TRANSLUCENT && rover->alpha < 256) || rover->blend) + if ((rover->fofflags & FOF_TRANSLUCENT && rover->alpha < 256) || rover->blend) { blendmode = rover->blend ? HWR_GetBlendModeFlag(rover->blend) : PF_Translucent; Surf.PolyColor.s.alpha = (UINT8)rover->alpha-1 > 255 ? 255 : rover->alpha-1; } if (gl_backsector->numlights) - HWR_SplitWall(gl_backsector, wallVerts, texnum, &Surf, rover->flags, rover, blendmode); + HWR_SplitWall(gl_backsector, wallVerts, texnum, &Surf, rover->fofflags, rover, blendmode); else { if (blendmode != PF_Masked) @@ -2946,7 +2946,7 @@ static FBITFIELD HWR_RippleBlend(sector_t *sector, ffloor_t *rover, boolean ceil { (void)sector; (void)ceiling; - return /*R_IsRipplePlane(sector, rover, ceiling)*/ (rover->flags & FF_RIPPLE) ? PF_Ripple : 0; + return /*R_IsRipplePlane(sector, rover, ceiling)*/ (rover->fofflags & FOF_RIPPLE) ? PF_Ripple : 0; } // -----------------+ @@ -3114,17 +3114,17 @@ static void HWR_Subsector(size_t num) cullHeight = P_GetFFloorBottomZAt(rover, viewx, viewy); centerHeight = P_GetFFloorBottomZAt(rover, gl_frontsector->soundorg.x, gl_frontsector->soundorg.y); - if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERPLANES)) + if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_RENDERPLANES)) continue; if (sub->validcount == validcount) continue; if (centerHeight <= locCeilingHeight && centerHeight >= locFloorHeight && - ((dup_viewz < cullHeight && (rover->flags & FF_BOTHPLANES || !(rover->flags & FF_INVERTPLANES))) || - (dup_viewz > cullHeight && (rover->flags & FF_BOTHPLANES || rover->flags & FF_INVERTPLANES)))) + ((dup_viewz < cullHeight && (rover->fofflags & FOF_BOTHPLANES || !(rover->fofflags & FOF_INVERTPLANES))) || + (dup_viewz > cullHeight && (rover->fofflags & FOF_BOTHPLANES || rover->fofflags & FOF_INVERTPLANES)))) { - if (rover->flags & FF_FOG) + if (rover->fofflags & FOF_FOG) { UINT8 alpha; @@ -3139,7 +3139,7 @@ static void HWR_Subsector(size_t num) alpha, rover->master->frontsector, PF_Fog|PF_NoTexture, true, rover->master->frontsector->extra_colormap); } - else if ((rover->flags & FF_TRANSLUCENT && rover->alpha < 256) || rover->blend) // SoM: Flags are more efficient + else if ((rover->fofflags & FOF_TRANSLUCENT && rover->alpha < 256) || rover->blend) // SoM: Flags are more efficient { light = R_GetPlaneLight(gl_frontsector, centerHeight, dup_viewz < cullHeight ? true : false); @@ -3167,10 +3167,10 @@ static void HWR_Subsector(size_t num) if (centerHeight >= locFloorHeight && centerHeight <= locCeilingHeight && - ((dup_viewz > cullHeight && (rover->flags & FF_BOTHPLANES || !(rover->flags & FF_INVERTPLANES))) || - (dup_viewz < cullHeight && (rover->flags & FF_BOTHPLANES || rover->flags & FF_INVERTPLANES)))) + ((dup_viewz > cullHeight && (rover->fofflags & FOF_BOTHPLANES || !(rover->fofflags & FOF_INVERTPLANES))) || + (dup_viewz < cullHeight && (rover->fofflags & FOF_BOTHPLANES || rover->fofflags & FOF_INVERTPLANES)))) { - if (rover->flags & FF_FOG) + if (rover->fofflags & FOF_FOG) { UINT8 alpha; @@ -3185,7 +3185,7 @@ static void HWR_Subsector(size_t num) alpha, rover->master->frontsector, PF_Fog|PF_NoTexture, true, rover->master->frontsector->extra_colormap); } - else if ((rover->flags & FF_TRANSLUCENT && rover->alpha < 256) || rover->blend) + else if ((rover->fofflags & FOF_TRANSLUCENT && rover->alpha < 256) || rover->blend) { light = R_GetPlaneLight(gl_frontsector, centerHeight, dup_viewz < cullHeight ? true : false); @@ -3939,7 +3939,7 @@ static void HWR_SplitSprite(gl_vissprite_t *spr) return; // even if we aren't changing colormap or lightlevel, we still need to continue drawing down the sprite - if (!(list[i].flags & FF_NOSHADE) && (list[i].flags & FF_CUTSPRITES)) + if (!(list[i].flags & FOF_NOSHADE) && (list[i].flags & FOF_CUTSPRITES)) { if (!lightset) lightlevel = *list[i].lightlevel > 255 ? 255 : *list[i].lightlevel; diff --git a/src/lua_maplib.c b/src/lua_maplib.c index 0c3440426..0051718c3 100644 --- a/src/lua_maplib.c +++ b/src/lua_maplib.c @@ -214,6 +214,7 @@ enum ffloor_e { ffloor_tslope, ffloor_bslope, ffloor_sector, + ffloor_fofflags, ffloor_flags, ffloor_master, ffloor_target, @@ -1841,6 +1842,80 @@ static int lib_numnodes(lua_State *L) // ffloor_t // ////////////// +static INT32 P_GetOldFOFFlags(ffloor_t *fflr) +{ + INT32 result = 0; + if (fflr->fofflags & FOF_EXISTS) + result |= FF_OLD_EXISTS; + if (fflr->fofflags & FOF_BLOCKPLAYER) + result |= FF_OLD_BLOCKPLAYER; + if (fflr->fofflags & FOF_BLOCKOTHERS) + result |= FF_OLD_BLOCKOTHERS; + if (fflr->fofflags & FOF_RENDERSIDES) + result |= FF_OLD_RENDERSIDES; + if (fflr->fofflags & FOF_RENDERPLANES) + result |= FF_OLD_RENDERPLANES; + if (fflr->fofflags & FOF_SWIMMABLE) + result |= FF_OLD_SWIMMABLE; + if (fflr->fofflags & FOF_NOSHADE) + result |= FF_OLD_NOSHADE; + if (fflr->fofflags & FOF_CUTSOLIDS) + result |= FF_OLD_CUTSOLIDS; + if (fflr->fofflags & FOF_CUTEXTRA) + result |= FF_OLD_CUTEXTRA; + if (fflr->fofflags & FOF_CUTSPRITES) + result |= FF_OLD_CUTSPRITES; + if (fflr->fofflags & FOF_BOTHPLANES) + result |= FF_OLD_BOTHPLANES; + if (fflr->fofflags & FOF_EXTRA) + result |= FF_OLD_EXTRA; + if (fflr->fofflags & FOF_TRANSLUCENT) + result |= FF_OLD_TRANSLUCENT; + if (fflr->fofflags & FOF_FOG) + result |= FF_OLD_FOG; + if (fflr->fofflags & FOF_INVERTPLANES) + result |= FF_OLD_INVERTPLANES; + if (fflr->fofflags & FOF_ALLSIDES) + result |= FF_OLD_ALLSIDES; + if (fflr->fofflags & FOF_INVERTSIDES) + result |= FF_OLD_INVERTSIDES; + if (fflr->fofflags & FOF_DOUBLESHADOW) + result |= FF_OLD_DOUBLESHADOW; + if (fflr->fofflags & FOF_FLOATBOB) + result |= FF_OLD_FLOATBOB; + if (fflr->fofflags & FOF_NORETURN) + result |= FF_OLD_NORETURN; + if (fflr->fofflags & FOF_CRUMBLE) + result |= FF_OLD_CRUMBLE; + if (fflr->bustflags & TMFB_ONLYBOTTOM) + result |= FF_OLD_SHATTERBOTTOM; + if (fflr->fofflags & FOF_GOOWATER) + result |= FF_OLD_GOOWATER; + if (fflr->fofflags & FOF_MARIO) + result |= FF_OLD_MARIO; + if (fflr->fofflags & FOF_BUSTUP) + result |= FF_OLD_BUSTUP; + if (fflr->fofflags & FOF_QUICKSAND) + result |= FF_OLD_QUICKSAND; + if (fflr->fofflags & FOF_PLATFORM) + result |= FF_OLD_PLATFORM; + if (fflr->fofflags & FOF_REVERSEPLATFORM) + result |= FF_OLD_REVERSEPLATFORM; + if (fflr->fofflags & FOF_INTANGIBLEFLATS) + result |= FF_OLD_INTANGIBLEFLATS; + if (fflr->busttype == BT_TOUCH) + result |= FF_OLD_SHATTER; + if (fflr->busttype == BT_SPINBUST) + result |= FF_OLD_SPINBUST; + if (fflr->busttype == BT_STRONG) + result |= FF_OLD_STRONGBUST; + if (fflr->fofflags & FF_OLD_RIPPLE) + result |= FOF_RIPPLE; + if (fflr->fofflags & FF_OLD_COLORMAPONLY) + result |= FOF_COLORMAPONLY; + return result; +} + static int ffloor_get(lua_State *L) { ffloor_t *ffloor = *((ffloor_t **)luaL_checkudata(L, 1, META_FFLOOR)); @@ -1895,8 +1970,11 @@ static int ffloor_get(lua_State *L) case ffloor_sector: LUA_PushUserdata(L, §ors[ffloor->secnum], META_SECTOR); return 1; + case ffloor_fofflags: + lua_pushinteger(L, ffloor->fofflags); + return 1; case ffloor_flags: - lua_pushinteger(L, ffloor->flags); + lua_pushinteger(L, P_GetOldFOFFlags(ffloor)); return 1; case ffloor_master: LUA_PushUserdata(L, ffloor->master, META_LINE); @@ -1938,6 +2016,88 @@ static int ffloor_get(lua_State *L) return 0; } +static void P_SetOldFOFFlags(ffloor_t *fflr, oldffloortype_e oldflags) +{ + ffloortype_e originalflags = fflr->fofflags; + fflr->fofflags = 0; + if (oldflags & FF_OLD_EXISTS) + fflr->fofflags |= FOF_EXISTS; + if (oldflags & FF_OLD_BLOCKPLAYER) + fflr->fofflags |= FOF_BLOCKPLAYER; + if (oldflags & FF_OLD_BLOCKOTHERS) + fflr->fofflags |= FOF_BLOCKOTHERS; + if (oldflags & FF_OLD_RENDERSIDES) + fflr->fofflags |= FOF_RENDERSIDES; + if (oldflags & FF_OLD_RENDERPLANES) + fflr->fofflags |= FOF_RENDERPLANES; + if (oldflags & FF_OLD_SWIMMABLE) + fflr->fofflags |= FOF_SWIMMABLE; + if (oldflags & FF_OLD_NOSHADE) + fflr->fofflags |= FOF_NOSHADE; + if (oldflags & FF_OLD_CUTSOLIDS) + fflr->fofflags |= FOF_CUTSOLIDS; + if (oldflags & FF_OLD_CUTEXTRA) + fflr->fofflags |= FOF_CUTEXTRA; + if (oldflags & FF_OLD_CUTSPRITES) + fflr->fofflags |= FOF_CUTSPRITES; + if (oldflags & FF_OLD_BOTHPLANES) + fflr->fofflags |= FOF_BOTHPLANES; + if (oldflags & FF_OLD_EXTRA) + fflr->fofflags |= FOF_EXTRA; + if (oldflags & FF_OLD_TRANSLUCENT) + fflr->fofflags |= FOF_TRANSLUCENT; + if (oldflags & FF_OLD_FOG) + fflr->fofflags |= FOF_FOG; + if (oldflags & FF_OLD_INVERTPLANES) + fflr->fofflags |= FOF_INVERTPLANES; + if (oldflags & FF_OLD_ALLSIDES) + fflr->fofflags |= FOF_ALLSIDES; + if (oldflags & FF_OLD_INVERTSIDES) + fflr->fofflags |= FOF_INVERTSIDES; + if (oldflags & FF_OLD_DOUBLESHADOW) + fflr->fofflags |= FOF_DOUBLESHADOW; + if (oldflags & FF_OLD_FLOATBOB) + fflr->fofflags |= FOF_FLOATBOB; + if (oldflags & FF_OLD_NORETURN) + fflr->fofflags |= FOF_NORETURN; + if (oldflags & FF_OLD_CRUMBLE) + fflr->fofflags |= FOF_CRUMBLE; + if (oldflags & FF_OLD_GOOWATER) + fflr->fofflags |= FOF_GOOWATER; + if (oldflags & FF_OLD_MARIO) + fflr->fofflags |= FOF_MARIO; + if (oldflags & FF_OLD_BUSTUP) + fflr->fofflags |= FOF_BUSTUP; + if (oldflags & FF_OLD_QUICKSAND) + fflr->fofflags |= FOF_QUICKSAND; + if (oldflags & FF_OLD_PLATFORM) + fflr->fofflags |= FOF_PLATFORM; + if (oldflags & FF_OLD_REVERSEPLATFORM) + fflr->fofflags |= FOF_REVERSEPLATFORM; + if (oldflags & FF_OLD_RIPPLE) + fflr->fofflags |= FOF_RIPPLE; + if (oldflags & FF_OLD_COLORMAPONLY) + fflr->fofflags |= FOF_COLORMAPONLY; + if (originalflags & FOF_BOUNCY) + fflr->fofflags |= FOF_BOUNCY; + if (originalflags & FOF_SPLAT) + fflr->fofflags |= FOF_SPLAT; + + if (oldflags & FF_OLD_SHATTER) + fflr->busttype = BT_TOUCH; + else if (oldflags & FF_OLD_SPINBUST) + fflr->busttype = BT_SPINBUST; + else if (oldflags & FF_OLD_STRONGBUST) + fflr->busttype = BT_STRONG; + else + fflr->busttype = BT_REGULAR; + + if (oldflags & FF_OLD_SHATTERBOTTOM) + fflr->bustflags |= TMFB_ONLYBOTTOM; + else + fflr->bustflags &= ~TMFB_ONLYBOTTOM; +} + static int ffloor_set(lua_State *L) { ffloor_t *ffloor = *((ffloor_t **)luaL_checkudata(L, 1, META_FFLOOR)); @@ -2002,10 +2162,20 @@ static int ffloor_set(lua_State *L) case ffloor_bottompic: *ffloor->bottompic = P_AddLevelFlatRuntime(luaL_checkstring(L, 3)); break; + case ffloor_fofflags: { + ffloortype_e oldflags = ffloor->fofflags; // store FOF's old flags + ffloor->fofflags = luaL_checkinteger(L, 3); + if (ffloor->fofflags != oldflags) + ffloor->target->moved = true; // reset target sector's lightlist + break; + } case ffloor_flags: { - ffloortype_e oldflags = ffloor->flags; // store FOF's old flags - ffloor->flags = luaL_checkinteger(L, 3); - if (ffloor->flags != oldflags) + ffloortype_e oldflags = ffloor->fofflags; // store FOF's old flags + busttype_e oldbusttype = ffloor->busttype; + ffloorbustflags_e oldbustflags = ffloor->bustflags; + oldffloortype_e newflags = luaL_checkinteger(L, 3); + P_SetOldFOFFlags(ffloor, newflags); + if (ffloor->fofflags != oldflags || ffloor->busttype != oldbusttype || ffloor->bustflags != oldbustflags) ffloor->target->moved = true; // reset target sector's lightlist break; } diff --git a/src/p_enemy.c b/src/p_enemy.c index cd381e712..a8da0027a 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -498,7 +498,7 @@ static boolean P_WaterInSector(mobj_t *mobj, fixed_t x, fixed_t y) for (rover = sector->ffloors; rover; rover = rover->next) { - if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_SWIMMABLE)) + if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_SWIMMABLE)) continue; if (*rover->topheight >= mobj->floorz && *rover->topheight <= mobj->z) diff --git a/src/p_floor.c b/src/p_floor.c index b65435c21..d9e0ee0f2 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -551,7 +551,7 @@ static fixed_t P_SectorCheckWater(sector_t *analyzesector, for (rover = analyzesector->ffloors; rover; rover = rover->next) { - if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_SWIMMABLE) || rover->flags & FF_SOLID) + if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_SWIMMABLE) || rover->fofflags & FOF_SOLID) continue; // If the sector is below the water, don't bother. @@ -757,10 +757,10 @@ void T_StartCrumble(crumble_t *crumble) for (rover = sector->ffloors; rover; rover = rover->next) { - if (!(rover->flags & FF_CRUMBLE)) + if (!(rover->fofflags & FOF_CRUMBLE)) continue; - if (!(rover->flags & FF_FLOATBOB)) + if (!(rover->fofflags & FOF_FLOATBOB)) continue; if (rover->master != crumble->sourceline) @@ -769,7 +769,7 @@ void T_StartCrumble(crumble_t *crumble) rover->alpha = crumble->origalpha; if (rover->alpha == 0xff) - rover->flags &= ~FF_TRANSLUCENT; + rover->fofflags &= ~FOF_TRANSLUCENT; } } @@ -793,13 +793,13 @@ void T_StartCrumble(crumble_t *crumble) for (rover = sector->ffloors; rover; rover = rover->next) { - if (rover->flags & FF_NORETURN) + if (rover->fofflags & FOF_NORETURN) continue; - if (!(rover->flags & FF_CRUMBLE)) + if (!(rover->fofflags & FOF_CRUMBLE)) continue; - if (!(rover->flags & FF_FLOATBOB)) + if (!(rover->fofflags & FOF_FLOATBOB)) continue; if (rover->master != crumble->sourceline) @@ -807,7 +807,7 @@ void T_StartCrumble(crumble_t *crumble) if (rover->alpha == crumble->origalpha) { - rover->flags |= FF_TRANSLUCENT; + rover->fofflags |= FOF_TRANSLUCENT; rover->alpha = 0x00; } else @@ -815,7 +815,7 @@ void T_StartCrumble(crumble_t *crumble) rover->alpha = crumble->origalpha; if (rover->alpha == 0xff) - rover->flags &= ~FF_TRANSLUCENT; + rover->fofflags &= ~FOF_TRANSLUCENT; } } } @@ -1082,7 +1082,7 @@ void T_ThwompSector(thwomp_t *thwomp) if (thwomp->direction == 0) // Not going anywhere, so look for players. { - if (rover->flags & FF_EXISTS) + if (rover->fofflags & FOF_EXISTS) { UINT8 i; // scan the players to find victims! @@ -1175,7 +1175,7 @@ void T_ThwompSector(thwomp_t *thwomp) if (res == pastdest) { - if (rover->flags & FF_EXISTS) + if (rover->fofflags & FOF_EXISTS) S_StartSound((void *)&actionsector->soundorg, thwomp->sound); thwomp->direction = 1; // start heading back up @@ -1928,7 +1928,7 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover) } // no longer exists (can't collide with again) - rover->flags &= ~FF_EXISTS; + rover->fofflags &= ~FOF_EXISTS; rover->master->frontsector->moved = true; P_RecalcPrecipInSector(sec); } @@ -2054,8 +2054,8 @@ void EV_MarioBlock(ffloor_t *rover, sector_t *sector, mobj_t *puncher) if (roversec->floordata || roversec->ceilingdata) return; - if (!(rover->flags & FF_SOLID)) - rover->flags |= (FF_SOLID|FF_RENDERALL|FF_CUTLEVEL); + if (!(rover->fofflags & FOF_SOLID)) + rover->fofflags |= (FOF_SOLID|FOF_RENDERALL|FOF_CUTLEVEL); // Find an item to pop out! thing = SearchMarioNode(roversec->touching_thinglist); diff --git a/src/p_map.c b/src/p_map.c index aee13ae7e..1a8494dea 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -2073,13 +2073,13 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y) { fixed_t topheight, bottomheight; - if (!(rover->flags & FF_EXISTS)) + if (!(rover->fofflags & FOF_EXISTS)) continue; topheight = P_GetFOFTopZ(thing, newsubsec->sector, rover, x, y, NULL); bottomheight = P_GetFOFBottomZ(thing, newsubsec->sector, rover, x, y, NULL); - if ((rover->flags & (FF_SWIMMABLE|FF_GOOWATER)) == (FF_SWIMMABLE|FF_GOOWATER) && !(thing->flags & MF_NOGRAVITY)) + if ((rover->fofflags & (FOF_SWIMMABLE|FOF_GOOWATER)) == (FOF_SWIMMABLE|FOF_GOOWATER) && !(thing->flags & MF_NOGRAVITY)) { // If you're inside goowater and slowing down fixed_t sinklevel = FixedMul(thing->info->height/6, thing->scale); @@ -2118,14 +2118,14 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y) if (thing->player && (P_CheckSolidLava(rover) || P_CanRunOnWater(thing->player, rover))) ; - else if (thing->type == MT_SKIM && (rover->flags & FF_SWIMMABLE)) + else if (thing->type == MT_SKIM && (rover->fofflags & FOF_SWIMMABLE)) ; - else if (!((rover->flags & FF_BLOCKPLAYER && thing->player) - || (rover->flags & FF_BLOCKOTHERS && !thing->player) - || rover->flags & FF_QUICKSAND)) + else if (!((rover->fofflags & FOF_BLOCKPLAYER && thing->player) + || (rover->fofflags & FOF_BLOCKOTHERS && !thing->player) + || rover->fofflags & FOF_QUICKSAND)) continue; - if (rover->flags & FF_QUICKSAND) + if (rover->fofflags & FOF_QUICKSAND) { if (thing->z < topheight && bottomheight < thingtop) { @@ -2145,15 +2145,15 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y) + ((topheight - bottomheight)/2)); if (topheight > tmfloorz && abs(delta1) < abs(delta2) - && !(rover->flags & FF_REVERSEPLATFORM)) + && !(rover->fofflags & FOF_REVERSEPLATFORM)) { tmfloorz = tmdropoffz = topheight; tmfloorrover = rover; tmfloorslope = *rover->t_slope; } if (bottomheight < tmceilingz && abs(delta1) >= abs(delta2) - && !(rover->flags & FF_PLATFORM) - && !(thing->type == MT_SKIM && (rover->flags & FF_SWIMMABLE))) + && !(rover->fofflags & FOF_PLATFORM) + && !(thing->type == MT_SKIM && (rover->fofflags & FOF_SWIMMABLE))) { tmceilingz = tmdrpoffceilz = bottomheight; tmceilingrover = rover; @@ -2371,7 +2371,7 @@ boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam) for (rover = newsubsec->sector->ffloors; rover; rover = rover->next) { fixed_t topheight, bottomheight; - if (!(rover->flags & FF_BLOCKOTHERS) || !(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERALL) || (rover->master->frontsector->flags & MSF_NOCLIPCAMERA)) + if (!(rover->fofflags & FOF_BLOCKOTHERS) || !(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_RENDERALL) || (rover->master->frontsector->flags & MSF_NOCLIPCAMERA)) continue; topheight = P_CameraGetFOFTopZ(thiscam, newsubsec->sector, rover, x, y, NULL); @@ -3024,9 +3024,9 @@ static boolean P_ThingHeightClip(mobj_t *thing) { rover = (thing->eflags & MFE_VERTICALFLIP) ? oldceilingrover : oldfloorrover; - // Match the Thing's old floorz to an FOF and check for FF_EXISTS - // If ~FF_EXISTS, don't set mobj Z. - if (!rover || ((rover->flags & FF_EXISTS) && (rover->flags & FF_SOLID))) + // Match the Thing's old floorz to an FOF and check for FOF_EXISTS + // If ~FOF_EXISTS, don't set mobj Z. + if (!rover || ((rover->fofflags & FOF_EXISTS) && (rover->fofflags & FOF_SOLID))) { hitfloor = bouncing; if (thing->eflags & MFE_VERTICALFLIP) @@ -3287,7 +3287,7 @@ static boolean P_IsClimbingValid(player_t *player, angle_t angle) for (rover = glidesector->ffloors; rover; rover = rover->next) { - if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_BLOCKPLAYER)) + if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_BLOCKPLAYER)) continue; topheight = P_GetFFloorTopZAt (rover, mo->x, mo->y); @@ -3403,7 +3403,7 @@ static void PTR_GlideClimbTraverse(line_t *li) { for (rover = checksector->ffloors; rover; rover = rover->next) { - if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_BLOCKPLAYER) || ((rover->flags & FF_BUSTUP) && (slidemo->player->charflags & SF_CANBUSTWALLS))) + if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_BLOCKPLAYER) || ((rover->fofflags & FOF_BUSTUP) && (slidemo->player->charflags & SF_CANBUSTWALLS))) continue; topheight = P_GetFFloorTopZAt (rover, slidemo->x, slidemo->y); @@ -3631,10 +3631,10 @@ static void P_CheckLavaWall(mobj_t *mo, sector_t *sec) for (rover = sec->ffloors; rover; rover = rover->next) { - if (!(rover->flags & FF_EXISTS)) + if (!(rover->fofflags & FOF_EXISTS)) continue; - if (!(rover->flags & FF_SWIMMABLE)) + if (!(rover->fofflags & FOF_SWIMMABLE)) continue; if (rover->master->frontsector->damagetype != SD_LAVA) @@ -4241,8 +4241,8 @@ static boolean PIT_ChangeSector(mobj_t *thing, boolean realcrush) for (rover = thing->subsector->sector->ffloors; rover; rover = rover->next) { - if (!(((rover->flags & FF_BLOCKPLAYER) && thing->player) - || ((rover->flags & FF_BLOCKOTHERS) && !thing->player)) || !(rover->flags & FF_EXISTS)) + if (!(((rover->fofflags & FOF_BLOCKPLAYER) && thing->player) + || ((rover->fofflags & FOF_BLOCKOTHERS) && !thing->player)) || !(rover->fofflags & FOF_EXISTS)) continue; topheight = *rover->topheight; @@ -5036,16 +5036,16 @@ fixed_t P_FloorzAtPos(fixed_t x, fixed_t y, fixed_t z, fixed_t height) for (rover = sec->ffloors; rover; rover = rover->next) { fixed_t topheight, bottomheight; - if (!(rover->flags & FF_EXISTS)) + if (!(rover->fofflags & FOF_EXISTS)) continue; - if ((!(rover->flags & FF_SOLID || rover->flags & FF_QUICKSAND) || (rover->flags & FF_SWIMMABLE))) + if ((!(rover->fofflags & FOF_SOLID || rover->fofflags & FOF_QUICKSAND) || (rover->fofflags & FOF_SWIMMABLE))) continue; topheight = P_GetFFloorTopZAt (rover, x, y); bottomheight = P_GetFFloorBottomZAt(rover, x, y); - if (rover->flags & FF_QUICKSAND) + if (rover->fofflags & FOF_QUICKSAND) { if (z < topheight && bottomheight < thingtop) { @@ -5080,16 +5080,16 @@ fixed_t P_CeilingzAtPos(fixed_t x, fixed_t y, fixed_t z, fixed_t height) for (rover = sec->ffloors; rover; rover = rover->next) { fixed_t topheight, bottomheight; - if (!(rover->flags & FF_EXISTS)) + if (!(rover->fofflags & FOF_EXISTS)) continue; - if ((!(rover->flags & FF_SOLID || rover->flags & FF_QUICKSAND) || (rover->flags & FF_SWIMMABLE))) + if ((!(rover->fofflags & FOF_SOLID || rover->fofflags & FOF_QUICKSAND) || (rover->fofflags & FOF_SWIMMABLE))) continue; topheight = P_GetFFloorTopZAt (rover, x, y); bottomheight = P_GetFFloorBottomZAt(rover, x, y); - if (rover->flags & FF_QUICKSAND) + if (rover->fofflags & FOF_QUICKSAND) { if (thingtop > bottomheight && topheight > z) { diff --git a/src/p_maputl.c b/src/p_maputl.c index 614db93e3..260bcc074 100644 --- a/src/p_maputl.c +++ b/src/p_maputl.c @@ -374,7 +374,7 @@ void P_CameraLineOpening(line_t *linedef) for (rover = front->ffloors; rover; rover = rover->next) { fixed_t topheight, bottomheight; - if (!(rover->flags & FF_BLOCKOTHERS) || !(rover->flags & FF_RENDERALL) || !(rover->flags & FF_EXISTS) || (rover->master->frontsector->flags & MSF_NOCLIPCAMERA)) + if (!(rover->fofflags & FOF_BLOCKOTHERS) || !(rover->fofflags & FOF_RENDERALL) || !(rover->fofflags & FOF_EXISTS) || (rover->master->frontsector->flags & MSF_NOCLIPCAMERA)) continue; topheight = P_CameraGetFOFTopZ(mapcampointer, front, rover, tmx, tmy, linedef); @@ -398,7 +398,7 @@ void P_CameraLineOpening(line_t *linedef) for (rover = back->ffloors; rover; rover = rover->next) { fixed_t topheight, bottomheight; - if (!(rover->flags & FF_BLOCKOTHERS) || !(rover->flags & FF_RENDERALL) || !(rover->flags & FF_EXISTS) || (rover->master->frontsector->flags & MSF_NOCLIPCAMERA)) + if (!(rover->fofflags & FOF_BLOCKOTHERS) || !(rover->fofflags & FOF_RENDERALL) || !(rover->fofflags & FOF_EXISTS) || (rover->master->frontsector->flags & MSF_NOCLIPCAMERA)) continue; topheight = P_CameraGetFOFTopZ(mapcampointer, back, rover, tmx, tmy, linedef); @@ -594,13 +594,13 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) for (rover = front->ffloors; rover; rover = rover->next) { fixed_t topheight, bottomheight; - if (!(rover->flags & FF_EXISTS)) + if (!(rover->fofflags & FOF_EXISTS)) continue; if (mobj->player && (P_CheckSolidLava(rover) || P_CanRunOnWater(mobj->player, rover))) ; - else if (!((rover->flags & FF_BLOCKPLAYER && mobj->player) - || (rover->flags & FF_BLOCKOTHERS && !mobj->player))) + else if (!((rover->fofflags & FOF_BLOCKPLAYER && mobj->player) + || (rover->fofflags & FOF_BLOCKOTHERS && !mobj->player))) continue; topheight = P_GetFOFTopZ(mobj, front, rover, tmx, tmy, linedef); @@ -609,7 +609,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) delta1 = abs(mobj->z - (bottomheight + ((topheight - bottomheight)/2))); delta2 = abs(thingtop - (bottomheight + ((topheight - bottomheight)/2))); - if (delta1 >= delta2 && (rover->flags & FF_INTANGIBLEFLATS) != FF_PLATFORM) // thing is below FOF + if (delta1 >= delta2 && (rover->fofflags & FOF_INTANGIBLEFLATS) != FOF_PLATFORM) // thing is below FOF { if (bottomheight < opentop) { opentop = bottomheight; @@ -620,7 +620,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) highceiling = bottomheight; } - if (delta1 < delta2 && (rover->flags & FF_INTANGIBLEFLATS) != FF_REVERSEPLATFORM) // thing is above FOF + if (delta1 < delta2 && (rover->fofflags & FOF_INTANGIBLEFLATS) != FOF_REVERSEPLATFORM) // thing is above FOF { if (topheight > openbottom) { openbottom = topheight; @@ -636,13 +636,13 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) for (rover = back->ffloors; rover; rover = rover->next) { fixed_t topheight, bottomheight; - if (!(rover->flags & FF_EXISTS)) + if (!(rover->fofflags & FOF_EXISTS)) continue; if (mobj->player && (P_CheckSolidLava(rover) || P_CanRunOnWater(mobj->player, rover))) ; - else if (!((rover->flags & FF_BLOCKPLAYER && mobj->player) - || (rover->flags & FF_BLOCKOTHERS && !mobj->player))) + else if (!((rover->fofflags & FOF_BLOCKPLAYER && mobj->player) + || (rover->fofflags & FOF_BLOCKOTHERS && !mobj->player))) continue; topheight = P_GetFOFTopZ(mobj, back, rover, tmx, tmy, linedef); @@ -651,7 +651,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) delta1 = abs(mobj->z - (bottomheight + ((topheight - bottomheight)/2))); delta2 = abs(thingtop - (bottomheight + ((topheight - bottomheight)/2))); - if (delta1 >= delta2 && (rover->flags & FF_INTANGIBLEFLATS) != FF_PLATFORM) // thing is below FOF + if (delta1 >= delta2 && (rover->fofflags & FOF_INTANGIBLEFLATS) != FOF_PLATFORM) // thing is below FOF { if (bottomheight < opentop) { opentop = bottomheight; @@ -662,7 +662,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) highceiling = bottomheight; } - if (delta1 < delta2 && (rover->flags & FF_INTANGIBLEFLATS) != FF_REVERSEPLATFORM) // thing is above FOF + if (delta1 < delta2 && (rover->fofflags & FOF_INTANGIBLEFLATS) != FOF_REVERSEPLATFORM) // thing is above FOF { if (topheight > openbottom) { openbottom = topheight; diff --git a/src/p_mobj.c b/src/p_mobj.c index 9017c2f16..a1961e37f 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -955,11 +955,11 @@ void P_ExplodeMissile(mobj_t *mo) boolean P_InsideANonSolidFFloor(mobj_t *mobj, ffloor_t *rover) { fixed_t topheight, bottomheight; - if (!(rover->flags & FF_EXISTS)) + if (!(rover->fofflags & FOF_EXISTS)) return false; - if ((((rover->flags & FF_BLOCKPLAYER) && mobj->player) - || ((rover->flags & FF_BLOCKOTHERS) && !mobj->player))) + if ((((rover->fofflags & FOF_BLOCKPLAYER) && mobj->player) + || ((rover->fofflags & FOF_BLOCKOTHERS) && !mobj->player))) return false; topheight = P_GetFFloorTopZAt (rover, mobj->x, mobj->y); @@ -1450,10 +1450,10 @@ fixed_t P_GetMobjGravity(mobj_t *mo) for (rover = mo->subsector->sector->ffloors; rover; rover = rover->next) { - if (!(rover->flags & FF_EXISTS) || !P_InsideANonSolidFFloor(mo, rover)) // P_InsideANonSolidFFloor checks for FF_EXISTS itself, but let's not always call this function + if (!(rover->fofflags & FOF_EXISTS) || !P_InsideANonSolidFFloor(mo, rover)) // P_InsideANonSolidFFloor checks for FOF_EXISTS itself, but let's not always call this function continue; - if ((rover->flags & (FF_SWIMMABLE|FF_GOOWATER)) == (FF_SWIMMABLE|FF_GOOWATER)) + if ((rover->fofflags & (FOF_SWIMMABLE|FOF_GOOWATER)) == (FOF_SWIMMABLE|FOF_GOOWATER)) goopgravity = true; gravfactor = P_GetSectorGravityFactor(mo->subsector->sector); @@ -1714,10 +1714,10 @@ static void P_PushableCheckBustables(mobj_t *mo) for (rover = node->m_sector->ffloors; rover; rover = rover->next) { - if (!(rover->flags & FF_EXISTS)) + if (!(rover->fofflags & FOF_EXISTS)) continue; - if (!(rover->flags & FF_BUSTUP)) + if (!(rover->fofflags & FOF_BUSTUP)) continue; if (!(rover->bustflags & FB_PUSHABLES)) @@ -2168,7 +2168,7 @@ void P_AdjustMobjFloorZ_FFloors(mobj_t *mo, sector_t *sector, UINT8 motype) for (rover = sector->ffloors; rover; rover = rover->next) { - if (!(rover->flags & FF_EXISTS)) + if (!(rover->fofflags & FOF_EXISTS)) continue; topheight = P_GetFOFTopZ(mo, sector, rover, mo->x, mo->y, NULL); @@ -2176,16 +2176,16 @@ void P_AdjustMobjFloorZ_FFloors(mobj_t *mo, sector_t *sector, UINT8 motype) if (mo->player && (P_CheckSolidLava(rover) || P_CanRunOnWater(mo->player, rover))) // only the player should stand on lava or run on water ; - else if (motype != 0 && rover->flags & FF_SWIMMABLE) // "scenery" only + else if (motype != 0 && rover->fofflags & FOF_SWIMMABLE) // "scenery" only continue; - else if (rover->flags & FF_QUICKSAND) // quicksand + else if (rover->fofflags & FOF_QUICKSAND) // quicksand ; else if (!( // if it's not either of the following... - (rover->flags & (FF_BLOCKPLAYER|FF_MARIO) && mo->player) // ...solid to players? (mario blocks are always solid from beneath to players) - || (rover->flags & FF_BLOCKOTHERS && !mo->player) // ...solid to others? + (rover->fofflags & (FOF_BLOCKPLAYER|FOF_MARIO) && mo->player) // ...solid to players? (mario blocks are always solid from beneath to players) + || (rover->fofflags & FOF_BLOCKOTHERS && !mo->player) // ...solid to others? )) // ...don't take it into account. continue; - if (rover->flags & FF_QUICKSAND) + if (rover->fofflags & FOF_QUICKSAND) { switch (motype) { @@ -2210,15 +2210,15 @@ void P_AdjustMobjFloorZ_FFloors(mobj_t *mo, sector_t *sector, UINT8 motype) delta2 = thingtop - (bottomheight + ((topheight - bottomheight)/2)); if (topheight > mo->floorz && abs(delta1) < abs(delta2) - && (rover->flags & FF_SOLID) // Non-FF_SOLID Mario blocks are only solid from bottom - && !(rover->flags & FF_REVERSEPLATFORM) - && ((P_MobjFlip(mo)*mo->momz >= 0) || (!(rover->flags & FF_PLATFORM)))) // In reverse gravity, only clip for FOFs that are intangible from their bottom (the "top" you're falling through) if you're coming from above ("below" in your frame of reference) + && (rover->fofflags & FOF_SOLID) // Non-FOF_SOLID Mario blocks are only solid from bottom + && !(rover->fofflags & FOF_REVERSEPLATFORM) + && ((P_MobjFlip(mo)*mo->momz >= 0) || (!(rover->fofflags & FOF_PLATFORM)))) // In reverse gravity, only clip for FOFs that are intangible from their bottom (the "top" you're falling through) if you're coming from above ("below" in your frame of reference) { mo->floorz = topheight; } if (bottomheight < mo->ceilingz && abs(delta1) >= abs(delta2) - && !(rover->flags & FF_PLATFORM) - && ((P_MobjFlip(mo)*mo->momz >= 0) || ((rover->flags & FF_SOLID) && !(rover->flags & FF_REVERSEPLATFORM)))) // In normal gravity, only clip for FOFs that are intangible from the top if you're coming from below + && !(rover->fofflags & FOF_PLATFORM) + && ((P_MobjFlip(mo)*mo->momz >= 0) || ((rover->fofflags & FOF_SOLID) && !(rover->fofflags & FOF_REVERSEPLATFORM)))) // In normal gravity, only clip for FOFs that are intangible from the top if you're coming from below { mo->ceilingz = bottomheight; } @@ -2334,7 +2334,7 @@ boolean P_CheckDeathPitCollide(mobj_t *mo) boolean P_CheckSolidLava(ffloor_t *rover) { - return (rover->flags & FF_SWIMMABLE) && (rover->master->frontsector->damagetype == SD_LAVA); + return (rover->fofflags & FOF_SWIMMABLE) && (rover->master->frontsector->damagetype == SD_LAVA); } // @@ -2828,10 +2828,10 @@ static void P_CheckMarioBlocks(mobj_t *mo) for (rover = node->m_sector->ffloors; rover; rover = rover->next) { - if (!(rover->flags & FF_EXISTS)) + if (!(rover->fofflags & FOF_EXISTS)) continue; - if (!(rover->flags & FF_MARIO)) + if (!(rover->fofflags & FOF_MARIO)) continue; if (mo->eflags & MFE_VERTICALFLIP) @@ -2840,7 +2840,7 @@ static void P_CheckMarioBlocks(mobj_t *mo) if (*rover->bottomheight != mo->ceilingz) continue; - if (rover->flags & FF_GOOWATER) // Brick block! + if (rover->fofflags & FOF_GOOWATER) // Brick block! EV_CrumbleChain(node->m_sector, rover); else // Question block! EV_MarioBlock(rover, node->m_sector, mo); @@ -3230,7 +3230,7 @@ boolean P_CanRunOnWater(player_t *player, ffloor_t *rover) if (!player->powers[pw_carry] && !player->homing && ((player->powers[pw_super] || player->charflags & SF_RUNONWATER || player->dashmode >= DASHMODE_THRESHOLD) && doifit) - && (rover->flags & FF_SWIMMABLE) && !(player->pflags & PF_SPINNING) && player->speed > FixedMul(player->runspeed, player->mo->scale) + && (rover->fofflags & FOF_SWIMMABLE) && !(player->pflags & PF_SPINNING) && player->speed > FixedMul(player->runspeed, player->mo->scale) && !(player->pflags & PF_SLIDING) && abs(playerbottom - surfaceheight) < FixedMul(30*FRACUNIT, player->mo->scale)) return true; @@ -3264,9 +3264,9 @@ void P_MobjCheckWater(mobj_t *mobj) for (rover = sector->ffloors; rover; rover = rover->next) { fixed_t topheight, bottomheight; - if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_SWIMMABLE) - || (((rover->flags & FF_BLOCKPLAYER) && mobj->player) - || ((rover->flags & FF_BLOCKOTHERS) && !mobj->player))) + if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_SWIMMABLE) + || (((rover->fofflags & FOF_BLOCKPLAYER) && mobj->player) + || ((rover->fofflags & FOF_BLOCKOTHERS) && !mobj->player))) continue; topheight = P_GetSpecialTopZ(mobj, sectors + rover->secnum, sector); @@ -3304,7 +3304,7 @@ void P_MobjCheckWater(mobj_t *mobj) if (rover->master->frontsector->damagetype == SD_FIRE || rover->master->frontsector->damagetype == SD_LAVA) mobj->eflags |= MFE_TOUCHLAVA; - if (rover->flags & FF_GOOWATER && !(mobj->flags & MF_NOGRAVITY)) + if (rover->fofflags & FOF_GOOWATER && !(mobj->flags & MF_NOGRAVITY)) mobj->eflags |= MFE_GOOWATER; } } @@ -3512,7 +3512,7 @@ static void P_SceneryCheckWater(mobj_t *mobj) for (rover = sector->ffloors; rover; rover = rover->next) { - if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_SWIMMABLE) || rover->flags & FF_BLOCKOTHERS) + if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_SWIMMABLE) || rover->fofflags & FOF_BLOCKOTHERS) continue; topheight = P_GetFFloorTopZAt (rover, mobj->x, mobj->y); @@ -3558,7 +3558,7 @@ static boolean P_CameraCheckHeat(camera_t *thiscam) for (rover = sector->ffloors; rover; rover = rover->next) { - if (!(rover->flags & FF_EXISTS)) + if (!(rover->fofflags & FOF_EXISTS)) continue; if (halfheight >= P_GetFFloorTopZAt(rover, thiscam->x, thiscam->y)) @@ -3588,7 +3588,7 @@ static boolean P_CameraCheckWater(camera_t *thiscam) for (rover = sector->ffloors; rover; rover = rover->next) { - if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_SWIMMABLE) || rover->flags & FF_BLOCKOTHERS) + if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_SWIMMABLE) || rover->fofflags & FOF_BLOCKOTHERS) continue; if (halfheight >= P_GetFFloorTopZAt(rover, thiscam->x, thiscam->y)) @@ -3782,10 +3782,10 @@ static void P_CheckCrumblingPlatforms(mobj_t *mobj) for (rover = node->m_sector->ffloors; rover; rover = rover->next) { - if (!(rover->flags & FF_EXISTS)) + if (!(rover->fofflags & FOF_EXISTS)) continue; - if (!(rover->flags & FF_CRUMBLE)) + if (!(rover->fofflags & FOF_CRUMBLE)) continue; if (mobj->eflags & MFE_VERTICALFLIP) @@ -3799,7 +3799,7 @@ static void P_CheckCrumblingPlatforms(mobj_t *mobj) continue; } - EV_StartCrumble(rover->master->frontsector, rover, (rover->flags & FF_FLOATBOB), mobj->player, rover->alpha, !(rover->flags & FF_NORETURN)); + EV_StartCrumble(rover->master->frontsector, rover, (rover->fofflags & FOF_FLOATBOB), mobj->player, rover->alpha, !(rover->fofflags & FOF_NORETURN)); } } } @@ -3817,10 +3817,10 @@ static boolean P_MobjTouchesSectorWithWater(mobj_t *mobj) for (rover = node->m_sector->ffloors; rover; rover = rover->next) { - if (!(rover->flags & FF_EXISTS)) + if (!(rover->fofflags & FOF_EXISTS)) continue; - if (!(rover->flags & FF_SWIMMABLE)) + if (!(rover->fofflags & FOF_SWIMMABLE)) continue; return true; @@ -3851,10 +3851,10 @@ static void P_CheckFloatbobPlatforms(mobj_t *mobj) for (rover = node->m_sector->ffloors; rover; rover = rover->next) { - if (!(rover->flags & FF_EXISTS)) + if (!(rover->fofflags & FOF_EXISTS)) continue; - if (!(rover->flags & FF_FLOATBOB)) + if (!(rover->fofflags & FOF_FLOATBOB)) continue; @@ -3984,10 +3984,10 @@ static void CalculatePrecipFloor(precipmobj_t *mobj) for (rover = mobjsecsubsec->ffloors; rover; rover = rover->next) { // If it exists, it'll get rained on. - if (!(rover->flags & FF_EXISTS)) + if (!(rover->fofflags & FOF_EXISTS)) continue; - if (!(rover->flags & FF_BLOCKOTHERS) && !(rover->flags & FF_SWIMMABLE)) + if (!(rover->fofflags & FOF_BLOCKOTHERS) && !(rover->fofflags & FOF_SWIMMABLE)) continue; topheight = P_GetFFloorTopZAt(rover, mobj->x, mobj->y); @@ -4090,9 +4090,9 @@ static void P_KillRingsInLava(mobj_t *mo) for (rover = node->m_sector->ffloors; rover; rover = rover->next) // go through all fofs in the sector { - if (!(rover->flags & FF_EXISTS)) continue; // fof must be real + if (!(rover->fofflags & FOF_EXISTS)) continue; // fof must be real - if (!(rover->flags & FF_SWIMMABLE)) + if (!(rover->fofflags & FOF_SWIMMABLE)) continue; // fof must be water if (rover->master->frontsector->damagetype != SD_FIRE && rover->master->frontsector->damagetype != SD_LAVA) @@ -4733,14 +4733,14 @@ static void P_Boss4DestroyCage(mobj_t *mobj) { rsec = §ors[sector->attached[a]]; for (rover = rsec->ffloors; rover; rover = rover->next) - if (rover->flags & FF_EXISTS && rover->secnum == (size_t)snum) + if (rover->fofflags & FOF_EXISTS && rover->secnum == (size_t)snum) { - if (rover->flags & FF_RENDERALL) // checking for FF_RENDERANY. + if (rover->fofflags & FOF_RENDERALL) // checking for FF_RENDERANY. EV_CrumbleChain(rsec, rover); // This FOF is visible to some extent? Crumble it. else // Completely invisible FOF { // no longer exists (can't collide with again) - rover->flags &= ~FF_EXISTS; + rover->fofflags &= ~FOF_EXISTS; sector->moved = true; rsec->moved = true; } diff --git a/src/p_saveg.c b/src/p_saveg.c index 668ca08f0..07b3d8640 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -915,7 +915,7 @@ static boolean CheckFFloorDiff(const sector_t *ss) for (rover = ss->ffloors; rover; rover = rover->next) { - if (rover->flags != rover->spawnflags + if (rover->fofflags != rover->spawnflags || rover->alpha != rover->spawnalpha) { return true; // we found an FOF that changed! @@ -935,7 +935,7 @@ static void ArchiveFFloors(const sector_t *ss) for (rover = ss->ffloors; rover; rover = rover->next) { fflr_diff = 0; // reset diff flags - if (rover->flags != rover->spawnflags) + if (rover->fofflags != rover->spawnflags) fflr_diff |= FD_FLAGS; if (rover->alpha != rover->spawnalpha) fflr_diff |= FD_ALPHA; @@ -945,7 +945,7 @@ static void ArchiveFFloors(const sector_t *ss) WRITEUINT16(save_p, j); // save ffloor "number" WRITEUINT8(save_p, fflr_diff); if (fflr_diff & FD_FLAGS) - WRITEUINT32(save_p, rover->flags); + WRITEUINT32(save_p, rover->fofflags); if (fflr_diff & FD_ALPHA) WRITEINT16(save_p, rover->alpha); } @@ -983,7 +983,7 @@ static void UnArchiveFFloors(const sector_t *ss) fflr_diff = READUINT8(save_p); if (fflr_diff & FD_FLAGS) - rover->flags = READUINT32(save_p); + rover->fofflags = READUINT32(save_p); if (fflr_diff & FD_ALPHA) rover->alpha = READINT16(save_p); diff --git a/src/p_setup.c b/src/p_setup.c index 4a822027b..bef35b5ca 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2150,9 +2150,9 @@ static void P_WriteTextmap(void) freetag = Tag_NextUnused(freetag); break; case 259: - if (wlines[i].args[3] & FF_QUICKSAND) + if (wlines[i].args[3] & FOF_QUICKSAND) CONS_Alert(CONS_WARNING, M_GetText("Quicksand properties of custom FOF on linedef %d cannot be converted. Use linedef type 75 instead.\n"), i); - if (wlines[i].args[3] & FF_BUSTUP) + if (wlines[i].args[3] & FOF_BUSTUP) CONS_Alert(CONS_WARNING, M_GetText("Bustable properties of custom FOF on linedef %d cannot be converted. Use linedef type 74 instead.\n"), i); break; case 412: @@ -3993,67 +3993,67 @@ static INT32 P_GetFOFFlags(INT32 oldflags) { INT32 result = 0; if (oldflags & FF_OLD_EXISTS) - result |= FF_EXISTS; + result |= FOF_EXISTS; if (oldflags & FF_OLD_BLOCKPLAYER) - result |= FF_BLOCKPLAYER; + result |= FOF_BLOCKPLAYER; if (oldflags & FF_OLD_BLOCKOTHERS) - result |= FF_BLOCKOTHERS; + result |= FOF_BLOCKOTHERS; if (oldflags & FF_OLD_RENDERSIDES) - result |= FF_RENDERSIDES; + result |= FOF_RENDERSIDES; if (oldflags & FF_OLD_RENDERPLANES) - result |= FF_RENDERPLANES; + result |= FOF_RENDERPLANES; if (oldflags & FF_OLD_SWIMMABLE) - result |= FF_SWIMMABLE; + result |= FOF_SWIMMABLE; if (oldflags & FF_OLD_NOSHADE) - result |= FF_NOSHADE; + result |= FOF_NOSHADE; if (oldflags & FF_OLD_CUTSOLIDS) - result |= FF_CUTSOLIDS; + result |= FOF_CUTSOLIDS; if (oldflags & FF_OLD_CUTEXTRA) - result |= FF_CUTEXTRA; + result |= FOF_CUTEXTRA; if (oldflags & FF_OLD_CUTSPRITES) - result |= FF_CUTSPRITES; + result |= FOF_CUTSPRITES; if (oldflags & FF_OLD_BOTHPLANES) - result |= FF_BOTHPLANES; + result |= FOF_BOTHPLANES; if (oldflags & FF_OLD_EXTRA) - result |= FF_EXTRA; + result |= FOF_EXTRA; if (oldflags & FF_OLD_TRANSLUCENT) - result |= FF_TRANSLUCENT; + result |= FOF_TRANSLUCENT; if (oldflags & FF_OLD_FOG) - result |= FF_FOG; + result |= FOF_FOG; if (oldflags & FF_OLD_INVERTPLANES) - result |= FF_INVERTPLANES; + result |= FOF_INVERTPLANES; if (oldflags & FF_OLD_ALLSIDES) - result |= FF_ALLSIDES; + result |= FOF_ALLSIDES; if (oldflags & FF_OLD_INVERTSIDES) - result |= FF_INVERTSIDES; + result |= FOF_INVERTSIDES; if (oldflags & FF_OLD_DOUBLESHADOW) - result |= FF_DOUBLESHADOW; + result |= FOF_DOUBLESHADOW; if (oldflags & FF_OLD_FLOATBOB) - result |= FF_FLOATBOB; + result |= FOF_FLOATBOB; if (oldflags & FF_OLD_NORETURN) - result |= FF_NORETURN; + result |= FOF_NORETURN; if (oldflags & FF_OLD_CRUMBLE) - result |= FF_CRUMBLE; + result |= FOF_CRUMBLE; if (oldflags & FF_OLD_GOOWATER) - result |= FF_GOOWATER; + result |= FOF_GOOWATER; if (oldflags & FF_OLD_MARIO) - result |= FF_MARIO; + result |= FOF_MARIO; if (oldflags & FF_OLD_BUSTUP) - result |= FF_BUSTUP; + result |= FOF_BUSTUP; if (oldflags & FF_OLD_QUICKSAND) - result |= FF_QUICKSAND; + result |= FOF_QUICKSAND; if (oldflags & FF_OLD_PLATFORM) - result |= FF_PLATFORM; + result |= FOF_PLATFORM; if (oldflags & FF_OLD_REVERSEPLATFORM) - result |= FF_REVERSEPLATFORM; + result |= FOF_REVERSEPLATFORM; if (oldflags & FF_OLD_RIPPLE) - result |= FF_RIPPLE; + result |= FOF_RIPPLE; if (oldflags & FF_OLD_COLORMAPONLY) - result |= FF_COLORMAPONLY; + result |= FOF_COLORMAPONLY; return result; } -static INT32 P_GetFOFBustflags(INT32 oldflags) +static INT32 P_GetFOFBusttype(INT32 oldflags) { if (oldflags & FF_OLD_SHATTER) return TMFB_TOUCH; @@ -4712,17 +4712,17 @@ static void P_ConvertBinaryLinedefTypes(void) lines[i].args[0] = tag; lines[i].args[3] = P_GetFOFFlags(sides[lines[i].sidenum[1]].toptexture); if (lines[i].flags & ML_EFFECT6) - lines[i].args[3] |= FF_SPLAT; - lines[i].args[4] = P_GetFOFBustflags(sides[lines[i].sidenum[1]].toptexture); + lines[i].args[3] |= FOF_SPLAT; + lines[i].args[4] = P_GetFOFBusttype(sides[lines[i].sidenum[1]].toptexture); if (sides[lines[i].sidenum[1]].toptexture & FF_OLD_SHATTERBOTTOM) lines[i].args[4] |= TMFB_ONLYBOTTOM; - if (lines[i].args[3] & FF_TRANSLUCENT) + if (lines[i].args[3] & FOF_TRANSLUCENT) { P_SetBinaryFOFAlpha(&lines[i]); //Replicate old hack: Translucent FOFs set to full opacity cut cyan pixels if (lines[i].args[1] == 256) - lines[i].args[3] |= FF_SPLAT; + lines[i].args[3] |= FOF_SPLAT; } else lines[i].args[1] = 255; @@ -5921,7 +5921,7 @@ static void P_ConvertBinarySectorTypes(void) if (line->flags & ML_BLOCKMONSTERS) continue; - if (line->special == 120 || (line->special == 259 && (line->args[2] & FF_SWIMMABLE))) + if (line->special == 120 || (line->special == 259 && (line->args[2] & FOF_SWIMMABLE))) { isLava = true; break; diff --git a/src/p_sight.c b/src/p_sight.c index 1aa231a6c..4023744dc 100644 --- a/src/p_sight.c +++ b/src/p_sight.c @@ -306,8 +306,8 @@ static boolean P_CrossSubsector(size_t num, register los_t *los) // check front sector's FOFs first for (rover = front->ffloors; rover; rover = rover->next) { - if (!(rover->flags & FF_EXISTS) - || !(rover->flags & FF_RENDERSIDES) || (rover->flags & (FF_TRANSLUCENT|FF_FOG))) + if (!(rover->fofflags & FOF_EXISTS) + || !(rover->fofflags & FOF_RENDERSIDES) || (rover->fofflags & (FOF_TRANSLUCENT|FOF_FOG))) { continue; } @@ -322,8 +322,8 @@ static boolean P_CrossSubsector(size_t num, register los_t *los) // check back sector's FOFs as well for (rover = back->ffloors; rover; rover = rover->next) { - if (!(rover->flags & FF_EXISTS) - || !(rover->flags & FF_RENDERSIDES) || (rover->flags & (FF_TRANSLUCENT|FF_FOG))) + if (!(rover->fofflags & FOF_EXISTS) + || !(rover->fofflags & FOF_RENDERSIDES) || (rover->fofflags & (FOF_TRANSLUCENT|FOF_FOG))) { continue; } @@ -451,8 +451,8 @@ boolean P_CheckSight(mobj_t *t1, mobj_t *t2) // Allow sight through water, fog, etc. /// \todo Improve by checking fog density/translucency /// and setting a sight limit. - if (!(rover->flags & FF_EXISTS) - || !(rover->flags & FF_RENDERPLANES) || (rover->flags & (FF_TRANSLUCENT|FF_FOG))) + if (!(rover->fofflags & FOF_EXISTS) + || !(rover->fofflags & FOF_RENDERPLANES) || (rover->fofflags & (FOF_TRANSLUCENT|FOF_FOG))) { continue; } @@ -470,10 +470,10 @@ boolean P_CheckSight(mobj_t *t1, mobj_t *t2) return false; } - if (rover->flags & FF_SOLID) + if (rover->fofflags & FOF_SOLID) continue; // shortcut since neither mobj can be inside the 3dfloor - if (rover->flags & FF_BOTHPLANES || !(rover->flags & FF_INVERTPLANES)) + if (rover->fofflags & FOF_BOTHPLANES || !(rover->fofflags & FOF_INVERTPLANES)) { if (los.sightzstart >= topz1 && t2->z + t2->height < topz2) return false; // blocked by upper outside plane @@ -482,7 +482,7 @@ boolean P_CheckSight(mobj_t *t1, mobj_t *t2) return false; // blocked by lower outside plane } - if (rover->flags & FF_BOTHPLANES || rover->flags & FF_INVERTPLANES) + if (rover->fofflags & FOF_BOTHPLANES || rover->fofflags & FOF_INVERTPLANES) { if (los.sightzstart < topz1 && t2->z >= topz2) return false; // blocked by upper inside plane diff --git a/src/p_spec.c b/src/p_spec.c index c000960b5..e8c9869a8 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3027,16 +3027,16 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) { foundrover = true; - oldflags = rover->flags; + oldflags = rover->fofflags; // Abracadabra! if (line->args[2]) - rover->flags |= FF_EXISTS; + rover->fofflags |= FOF_EXISTS; else - rover->flags &= ~FF_EXISTS; + rover->fofflags &= ~FOF_EXISTS; // if flags changed, reset sector's light list - if (rover->flags != oldflags) + if (rover->fofflags != oldflags) { sec->moved = true; P_RecalcPrecipInSector(sec); @@ -3053,7 +3053,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) } break; - case 446: // Make block fall remotely (acts like FF_CRUMBLE) + case 446: // Make block fall remotely (acts like FOF_CRUMBLE) { INT16 sectag = (INT16)(line->args[0]); INT16 foftag = (INT16)(line->args[1]); @@ -3086,9 +3086,9 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) foundrover = true; if (line->args[2] & TMFR_CHECKFLAG) // FOF flags determine respawn ability instead? - respawn = !(rover->flags & FF_NORETURN) ^ !!(line->args[2] & TMFR_NORETURN); // TMFR_NORETURN inverts + respawn = !(rover->fofflags & FOF_NORETURN) ^ !!(line->args[2] & TMFR_NORETURN); // TMFR_NORETURN inverts - EV_StartCrumble(rover->master->frontsector, rover, (rover->flags & FF_FLOATBOB), player, rover->alpha, respawn); + EV_StartCrumble(rover->master->frontsector, rover, (rover->fofflags & FOF_FLOATBOB), player, rover->alpha, respawn); } } @@ -3270,10 +3270,10 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) // initialize its alpha to 1 // for relative alpha calc if (!(line->args[3] & TMST_DONTDOTRANSLUCENT) && // do translucent - (rover->spawnflags & FF_NOSHADE) && // do not include light blocks, which don't set FF_NOSHADE - !(rover->spawnflags & FF_RENDERSIDES) && - !(rover->spawnflags & FF_RENDERPLANES) && - !(rover->flags & FF_RENDERALL)) + (rover->spawnflags & FOF_NOSHADE) && // do not include light blocks, which don't set FOF_NOSHADE + !(rover->spawnflags & FOF_RENDERSIDES) && + !(rover->spawnflags & FOF_RENDERPLANES) && + !(rover->fofflags & FOF_RENDERALL)) rover->alpha = 1; P_RemoveFakeFloorFader(rover); @@ -3282,8 +3282,8 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) max(1, min(256, (line->args[3] & TMST_RELATIVE) ? rover->alpha + destvalue : destvalue)), 0, // set alpha immediately false, NULL, // tic-based logic - false, // do not handle FF_EXISTS - !(line->args[3] & TMST_DONTDOTRANSLUCENT), // handle FF_TRANSLUCENT + false, // do not handle FOF_EXISTS + !(line->args[3] & TMST_DONTDOTRANSLUCENT), // handle FOF_TRANSLUCENT false, // do not handle lighting false, // do not handle colormap false, // do not handle collision @@ -3343,8 +3343,8 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) speed, (line->args[4] & TMFT_TICBASED), // tic-based logic (line->args[4] & TMFT_RELATIVE), // Relative destvalue - !(line->args[4] & TMFT_DONTDOEXISTS), // do not handle FF_EXISTS - !(line->args[4] & TMFT_DONTDOTRANSLUCENT), // do not handle FF_TRANSLUCENT + !(line->args[4] & TMFT_DONTDOEXISTS), // do not handle FOF_EXISTS + !(line->args[4] & TMFT_DONTDOTRANSLUCENT), // do not handle FOF_TRANSLUCENT !(line->args[4] & TMFT_DONTDOLIGHTING), // do not handle lighting !(line->args[4] & TMFT_DONTDOCOLORMAP), // do not handle colormap !(line->args[4] & TMFT_IGNORECOLLISION), // do not handle collision @@ -3356,10 +3356,10 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) // initialize its alpha to 1 // for relative alpha calc if (!(line->args[4] & TMFT_DONTDOTRANSLUCENT) && // do translucent - (rover->spawnflags & FF_NOSHADE) && // do not include light blocks, which don't set FF_NOSHADE - !(rover->spawnflags & FF_RENDERSIDES) && - !(rover->spawnflags & FF_RENDERPLANES) && - !(rover->flags & FF_RENDERALL)) + (rover->spawnflags & FOF_NOSHADE) && // do not include light blocks, which don't set FOF_NOSHADE + !(rover->spawnflags & FOF_RENDERSIDES) && + !(rover->spawnflags & FOF_RENDERPLANES) && + !(rover->fofflags & FOF_RENDERALL)) rover->alpha = 1; P_RemoveFakeFloorFader(rover); @@ -3368,8 +3368,8 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) max(1, min(256, (line->args[4] & TMFT_RELATIVE) ? rover->alpha + destvalue : destvalue)), 0, // set alpha immediately false, NULL, // tic-based logic - !(line->args[4] & TMFT_DONTDOEXISTS), // do not handle FF_EXISTS - !(line->args[4] & TMFT_DONTDOTRANSLUCENT), // do not handle FF_TRANSLUCENT + !(line->args[4] & TMFT_DONTDOEXISTS), // do not handle FOF_EXISTS + !(line->args[4] & TMFT_DONTDOTRANSLUCENT), // do not handle FOF_TRANSLUCENT !(line->args[4] & TMFT_DONTDOLIGHTING), // do not handle lighting !(line->args[4] & TMFT_DONTDOCOLORMAP), // do not handle colormap !(line->args[4] & TMFT_IGNORECOLLISION), // do not handle collision @@ -3947,7 +3947,7 @@ boolean P_IsFlagAtBase(mobjtype_t flag) for (rover = mo->subsector->sector->ffloors; rover; rover = rover->next) { - if (!(rover->flags & FF_EXISTS)) + if (!(rover->fofflags & FOF_EXISTS)) continue; if (!(rover->master->frontsector->specialflags & specialflag)) @@ -3981,8 +3981,8 @@ boolean P_IsMobjTouching3DFloor(mobj_t *mo, ffloor_t *ffloor, sector_t *sec) fixed_t topheight = P_GetSpecialTopZ(mo, sectors + ffloor->secnum, sec); fixed_t bottomheight = P_GetSpecialBottomZ(mo, sectors + ffloor->secnum, sec); - if (((ffloor->flags & FF_BLOCKPLAYER) && mo->player) - || ((ffloor->flags & FF_BLOCKOTHERS) && !mo->player)) + if (((ffloor->fofflags & FOF_BLOCKPLAYER) && mo->player) + || ((ffloor->fofflags & FOF_BLOCKOTHERS) && !mo->player)) { // Solid 3D floor: Mobj must touch the top or bottom return P_IsMobjTouchingPlane(mo, ffloor->master->frontsector, topheight, bottomheight); @@ -4020,7 +4020,7 @@ static sector_t *P_MobjTouching3DFloorSpecial(mobj_t *mo, sector_t *sector, INT3 if (GETSECSPECIAL(rover->master->frontsector->special, section) != number) continue; - if (!(rover->flags & FF_EXISTS)) + if (!(rover->fofflags & FOF_EXISTS)) continue; if (!P_IsMobjTouching3DFloor(mo, rover, sector)) @@ -4044,7 +4044,7 @@ static sector_t *P_MobjTouching3DFloorSpecialFlag(mobj_t *mo, sector_t *sector, if (!(rover->master->frontsector->specialflags & flag)) continue; - if (!(rover->flags & FF_EXISTS)) + if (!(rover->fofflags & FOF_EXISTS)) continue; if (!P_IsMobjTouching3DFloor(mo, rover, sector)) @@ -4232,7 +4232,7 @@ static sector_t *P_CheckPlayer3DFloorTrigger(player_t *player, sector_t *sector, if (rover->master->frontsector->triggerer == TO_MOBJ) continue; - if (!(rover->flags & FF_EXISTS)) + if (!(rover->fofflags & FOF_EXISTS)) continue; if (!Tag_Find(&sourceline->tags, rover->master->frontsector->triggertag)) @@ -5146,7 +5146,7 @@ static void P_PlayerOnSpecial3DFloor(player_t *player, sector_t *sector) if (!P_SectorHasSpecial(rover->master->frontsector)) continue; - if (!(rover->flags & FF_EXISTS)) + if (!(rover->fofflags & FOF_EXISTS)) continue; if (!P_IsMobjTouching3DFloor(player->mo, rover, sector)) @@ -5253,7 +5253,7 @@ static void P_CheckMobj3DFloorTrigger(mobj_t *mo, sector_t *sec) if (rover->master->frontsector->triggerer != TO_MOBJ) continue; - if (!(rover->flags & FF_EXISTS)) + if (!(rover->fofflags & FOF_EXISTS)) continue; if (!P_IsMobjTouching3DFloor(mo, rover, sec)) @@ -5519,7 +5519,7 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, I sec2->attachedsolid = Z_Malloc(sizeof (*sec2->attachedsolid) * sec2->maxattached, PU_STATIC, NULL); sec2->attached[0] = sec - sectors; sec2->numattached = 1; - sec2->attachedsolid[0] = (flags & FF_SOLID); + sec2->attachedsolid[0] = (flags & FOF_SOLID); } else { @@ -5534,7 +5534,7 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, I sec2->attachedsolid = Z_Realloc(sec2->attachedsolid, sizeof (*sec2->attachedsolid) * sec2->maxattached, PU_STATIC, NULL); } sec2->attached[sec2->numattached] = sec - sectors; - sec2->attachedsolid[sec2->numattached] = (flags & FF_SOLID); + sec2->attachedsolid[sec2->numattached] = (flags & FOF_SOLID); sec2->numattached++; } @@ -5564,7 +5564,7 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, I if (sec2->hasslope) sec->hasslope = true; - fflr->spawnflags = fflr->flags = flags; + fflr->spawnflags = fflr->fofflags = flags; fflr->master = master; fflr->norender = INFTICS; fflr->fadingdata = NULL; @@ -5612,10 +5612,10 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, I } fflr->alpha = max(0, min(0xff, alpha)); - if (fflr->alpha < 0xff || flags & FF_SPLAT) + if (fflr->alpha < 0xff || flags & FOF_SPLAT) { - fflr->flags |= FF_TRANSLUCENT; - fflr->spawnflags = fflr->flags; + fflr->fofflags |= FOF_TRANSLUCENT; + fflr->spawnflags = fflr->fofflags; } fflr->spawnalpha = fflr->alpha; // save for netgames @@ -5639,23 +5639,23 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, I break; } - if (flags & FF_QUICKSAND) + if (flags & FOF_QUICKSAND) CheckForQuicksand = true; - if (flags & FF_BUSTUP) + if (flags & FOF_BUSTUP) CheckForBustableBlocks = true; - if ((flags & FF_MARIO)) + if ((flags & FOF_MARIO)) { - if (!(flags & FF_GOOWATER)) // Don't change the textures of a brick block, just a question block + if (!(flags & FOF_GOOWATER)) // Don't change the textures of a brick block, just a question block P_AddBlockThinker(sec2, master); CheckForMarioBlocks = true; } - if ((flags & FF_CRUMBLE)) + if ((flags & FOF_CRUMBLE)) sec2->crumblestate = CRUMBLE_WAIT; - if ((flags & FF_FLOATBOB)) + if ((flags & FOF_FLOATBOB)) { P_AddFloatThinker(sec2, master->args[0], master); CheckForFloatBob = true; @@ -5938,14 +5938,14 @@ void T_LaserFlash(laserthink_t *flash) if (fflr->master != flash->sourceline) continue; - if (!(fflr->flags & FF_EXISTS)) + if (!(fflr->fofflags & FOF_EXISTS)) break; if (leveltime & 2) - //fflr->flags |= FF_RENDERALL; + //fflr->flags |= FOF_RENDERALL; fflr->alpha = 0xB0; else - //fflr->flags &= ~FF_RENDERALL; + //fflr->flags &= ~FOF_RENDERALL; fflr->alpha = 0x90; top = P_GetFFloorTopZAt (fflr, sector->soundorg.x, sector->soundorg.y); @@ -6083,8 +6083,8 @@ static void P_MakeFOFBouncy(line_t *paramline, line_t *masterline) if (rover->master != masterline) continue; - rover->flags |= FF_BOUNCY; - rover->spawnflags |= FF_BOUNCY; + rover->fofflags |= FOF_BOUNCY; + rover->spawnflags |= FOF_BOUNCY; rover->bouncestrength = (paramline->args[1]<< FRACBITS)/100; CheckForBouncySector = true; break; @@ -6461,117 +6461,117 @@ void P_SpawnSpecials(boolean fromnetsave) break; case 100: // FOF (solid) - ffloorflags = FF_EXISTS|FF_SOLID|FF_RENDERALL; + ffloorflags = FOF_EXISTS|FOF_SOLID|FOF_RENDERALL; //Appearance settings if (lines[i].args[3] & TMFA_NOPLANES) - ffloorflags &= ~FF_RENDERPLANES; + ffloorflags &= ~FOF_RENDERPLANES; if (lines[i].args[3] & TMFA_NOSIDES) - ffloorflags &= ~FF_RENDERSIDES; + ffloorflags &= ~FOF_RENDERSIDES; if (lines[i].args[3] & TMFA_INSIDES) { - if (ffloorflags & FF_RENDERPLANES) - ffloorflags |= FF_BOTHPLANES; - if (ffloorflags & FF_RENDERSIDES) - ffloorflags |= FF_ALLSIDES; + if (ffloorflags & FOF_RENDERPLANES) + ffloorflags |= FOF_BOTHPLANES; + if (ffloorflags & FOF_RENDERSIDES) + ffloorflags |= FOF_ALLSIDES; } if (lines[i].args[3] & TMFA_ONLYINSIDES) { - if (ffloorflags & FF_RENDERPLANES) - ffloorflags |= FF_INVERTPLANES; - if (ffloorflags & FF_RENDERSIDES) - ffloorflags |= FF_INVERTSIDES; + if (ffloorflags & FOF_RENDERPLANES) + ffloorflags |= FOF_INVERTPLANES; + if (ffloorflags & FOF_RENDERSIDES) + ffloorflags |= FOF_INVERTSIDES; } if (lines[i].args[3] & TMFA_NOSHADE) - ffloorflags |= FF_NOSHADE; + ffloorflags |= FOF_NOSHADE; if (lines[i].args[3] & TMFA_SPLAT) - ffloorflags |= FF_SPLAT; + ffloorflags |= FOF_SPLAT; //Tangibility settings if (lines[i].args[4] & TMFT_INTANGIBLETOP) - ffloorflags |= FF_REVERSEPLATFORM; + ffloorflags |= FOF_REVERSEPLATFORM; if (lines[i].args[4] & TMFT_INTANGIBLEBOTTOM) - ffloorflags |= FF_PLATFORM; + ffloorflags |= FOF_PLATFORM; if (lines[i].args[4] & TMFT_DONTBLOCKPLAYER) - ffloorflags &= ~FF_BLOCKPLAYER; + ffloorflags &= ~FOF_BLOCKPLAYER; if (lines[i].args[4] & TMFT_DONTBLOCKOTHERS) - ffloorflags &= ~FF_BLOCKOTHERS; + ffloorflags &= ~FOF_BLOCKOTHERS; //Cutting options - if (ffloorflags & FF_RENDERALL) + if (ffloorflags & FOF_RENDERALL) { //If translucent or player can enter it, cut inner walls if ((lines[i].args[1] < 255) || (lines[i].args[4] & TMFT_VISIBLEFROMINSIDE)) - ffloorflags |= FF_CUTEXTRA|FF_EXTRA; + ffloorflags |= FOF_CUTEXTRA|FOF_EXTRA; else - ffloorflags |= FF_CUTLEVEL; + ffloorflags |= FOF_CUTLEVEL; } P_AddFakeFloorsByLine(i, lines[i].args[1], lines[i].args[2], ffloorflags, secthinkers); break; case 120: // FOF (water) - ffloorflags = FF_EXISTS|FF_RENDERPLANES|FF_SWIMMABLE|FF_BOTHPLANES|FF_CUTEXTRA|FF_EXTRA|FF_CUTSPRITES; + ffloorflags = FOF_EXISTS|FOF_RENDERPLANES|FOF_SWIMMABLE|FOF_BOTHPLANES|FOF_CUTEXTRA|FOF_EXTRA|FOF_CUTSPRITES; if (!(lines[i].args[3] & TMFW_NOSIDES)) - ffloorflags |= FF_RENDERSIDES|FF_ALLSIDES; + ffloorflags |= FOF_RENDERSIDES|FOF_ALLSIDES; if (lines[i].args[3] & TMFW_DOUBLESHADOW) - ffloorflags |= FF_DOUBLESHADOW; + ffloorflags |= FOF_DOUBLESHADOW; if (lines[i].args[3] & TMFW_COLORMAPONLY) - ffloorflags |= FF_COLORMAPONLY; + ffloorflags |= FOF_COLORMAPONLY; if (!(lines[i].args[3] & TMFW_NORIPPLE)) - ffloorflags |= FF_RIPPLE; + ffloorflags |= FOF_RIPPLE; if (lines[i].args[3] & TMFW_GOOWATER) - ffloorflags |= FF_GOOWATER; + ffloorflags |= FOF_GOOWATER; if (lines[i].args[3] & TMFW_SPLAT) - ffloorflags |= FF_SPLAT; + ffloorflags |= FOF_SPLAT; P_AddFakeFloorsByLine(i, lines[i].args[1], lines[i].args[2], ffloorflags, secthinkers); break; case 150: // FOF (Air bobbing) - P_AddFakeFloorsByLine(i, 0xff, TMB_TRANSLUCENT, FF_EXISTS|FF_SOLID|FF_RENDERALL, secthinkers); + P_AddFakeFloorsByLine(i, 0xff, TMB_TRANSLUCENT, FOF_EXISTS|FOF_SOLID|FOF_RENDERALL, secthinkers); P_AddAirbob(lines[i].frontsector, lines[i].args[0], lines[i].args[1] << FRACBITS, !!(lines[i].args[2] & TMFB_REVERSE), !!(lines[i].args[2] & TMFB_SPINDASH), !!(lines[i].args[2] & TMFB_DYNAMIC)); break; case 160: // FOF (Water bobbing) - P_AddFakeFloorsByLine(i, 0xff, TMB_TRANSLUCENT, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_FLOATBOB, secthinkers); + P_AddFakeFloorsByLine(i, 0xff, TMB_TRANSLUCENT, FOF_EXISTS|FOF_SOLID|FOF_RENDERALL|FOF_FLOATBOB, secthinkers); break; case 170: // FOF (Crumbling) - ffloorflags = FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_CRUMBLE; + ffloorflags = FOF_EXISTS|FOF_SOLID|FOF_RENDERALL|FOF_CRUMBLE; //Tangibility settings if (lines[i].args[3] & TMFT_INTANGIBLETOP) - ffloorflags |= FF_REVERSEPLATFORM; + ffloorflags |= FOF_REVERSEPLATFORM; if (lines[i].args[3] & TMFT_INTANGIBLEBOTTOM) - ffloorflags |= FF_PLATFORM; + ffloorflags |= FOF_PLATFORM; if (lines[i].args[3] & TMFT_DONTBLOCKPLAYER) - ffloorflags &= ~FF_BLOCKPLAYER; + ffloorflags &= ~FOF_BLOCKPLAYER; if (lines[i].args[3] & TMFT_DONTBLOCKOTHERS) - ffloorflags &= ~FF_BLOCKOTHERS; + ffloorflags &= ~FOF_BLOCKOTHERS; //Flags if (lines[i].args[4] & TMFC_NOSHADE) - ffloorflags |= FF_NOSHADE; + ffloorflags |= FOF_NOSHADE; if (lines[i].args[4] & TMFC_NORETURN) - ffloorflags |= FF_NORETURN; + ffloorflags |= FOF_NORETURN; if (lines[i].args[4] & TMFC_FLOATBOB) - ffloorflags |= FF_FLOATBOB; + ffloorflags |= FOF_FLOATBOB; if (lines[i].args[4] & TMFC_SPLAT) - ffloorflags |= FF_SPLAT; + ffloorflags |= FOF_SPLAT; //If translucent or player can enter it, cut inner walls if (lines[i].args[1] < 0xff || (lines[i].args[3] & TMFT_VISIBLEFROMINSIDE)) - ffloorflags |= FF_CUTEXTRA|FF_EXTRA; + ffloorflags |= FOF_CUTEXTRA|FOF_EXTRA; else - ffloorflags |= FF_CUTLEVEL; + ffloorflags |= FOF_CUTLEVEL; //If player can enter it, render insides if (lines[i].args[3] & TMFT_VISIBLEFROMINSIDE) { - if (ffloorflags & FF_RENDERPLANES) - ffloorflags |= FF_BOTHPLANES; - if (ffloorflags & FF_RENDERSIDES) - ffloorflags |= FF_ALLSIDES; + if (ffloorflags & FOF_RENDERPLANES) + ffloorflags |= FOF_BOTHPLANES; + if (ffloorflags & FOF_RENDERSIDES) + ffloorflags |= FOF_ALLSIDES; } P_AddFakeFloorsByLine(i, lines[i].args[1], lines[i].args[2], ffloorflags, secthinkers); @@ -6584,50 +6584,50 @@ void P_SpawnSpecials(boolean fromnetsave) fixed_t ceilingtop = P_FindHighestCeilingSurrounding(lines[i].frontsector); fixed_t ceilingbottom = P_FindLowestCeilingSurrounding(lines[i].frontsector); - ffloorflags = FF_EXISTS|FF_SOLID|FF_RENDERALL; + ffloorflags = FOF_EXISTS|FOF_SOLID|FOF_RENDERALL; //Appearance settings if (lines[i].args[3] & TMFA_NOPLANES) - ffloorflags &= ~FF_RENDERPLANES; + ffloorflags &= ~FOF_RENDERPLANES; if (lines[i].args[3] & TMFA_NOSIDES) - ffloorflags &= ~FF_RENDERSIDES; + ffloorflags &= ~FOF_RENDERSIDES; if (lines[i].args[3] & TMFA_INSIDES) { - if (ffloorflags & FF_RENDERPLANES) - ffloorflags |= FF_BOTHPLANES; - if (ffloorflags & FF_RENDERSIDES) - ffloorflags |= FF_ALLSIDES; + if (ffloorflags & FOF_RENDERPLANES) + ffloorflags |= FOF_BOTHPLANES; + if (ffloorflags & FOF_RENDERSIDES) + ffloorflags |= FOF_ALLSIDES; } if (lines[i].args[3] & TMFA_ONLYINSIDES) { - if (ffloorflags & FF_RENDERPLANES) - ffloorflags |= FF_INVERTPLANES; - if (ffloorflags & FF_RENDERSIDES) - ffloorflags |= FF_INVERTSIDES; + if (ffloorflags & FOF_RENDERPLANES) + ffloorflags |= FOF_INVERTPLANES; + if (ffloorflags & FOF_RENDERSIDES) + ffloorflags |= FOF_INVERTSIDES; } if (lines[i].args[3] & TMFA_NOSHADE) - ffloorflags |= FF_NOSHADE; + ffloorflags |= FOF_NOSHADE; if (lines[i].args[3] & TMFA_SPLAT) - ffloorflags |= FF_SPLAT; + ffloorflags |= FOF_SPLAT; //Tangibility settings if (lines[i].args[4] & TMFT_INTANGIBLETOP) - ffloorflags |= FF_REVERSEPLATFORM; + ffloorflags |= FOF_REVERSEPLATFORM; if (lines[i].args[4] & TMFT_INTANGIBLEBOTTOM) - ffloorflags |= FF_PLATFORM; + ffloorflags |= FOF_PLATFORM; if (lines[i].args[4] & TMFT_DONTBLOCKPLAYER) - ffloorflags &= ~FF_BLOCKPLAYER; + ffloorflags &= ~FOF_BLOCKPLAYER; if (lines[i].args[4] & TMFT_DONTBLOCKOTHERS) - ffloorflags &= ~FF_BLOCKOTHERS; + ffloorflags &= ~FOF_BLOCKOTHERS; //Cutting options - if (ffloorflags & FF_RENDERALL) + if (ffloorflags & FOF_RENDERALL) { //If translucent or player can enter it, cut inner walls if ((lines[i].args[1] < 255) || (lines[i].args[4] & TMFT_VISIBLEFROMINSIDE)) - ffloorflags |= FF_CUTEXTRA|FF_EXTRA; + ffloorflags |= FOF_CUTEXTRA|FOF_EXTRA; else - ffloorflags |= FF_CUTLEVEL; + ffloorflags |= FOF_CUTLEVEL; } P_AddFakeFloorsByLine(i, lines[i].args[1], lines[i].args[2], ffloorflags, secthinkers); @@ -6635,14 +6635,14 @@ void P_SpawnSpecials(boolean fromnetsave) break; } case 200: // Light block - ffloorflags = FF_EXISTS|FF_CUTSPRITES; + ffloorflags = FOF_EXISTS|FOF_CUTSPRITES; if (!lines[i].args[1]) - ffloorflags |= FF_DOUBLESHADOW; + ffloorflags |= FOF_DOUBLESHADOW; P_AddFakeFloorsByLine(i, 0xff, TMB_TRANSLUCENT, ffloorflags, secthinkers); break; case 202: // Fog - ffloorflags = FF_EXISTS|FF_RENDERALL|FF_FOG|FF_INVERTPLANES|FF_INVERTSIDES|FF_CUTEXTRA|FF_EXTRA|FF_DOUBLESHADOW|FF_CUTSPRITES; + ffloorflags = FOF_EXISTS|FOF_RENDERALL|FOF_FOG|FOF_INVERTPLANES|FOF_INVERTSIDES|FOF_CUTEXTRA|FOF_EXTRA|FOF_DOUBLESHADOW|FOF_CUTSPRITES; sec = sides[*lines[i].sidenum].sector - sectors; // SoM: Because it's fog, check for an extra colormap and set the fog flag... if (sectors[sec].extra_colormap) @@ -6651,45 +6651,45 @@ void P_SpawnSpecials(boolean fromnetsave) break; case 220: //Intangible - ffloorflags = FF_EXISTS|FF_RENDERALL|FF_CUTEXTRA|FF_EXTRA|FF_CUTSPRITES; + ffloorflags = FOF_EXISTS|FOF_RENDERALL|FOF_CUTEXTRA|FOF_EXTRA|FOF_CUTSPRITES; //Appearance settings if (lines[i].args[3] & TMFA_NOPLANES) - ffloorflags &= ~FF_RENDERPLANES; + ffloorflags &= ~FOF_RENDERPLANES; if (lines[i].args[3] & TMFA_NOSIDES) - ffloorflags &= ~FF_RENDERSIDES; + ffloorflags &= ~FOF_RENDERSIDES; if (!(lines[i].args[3] & TMFA_INSIDES)) { - if (ffloorflags & FF_RENDERPLANES) - ffloorflags |= FF_BOTHPLANES; - if (ffloorflags & FF_RENDERSIDES) - ffloorflags |= FF_ALLSIDES; + if (ffloorflags & FOF_RENDERPLANES) + ffloorflags |= FOF_BOTHPLANES; + if (ffloorflags & FOF_RENDERSIDES) + ffloorflags |= FOF_ALLSIDES; } if (lines[i].args[3] & TMFA_ONLYINSIDES) { - if (ffloorflags & FF_RENDERPLANES) - ffloorflags |= FF_INVERTPLANES; - if (ffloorflags & FF_RENDERSIDES) - ffloorflags |= FF_INVERTSIDES; + if (ffloorflags & FOF_RENDERPLANES) + ffloorflags |= FOF_INVERTPLANES; + if (ffloorflags & FOF_RENDERSIDES) + ffloorflags |= FOF_INVERTSIDES; } if (lines[i].args[3] & TMFA_NOSHADE) - ffloorflags |= FF_NOSHADE; + ffloorflags |= FOF_NOSHADE; if (lines[i].args[3] & TMFA_SPLAT) - ffloorflags |= FF_SPLAT; + ffloorflags |= FOF_SPLAT; P_AddFakeFloorsByLine(i, lines[i].args[1], lines[i].args[2], ffloorflags, secthinkers); break; case 223: // FOF (intangible, invisible) - for combining specials in a sector - P_AddFakeFloorsByLine(i, 0xff, TMB_TRANSLUCENT, FF_EXISTS|FF_NOSHADE, secthinkers); + P_AddFakeFloorsByLine(i, 0xff, TMB_TRANSLUCENT, FOF_EXISTS|FOF_NOSHADE, secthinkers); break; case 250: // Mario Block - ffloorflags = FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_CUTLEVEL|FF_MARIO; + ffloorflags = FOF_EXISTS|FOF_SOLID|FOF_RENDERALL|FOF_CUTLEVEL|FOF_MARIO; if (lines[i].args[1] & TMFM_BRICK) - ffloorflags |= FF_GOOWATER; + ffloorflags |= FOF_GOOWATER; if (lines[i].args[1] & TMFM_INVISIBLE) - ffloorflags &= ~(FF_SOLID|FF_RENDERALL|FF_CUTLEVEL); + ffloorflags &= ~(FOF_SOLID|FOF_RENDERALL|FOF_CUTLEVEL); P_AddFakeFloorsByLine(i, 0xff, TMB_TRANSLUCENT, ffloorflags, secthinkers); break; @@ -6698,7 +6698,7 @@ void P_SpawnSpecials(boolean fromnetsave) { UINT16 sound = (lines[i].stringargs[0]) ? get_number(lines[i].stringargs[0]) : sfx_thwomp; P_AddThwompThinker(lines[i].frontsector, &lines[i], lines[i].args[1] << (FRACBITS - 3), lines[i].args[2] << (FRACBITS - 3), sound); - P_AddFakeFloorsByLine(i, 0xff, TMB_TRANSLUCENT, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_CUTLEVEL, secthinkers); + P_AddFakeFloorsByLine(i, 0xff, TMB_TRANSLUCENT, FOF_EXISTS|FOF_SOLID|FOF_RENDERALL|FOF_CUTLEVEL, secthinkers); break; } @@ -6707,7 +6707,7 @@ void P_SpawnSpecials(boolean fromnetsave) UINT8 busttype = BT_REGULAR; ffloorbustflags_e bustflags = 0; - ffloorflags = FF_EXISTS|FF_BLOCKOTHERS|FF_RENDERALL|FF_BUSTUP; + ffloorflags = FOF_EXISTS|FOF_BLOCKOTHERS|FOF_RENDERALL|FOF_BUSTUP; //Bustable type switch (lines[i].args[3]) @@ -6734,10 +6734,10 @@ void P_SpawnSpecials(boolean fromnetsave) if (lines[i].args[4] & TMFB_ONLYBOTTOM) bustflags |= FB_ONLYBOTTOM; if (lines[i].args[4] & TMFB_SPLAT) - ffloorflags |= FF_SPLAT; + ffloorflags |= FOF_SPLAT; if (busttype != BT_TOUCH || bustflags & FB_ONLYBOTTOM) - ffloorflags |= FF_BLOCKPLAYER; + ffloorflags |= FOF_BLOCKPLAYER; TAG_ITER_SECTORS(lines[i].args[0], s) { @@ -6751,9 +6751,9 @@ void P_SpawnSpecials(boolean fromnetsave) break; } case 257: // Quicksand - ffloorflags = FF_EXISTS|FF_QUICKSAND|FF_RENDERALL|FF_ALLSIDES|FF_CUTSPRITES; + ffloorflags = FOF_EXISTS|FOF_QUICKSAND|FOF_RENDERALL|FOF_ALLSIDES|FOF_CUTSPRITES; if (!(lines[i].args[1])) - ffloorflags |= FF_RIPPLE; + ffloorflags |= FOF_RIPPLE; TAG_ITER_SECTORS(lines[i].args[0], s) { @@ -6766,10 +6766,10 @@ void P_SpawnSpecials(boolean fromnetsave) break; case 258: // Laser block - ffloorflags = FF_EXISTS|FF_RENDERALL|FF_NOSHADE|FF_EXTRA|FF_CUTEXTRA|FF_TRANSLUCENT; + ffloorflags = FOF_EXISTS|FOF_RENDERALL|FOF_NOSHADE|FOF_EXTRA|FOF_CUTEXTRA|FOF_TRANSLUCENT; P_AddLaserThinker(lines[i].args[0], lines + i, !!(lines[i].args[3] & TMFL_NOBOSSES)); if (lines[i].args[3] & TMFL_SPLAT) - ffloorflags |= FF_SPLAT; + ffloorflags |= FOF_SPLAT; P_AddFakeFloorsByLine(i, lines[i].args[1], lines[i].args[2], ffloorflags, secthinkers); break; @@ -6781,12 +6781,12 @@ void P_SpawnSpecials(boolean fromnetsave) continue; if (!udmf) // Ugly backwards compatibility stuff { - if (lines[i].args[3] & FF_QUICKSAND) + if (lines[i].args[3] & FOF_QUICKSAND) { fflr->sinkspeed = abs(lines[i].dx) >> 1; fflr->friction = abs(lines[i].dy) >> 6; } - if (lines[i].args[3] & FF_BUSTUP) + if (lines[i].args[3] & FOF_BUSTUP) { switch (lines[i].args[4] % TMFB_ONLYBOTTOM) { @@ -6829,31 +6829,31 @@ void P_SpawnSpecials(boolean fromnetsave) if (dtype == 0) dtype = 1; - ffloorflags = FF_EXISTS; + ffloorflags = FOF_EXISTS; - if (dflags2 & 1) ffloorflags |= FF_NOSHADE; // Disable light effects (Means no shadowcast) - if (dflags2 & 2) ffloorflags |= FF_DOUBLESHADOW; // Restrict light inside (Means doubleshadow) + if (dflags2 & 1) ffloorflags |= FOF_NOSHADE; // Disable light effects (Means no shadowcast) + if (dflags2 & 2) ffloorflags |= FOF_DOUBLESHADOW; // Restrict light inside (Means doubleshadow) if (dflags2 & 4) isfog = true; // Fog effect (Explicitly render like a fog block) - if (dflags1 & 4) ffloorflags |= FF_BOTHPLANES|FF_ALLSIDES; // Render-inside - if (dflags1 & 16) ffloorflags |= FF_INVERTSIDES|FF_INVERTPLANES; // Invert visibility rules + if (dflags1 & 4) ffloorflags |= FOF_BOTHPLANES|FOF_ALLSIDES; // Render-inside + if (dflags1 & 16) ffloorflags |= FOF_INVERTSIDES|FOF_INVERTPLANES; // Invert visibility rules // Fog block if (isfog) - ffloorflags |= FF_RENDERALL|FF_CUTEXTRA|FF_CUTSPRITES|FF_BOTHPLANES|FF_EXTRA|FF_FOG|FF_INVERTPLANES|FF_ALLSIDES|FF_INVERTSIDES; + ffloorflags |= FOF_RENDERALL|FOF_CUTEXTRA|FOF_CUTSPRITES|FOF_BOTHPLANES|FOF_EXTRA|FOF_FOG|FOF_INVERTPLANES|FOF_ALLSIDES|FOF_INVERTSIDES; else { - ffloorflags |= FF_RENDERALL; + ffloorflags |= FOF_RENDERALL; // Solid if (dtype == 1) - ffloorflags |= FF_SOLID|FF_CUTLEVEL; + ffloorflags |= FOF_SOLID|FOF_CUTLEVEL; // Water else if (dtype == 2) - ffloorflags |= FF_SWIMMABLE|FF_CUTEXTRA|FF_CUTSPRITES|FF_EXTRA|FF_RIPPLE; + ffloorflags |= FOF_SWIMMABLE|FOF_CUTEXTRA|FOF_CUTSPRITES|FOF_EXTRA|FOF_RIPPLE; // Intangible else if (dtype == 3) - ffloorflags |= FF_CUTEXTRA|FF_CUTSPRITES|FF_EXTRA; + ffloorflags |= FOF_CUTEXTRA|FOF_CUTSPRITES|FOF_EXTRA; } // Non-opaque @@ -6863,19 +6863,19 @@ void P_SpawnSpecials(boolean fromnetsave) if (dopacity == 0) { // True invisible - if (ffloorflags & FF_NOSHADE) - ffloorflags &= ~(FF_RENDERALL|FF_CUTEXTRA|FF_CUTSPRITES|FF_EXTRA|FF_BOTHPLANES|FF_ALLSIDES|FF_CUTLEVEL); + if (ffloorflags & FOF_NOSHADE) + ffloorflags &= ~(FOF_RENDERALL|FOF_CUTEXTRA|FOF_CUTSPRITES|FOF_EXTRA|FOF_BOTHPLANES|FOF_ALLSIDES|FOF_CUTLEVEL); // Shadow block else { - ffloorflags |= FF_CUTSPRITES; - ffloorflags &= ~(FF_RENDERALL|FF_CUTEXTRA|FF_EXTRA|FF_BOTHPLANES|FF_ALLSIDES|FF_CUTLEVEL); + ffloorflags |= FOF_CUTSPRITES; + ffloorflags &= ~(FOF_RENDERALL|FOF_CUTEXTRA|FOF_EXTRA|FOF_BOTHPLANES|FOF_ALLSIDES|FOF_CUTLEVEL); } } else { - ffloorflags |= FF_TRANSLUCENT|FF_CUTEXTRA|FF_EXTRA; - ffloorflags &= ~FF_CUTLEVEL; + ffloorflags |= FOF_TRANSLUCENT|FOF_CUTEXTRA|FOF_EXTRA; + ffloorflags &= ~FOF_CUTLEVEL; } } @@ -7067,8 +7067,8 @@ void P_SpawnSpecials(boolean fromnetsave) if (rover->master != lines + l) continue; - rover->flags |= FF_BUSTUP; - rover->spawnflags |= FF_BUSTUP; + rover->fofflags |= FOF_BUSTUP; + rover->spawnflags |= FOF_BUSTUP; rover->bustflags = bustflags; rover->busttype = busttype; rover->busttag = lines[i].args[3]; @@ -7098,8 +7098,8 @@ void P_SpawnSpecials(boolean fromnetsave) if (rover->master != lines + l) continue; - rover->flags |= FF_QUICKSAND; - rover->spawnflags |= FF_QUICKSAND; + rover->fofflags |= FOF_QUICKSAND; + rover->spawnflags |= FOF_QUICKSAND; rover->sinkspeed = abs(lines[i].args[1]) << (FRACBITS - 1); rover->friction = abs(lines[i].args[2]) << (FRACBITS - 6); CheckForQuicksand = true; @@ -7342,7 +7342,7 @@ void T_Scroll(scroll_t *s) if (!rover) // This should be impossible, but don't complain if it is the case somehow continue; - if (!(rover->flags & FF_EXISTS)) // If the FOF does not "exist", we pretend that nobody's there + if (!(rover->fofflags & FOF_EXISTS)) // If the FOF does not "exist", we pretend that nobody's there continue; for (node = psec->touching_thinglist; node; node = node->m_thinglist_next) @@ -7417,7 +7417,7 @@ void T_Scroll(scroll_t *s) if (!rover) // This should be impossible, but don't complain if it is the case somehow continue; - if (!(rover->flags & FF_EXISTS)) // If the FOF does not "exist", we pretend that nobody's there + if (!(rover->fofflags & FOF_EXISTS)) // If the FOF does not "exist", we pretend that nobody's there continue; for (node = psec->touching_thinglist; node; node = node->m_thinglist_next) @@ -7634,10 +7634,10 @@ void T_Disappear(disappear_t *d) continue; if (d->exists) - rover->flags &= ~FF_EXISTS; + rover->fofflags &= ~FOF_EXISTS; else { - rover->flags |= FF_EXISTS; + rover->fofflags |= FOF_EXISTS; if (!(lines[d->sourceline].args[5])) { @@ -7722,11 +7722,11 @@ static boolean P_FadeFakeFloor(ffloor_t *rover, INT16 sourcevalue, INT16 destval // If fading an invisible FOF whose render flags we did not yet set, // initialize its alpha to 1 if (dotranslucent && - (rover->spawnflags & FF_NOSHADE) && // do not include light blocks, which don't set FF_NOSHADE - !(rover->flags & FF_FOG) && // do not include fog - !(rover->spawnflags & FF_RENDERSIDES) && - !(rover->spawnflags & FF_RENDERPLANES) && - !(rover->flags & FF_RENDERALL)) + (rover->spawnflags & FOF_NOSHADE) && // do not include light blocks, which don't set FOF_NOSHADE + !(rover->fofflags & FOF_FOG) && // do not include fog + !(rover->spawnflags & FOF_RENDERSIDES) && + !(rover->spawnflags & FOF_RENDERPLANES) && + !(rover->fofflags & FOF_RENDERALL)) rover->alpha = 1; if (fadingdata) @@ -7747,16 +7747,16 @@ static boolean P_FadeFakeFloor(ffloor_t *rover, INT16 sourcevalue, INT16 destval if (docollision) { - if (rover->spawnflags & FF_SOLID) - rover->flags &= ~FF_SOLID; - if (rover->spawnflags & FF_SWIMMABLE) - rover->flags &= ~FF_SWIMMABLE; - if (rover->spawnflags & FF_QUICKSAND) - rover->flags &= ~FF_QUICKSAND; - if (rover->spawnflags & FF_BUSTUP) - rover->flags &= ~FF_BUSTUP; - if (rover->spawnflags & FF_MARIO) - rover->flags &= ~FF_MARIO; + if (rover->spawnflags & FOF_SOLID) + rover->fofflags &= ~FOF_SOLID; + if (rover->spawnflags & FOF_SWIMMABLE) + rover->fofflags &= ~FOF_SWIMMABLE; + if (rover->spawnflags & FOF_QUICKSAND) + rover->fofflags &= ~FOF_QUICKSAND; + if (rover->spawnflags & FOF_BUSTUP) + rover->fofflags &= ~FOF_BUSTUP; + if (rover->spawnflags & FOF_MARIO) + rover->fofflags &= ~FOF_MARIO; } } else // continue fading out @@ -7782,16 +7782,16 @@ static boolean P_FadeFakeFloor(ffloor_t *rover, INT16 sourcevalue, INT16 destval if (docollision) { - if (rover->spawnflags & FF_SOLID) - rover->flags |= FF_SOLID; - if (rover->spawnflags & FF_SWIMMABLE) - rover->flags |= FF_SWIMMABLE; - if (rover->spawnflags & FF_QUICKSAND) - rover->flags |= FF_QUICKSAND; - if (rover->spawnflags & FF_BUSTUP) - rover->flags |= FF_BUSTUP; - if (rover->spawnflags & FF_MARIO) - rover->flags |= FF_MARIO; + if (rover->spawnflags & FOF_SOLID) + rover->fofflags |= FOF_SOLID; + if (rover->spawnflags & FOF_SWIMMABLE) + rover->fofflags |= FOF_SWIMMABLE; + if (rover->spawnflags & FOF_QUICKSAND) + rover->fofflags |= FOF_QUICKSAND; + if (rover->spawnflags & FOF_BUSTUP) + rover->fofflags |= FOF_BUSTUP; + if (rover->spawnflags & FOF_MARIO) + rover->fofflags |= FOF_MARIO; } } else // continue fading in @@ -7811,114 +7811,114 @@ static boolean P_FadeFakeFloor(ffloor_t *rover, INT16 sourcevalue, INT16 destval // routines common to both fade in and fade out if (!stillfading) { - if (doexists && !(rover->spawnflags & FF_BUSTUP)) + if (doexists && !(rover->spawnflags & FOF_BUSTUP)) { if (alpha <= 1) - rover->flags &= ~FF_EXISTS; + rover->fofflags &= ~FOF_EXISTS; else - rover->flags |= FF_EXISTS; + rover->fofflags |= FOF_EXISTS; // Re-render lighting at end of fade - if (dolighting && !(rover->spawnflags & FF_NOSHADE) && !(rover->flags & FF_EXISTS)) + if (dolighting && !(rover->spawnflags & FOF_NOSHADE) && !(rover->fofflags & FOF_EXISTS)) rover->target->moved = true; } - if (dotranslucent && !(rover->flags & FF_FOG)) + if (dotranslucent && !(rover->fofflags & FOF_FOG)) { if (alpha >= 256) { - if (!(rover->flags & FF_CUTSOLIDS) && - (rover->spawnflags & FF_CUTSOLIDS)) + if (!(rover->fofflags & FOF_CUTSOLIDS) && + (rover->spawnflags & FOF_CUTSOLIDS)) { - rover->flags |= FF_CUTSOLIDS; + rover->fofflags |= FOF_CUTSOLIDS; rover->target->moved = true; } - rover->flags &= ~FF_TRANSLUCENT; + rover->fofflags &= ~FOF_TRANSLUCENT; } else { - rover->flags |= FF_TRANSLUCENT; + rover->fofflags |= FOF_TRANSLUCENT; - if ((rover->flags & FF_CUTSOLIDS) && - (rover->spawnflags & FF_CUTSOLIDS)) + if ((rover->fofflags & FOF_CUTSOLIDS) && + (rover->spawnflags & FOF_CUTSOLIDS)) { - rover->flags &= ~FF_CUTSOLIDS; + rover->fofflags &= ~FOF_CUTSOLIDS; rover->target->moved = true; } } - if ((rover->spawnflags & FF_NOSHADE) && // do not include light blocks, which don't set FF_NOSHADE - !(rover->spawnflags & FF_RENDERSIDES) && - !(rover->spawnflags & FF_RENDERPLANES)) + if ((rover->spawnflags & FOF_NOSHADE) && // do not include light blocks, which don't set FOF_NOSHADE + !(rover->spawnflags & FOF_RENDERSIDES) && + !(rover->spawnflags & FOF_RENDERPLANES)) { if (rover->alpha > 1) - rover->flags |= FF_RENDERALL; + rover->fofflags |= FOF_RENDERALL; else - rover->flags &= ~FF_RENDERALL; + rover->fofflags &= ~FOF_RENDERALL; } } } else { - if (doexists && !(rover->spawnflags & FF_BUSTUP)) + if (doexists && !(rover->spawnflags & FOF_BUSTUP)) { - // Re-render lighting if we haven't yet set FF_EXISTS (beginning of fade) - if (dolighting && !(rover->spawnflags & FF_NOSHADE) && !(rover->flags & FF_EXISTS)) + // Re-render lighting if we haven't yet set FOF_EXISTS (beginning of fade) + if (dolighting && !(rover->spawnflags & FOF_NOSHADE) && !(rover->fofflags & FOF_EXISTS)) rover->target->moved = true; - rover->flags |= FF_EXISTS; + rover->fofflags |= FOF_EXISTS; } - if (dotranslucent && !(rover->flags & FF_FOG)) + if (dotranslucent && !(rover->fofflags & FOF_FOG)) { - rover->flags |= FF_TRANSLUCENT; + rover->fofflags |= FOF_TRANSLUCENT; - if ((rover->flags & FF_CUTSOLIDS) && - (rover->spawnflags & FF_CUTSOLIDS)) + if ((rover->fofflags & FOF_CUTSOLIDS) && + (rover->spawnflags & FOF_CUTSOLIDS)) { - rover->flags &= ~FF_CUTSOLIDS; + rover->fofflags &= ~FOF_CUTSOLIDS; rover->target->moved = true; } - if ((rover->spawnflags & FF_NOSHADE) && // do not include light blocks, which don't set FF_NOSHADE - !(rover->spawnflags & FF_RENDERSIDES) && - !(rover->spawnflags & FF_RENDERPLANES)) - rover->flags |= FF_RENDERALL; + if ((rover->spawnflags & FOF_NOSHADE) && // do not include light blocks, which don't set FOF_NOSHADE + !(rover->spawnflags & FOF_RENDERSIDES) && + !(rover->spawnflags & FOF_RENDERPLANES)) + rover->fofflags |= FOF_RENDERALL; } if (docollision) { if (doghostfade) // remove collision flags during fade { - if (rover->spawnflags & FF_SOLID) - rover->flags &= ~FF_SOLID; - if (rover->spawnflags & FF_SWIMMABLE) - rover->flags &= ~FF_SWIMMABLE; - if (rover->spawnflags & FF_QUICKSAND) - rover->flags &= ~FF_QUICKSAND; - if (rover->spawnflags & FF_BUSTUP) - rover->flags &= ~FF_BUSTUP; - if (rover->spawnflags & FF_MARIO) - rover->flags &= ~FF_MARIO; + if (rover->spawnflags & FOF_SOLID) + rover->fofflags &= ~FOF_SOLID; + if (rover->spawnflags & FOF_SWIMMABLE) + rover->fofflags &= ~FOF_SWIMMABLE; + if (rover->spawnflags & FOF_QUICKSAND) + rover->fofflags &= ~FOF_QUICKSAND; + if (rover->spawnflags & FOF_BUSTUP) + rover->fofflags &= ~FOF_BUSTUP; + if (rover->spawnflags & FOF_MARIO) + rover->fofflags &= ~FOF_MARIO; } else // keep collision during fade { - if (rover->spawnflags & FF_SOLID) - rover->flags |= FF_SOLID; - if (rover->spawnflags & FF_SWIMMABLE) - rover->flags |= FF_SWIMMABLE; - if (rover->spawnflags & FF_QUICKSAND) - rover->flags |= FF_QUICKSAND; - if (rover->spawnflags & FF_BUSTUP) - rover->flags |= FF_BUSTUP; - if (rover->spawnflags & FF_MARIO) - rover->flags |= FF_MARIO; + if (rover->spawnflags & FOF_SOLID) + rover->fofflags |= FOF_SOLID; + if (rover->spawnflags & FOF_SWIMMABLE) + rover->fofflags |= FOF_SWIMMABLE; + if (rover->spawnflags & FOF_QUICKSAND) + rover->fofflags |= FOF_QUICKSAND; + if (rover->spawnflags & FOF_BUSTUP) + rover->fofflags |= FOF_BUSTUP; + if (rover->spawnflags & FOF_MARIO) + rover->fofflags |= FOF_MARIO; } } } - if (!(rover->flags & FF_FOG)) // don't set FOG alpha + if (!(rover->fofflags & FOF_FOG)) // don't set FOG alpha { if (!stillfading || exactalpha) rover->alpha = alpha; @@ -7961,8 +7961,8 @@ static boolean P_FadeFakeFloor(ffloor_t *rover, INT16 sourcevalue, INT16 destval * \param speed speed to fade by * \param ticbased tic-based logic, speed = duration * \param relative Destvalue is relative to rover->alpha - * \param doexists handle FF_EXISTS - * \param dotranslucent handle FF_TRANSLUCENT + * \param doexists handle FOF_EXISTS + * \param dotranslucent handle FOF_TRANSLUCENT * \param dolighting fade FOF light * \param docollision handle interactive flags * \param doghostfade no interactive flags during fading @@ -7978,10 +7978,10 @@ static void P_AddFakeFloorFader(ffloor_t *rover, size_t sectornum, size_t ffloor // If fading an invisible FOF whose render flags we did not yet set, // initialize its alpha to 1 if (dotranslucent && - (rover->spawnflags & FF_NOSHADE) && // do not include light blocks, which don't set FF_NOSHADE - !(rover->spawnflags & FF_RENDERSIDES) && - !(rover->spawnflags & FF_RENDERPLANES) && - !(rover->flags & FF_RENDERALL)) + (rover->spawnflags & FOF_NOSHADE) && // do not include light blocks, which don't set FOF_NOSHADE + !(rover->spawnflags & FOF_RENDERSIDES) && + !(rover->spawnflags & FOF_RENDERPLANES) && + !(rover->fofflags & FOF_RENDERALL)) rover->alpha = 1; // already equal, nothing to do @@ -8022,7 +8022,7 @@ static void P_AddFakeFloorFader(ffloor_t *rover, size_t sectornum, size_t ffloor P_ResetFakeFloorFader(rover, d, false); // Set a separate thinker for shadow fading - if (dolighting && !(rover->flags & FF_NOSHADE)) + if (dolighting && !(rover->fofflags & FOF_NOSHADE)) { UINT16 lightdelta = abs(sectors[rover->secnum].spawn_lightlevel - rover->target->lightlevel); fixed_t alphapercent = min(FixedDiv(d->destvalue, rover->spawnalpha), 1*FRACUNIT); // don't make darker than spawn_lightlevel @@ -8043,7 +8043,7 @@ static void P_AddFakeFloorFader(ffloor_t *rover, size_t sectornum, size_t ffloor d->destlightlevel = -1; // Set a separate thinker for colormap fading - if (docolormap && !(rover->flags & FF_NOSHADE) && sectors[rover->secnum].spawn_extra_colormap && !sectors[rover->secnum].colormap_protected) + if (docolormap && !(rover->fofflags & FOF_NOSHADE) && sectors[rover->secnum].spawn_extra_colormap && !sectors[rover->secnum].colormap_protected) { extracolormap_t *dest_exc, *source_exc = sectors[rover->secnum].extra_colormap ? sectors[rover->secnum].extra_colormap : R_GetDefaultColormap(); @@ -8104,11 +8104,11 @@ void T_Fade(fade_t *d) d->doexists, d->dotranslucent, d->dolighting, d->docolormap, d->docollision, d->doghostfade, d->exactalpha)) { // Finalize lighting, copypasta from P_AddFakeFloorFader - if (d->dolighting && !(d->rover->flags & FF_NOSHADE) && d->destlightlevel > -1) + if (d->dolighting && !(d->rover->fofflags & FOF_NOSHADE) && d->destlightlevel > -1) sectors[d->rover->secnum].lightlevel = d->destlightlevel; // Finalize colormap - if (d->docolormap && !(d->rover->flags & FF_NOSHADE) && sectors[d->rover->secnum].spawn_extra_colormap) + if (d->docolormap && !(d->rover->fofflags & FOF_NOSHADE) && sectors[d->rover->secnum].spawn_extra_colormap) sectors[d->rover->secnum].extra_colormap = d->dest_exc; P_RemoveFakeFloorFader(d->rover); diff --git a/src/p_spec.h b/src/p_spec.h index bdc912c34..07cf0717f 100644 --- a/src/p_spec.h +++ b/src/p_spec.h @@ -1028,8 +1028,8 @@ typedef struct INT16 speed; ///< Speed to fade by boolean ticbased; ///< Tic-based logic toggle INT32 timer; ///< Timer for tic-based logic - boolean doexists; ///< Handle FF_EXISTS - boolean dotranslucent; ///< Handle FF_TRANSLUCENT + boolean doexists; ///< Handle FOF_EXISTS + boolean dotranslucent; ///< Handle FOF_TRANSLUCENT boolean dolighting; ///< Handle shadows and light blocks boolean docolormap; ///< Handle colormaps boolean docollision; ///< Handle interactive flags diff --git a/src/p_user.c b/src/p_user.c index 10cc0dade..f32cf1044 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2209,7 +2209,7 @@ boolean P_InSpaceSector(mobj_t *mo) // Returns true if you are in space for (rover = sector->ffloors; rover; rover = rover->next) { - if (!(rover->flags & FF_EXISTS)) + if (!(rover->fofflags & FOF_EXISTS)) continue; if (!(rover->master->frontsector->specialflags & SSF_OUTERSPACE)) @@ -2462,10 +2462,10 @@ boolean P_InQuicksand(mobj_t *mo) // Returns true if you are in quicksand for (rover = sector->ffloors; rover; rover = rover->next) { - if (!(rover->flags & FF_EXISTS)) + if (!(rover->fofflags & FOF_EXISTS)) continue; - if (!(rover->flags & FF_QUICKSAND)) + if (!(rover->fofflags & FOF_QUICKSAND)) continue; topheight = P_GetFFloorTopZAt (rover, mo->x, mo->y); @@ -2486,10 +2486,10 @@ boolean P_InQuicksand(mobj_t *mo) // Returns true if you are in quicksand static boolean P_PlayerCanBust(player_t *player, ffloor_t *rover) { - if (!(rover->flags & FF_EXISTS)) + if (!(rover->fofflags & FOF_EXISTS)) return false; - if (!(rover->flags & FF_BUSTUP)) + if (!(rover->fofflags & FOF_BUSTUP)) return false; /*if (rover->master->frontsector->crumblestate != CRUMBLE_NONE) @@ -2701,17 +2701,17 @@ static void P_CheckBouncySectors(player_t *player) { fixed_t topheight, bottomheight; - if (!(rover->flags & FF_EXISTS)) + if (!(rover->fofflags & FOF_EXISTS)) continue; // FOFs should not be bouncy if they don't even "exist" // Handle deprecated bouncy FOF sector type if (!udmf && GETSECSPECIAL(rover->master->frontsector->special, 1) == 15) { - rover->flags |= FF_BOUNCY; + rover->fofflags |= FOF_BOUNCY; rover->bouncestrength = P_AproxDistance(rover->master->dx, rover->master->dy)/100; } - if (!(rover->flags & FF_BOUNCY)) + if (!(rover->fofflags & FOF_BOUNCY)) continue; topheight = P_GetFOFTopZ(player->mo, node->m_sector, rover, player->mo->x, player->mo->y, NULL); @@ -2784,9 +2784,9 @@ static void P_CheckQuicksand(player_t *player) for (rover = player->mo->subsector->sector->ffloors; rover; rover = rover->next) { - if (!(rover->flags & FF_EXISTS)) continue; + if (!(rover->fofflags & FOF_EXISTS)) continue; - if (!(rover->flags & FF_QUICKSAND)) + if (!(rover->fofflags & FOF_QUICKSAND)) continue; topheight = P_GetFFloorTopZAt (rover, player->mo->x, player->mo->y); @@ -3136,7 +3136,7 @@ static void P_DoClimbing(player_t *player) for (rover = glidesector->sector->ffloors; rover; rover = rover->next) { - if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_BLOCKPLAYER) || ((rover->flags & FF_BUSTUP) && (player->charflags & SF_CANBUSTWALLS))) + if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_BLOCKPLAYER) || ((rover->fofflags & FOF_BUSTUP) && (player->charflags & SF_CANBUSTWALLS))) continue; floorclimb = true; @@ -3177,7 +3177,7 @@ static void P_DoClimbing(player_t *player) // Is there a FOF directly below this one that we can move onto? for (roverbelow = glidesector->sector->ffloors; roverbelow; roverbelow = roverbelow->next) { - if (!(roverbelow->flags & FF_EXISTS) || !(roverbelow->flags & FF_BLOCKPLAYER) || ((rover->flags & FF_BUSTUP) && (player->charflags & SF_CANBUSTWALLS))) + if (!(roverbelow->fofflags & FOF_EXISTS) || !(roverbelow->fofflags & FOF_BLOCKPLAYER) || ((rover->fofflags & FOF_BUSTUP) && (player->charflags & SF_CANBUSTWALLS))) continue; if (roverbelow == rover) @@ -3222,7 +3222,7 @@ static void P_DoClimbing(player_t *player) // Is there a FOF directly below this one that we can move onto? for (roverbelow = glidesector->sector->ffloors; roverbelow; roverbelow = roverbelow->next) { - if (!(roverbelow->flags & FF_EXISTS) || !(roverbelow->flags & FF_BLOCKPLAYER) || ((rover->flags & FF_BUSTUP) && (player->charflags & SF_CANBUSTWALLS))) + if (!(roverbelow->fofflags & FOF_EXISTS) || !(roverbelow->fofflags & FOF_BLOCKPLAYER) || ((rover->fofflags & FOF_BUSTUP) && (player->charflags & SF_CANBUSTWALLS))) continue; if (roverbelow == rover) @@ -3256,8 +3256,8 @@ static void P_DoClimbing(player_t *player) if (floorclimb) { - if (rover->flags & FF_CRUMBLE && !(netgame && player->spectator)) - EV_StartCrumble(rover->master->frontsector, rover, (rover->flags & FF_FLOATBOB), player, rover->alpha, !(rover->flags & FF_NORETURN)); + if (rover->fofflags & FOF_CRUMBLE && !(netgame && player->spectator)) + EV_StartCrumble(rover->master->frontsector, rover, (rover->fofflags & FOF_FLOATBOB), player, rover->alpha, !(rover->fofflags & FOF_NORETURN)); break; } } @@ -3279,7 +3279,7 @@ static void P_DoClimbing(player_t *player) ffloor_t *rover; for (rover = glidesector->sector->ffloors; rover; rover = rover->next) { - if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_BLOCKPLAYER) || ((rover->flags & FF_BUSTUP) && (player->charflags & SF_CANBUSTWALLS))) + if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_BLOCKPLAYER) || ((rover->fofflags & FOF_BUSTUP) && (player->charflags & SF_CANBUSTWALLS))) continue; bottomheight = P_GetFFloorBottomZAt(rover, player->mo->x, player->mo->y); @@ -3319,7 +3319,7 @@ static void P_DoClimbing(player_t *player) ffloor_t *rover; for (rover = glidesector->sector->ffloors; rover; rover = rover->next) { - if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_BLOCKPLAYER) || ((rover->flags & FF_BUSTUP) && (player->charflags & SF_CANBUSTWALLS))) + if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_BLOCKPLAYER) || ((rover->fofflags & FOF_BUSTUP) && (player->charflags & SF_CANBUSTWALLS))) continue; topheight = P_GetFFloorTopZAt(rover, player->mo->x, player->mo->y); @@ -3693,14 +3693,14 @@ static void P_DoTeeter(player_t *player) for (rover = sec->ffloors; rover; rover = rover->next) { - if (!(rover->flags & FF_EXISTS)) continue; + if (!(rover->fofflags & FOF_EXISTS)) continue; topheight = P_GetFFloorTopZAt (rover, player->mo->x, player->mo->y); bottomheight = P_GetFFloorBottomZAt(rover, player->mo->x, player->mo->y); if (P_CheckSolidLava(rover)) ; - else if (!(rover->flags & FF_BLOCKPLAYER || rover->flags & FF_QUICKSAND)) + else if (!(rover->fofflags & FOF_BLOCKPLAYER || rover->fofflags & FOF_QUICKSAND)) continue; // intangible 3d floor if (player->mo->eflags & MFE_VERTICALFLIP) @@ -10072,7 +10072,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall for (rover = newsubsec->sector->ffloors; rover; rover = rover->next) { fixed_t topheight, bottomheight; - if (!(rover->flags & FF_BLOCKOTHERS) || !(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERALL) || (rover->master->frontsector->flags & MSF_NOCLIPCAMERA)) + if (!(rover->fofflags & FOF_BLOCKOTHERS) || !(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_RENDERALL) || (rover->master->frontsector->flags & MSF_NOCLIPCAMERA)) continue; topheight = P_CameraGetFOFTopZ(thiscam, newsubsec->sector, rover, midx, midy, NULL); @@ -10198,7 +10198,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall for (rover = newsubsec->sector->ffloors; rover; rover = rover->next) { fixed_t topheight, bottomheight; - if ((rover->flags & FF_BLOCKOTHERS) && (rover->flags & FF_RENDERALL) && (rover->flags & FF_EXISTS) && !(rover->master->frontsector->flags & MSF_NOCLIPCAMERA)) + if ((rover->fofflags & FOF_BLOCKOTHERS) && (rover->fofflags & FOF_RENDERALL) && (rover->fofflags & FOF_EXISTS) && !(rover->master->frontsector->flags & MSF_NOCLIPCAMERA)) { topheight = P_CameraGetFOFTopZ(thiscam, newsubsec->sector, rover, midx, midy, NULL); bottomheight = P_CameraGetFOFBottomZ(thiscam, newsubsec->sector, rover, midx, midy, NULL); @@ -10515,7 +10515,7 @@ static void P_CalcPostImg(player_t *player) for (rover = sector->ffloors; rover; rover = rover->next) { - if (!(rover->flags & FF_EXISTS)) + if (!(rover->fofflags & FOF_EXISTS)) continue; topheight = P_GetFFloorTopZAt (rover, player->mo->x, player->mo->y); @@ -10541,7 +10541,7 @@ static void P_CalcPostImg(player_t *player) for (rover = sector->ffloors; rover; rover = rover->next) { - if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_SWIMMABLE) || rover->flags & FF_BLOCKPLAYER) + if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_SWIMMABLE) || rover->fofflags & FOF_BLOCKPLAYER) continue; topheight = P_GetFFloorTopZAt (rover, player->mo->x, player->mo->y); @@ -10604,7 +10604,7 @@ static sector_t *P_GetMinecartSector(fixed_t x, fixed_t y, fixed_t z, fixed_t *n ffloor_t *rover; for (rover = sec->ffloors; rover; rover = rover->next) { - if (!(rover->flags & (FF_EXISTS|FF_BLOCKOTHERS))) + if (!(rover->fofflags & (FOF_EXISTS|FOF_BLOCKOTHERS))) continue; *nz = P_GetFFloorTopZAt(rover, x, y); @@ -12248,7 +12248,7 @@ static boolean P_MobjAboveLava(mobj_t *mobj) for (rover = sector->ffloors; rover; rover = rover->next) { - if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_SWIMMABLE)) + if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_SWIMMABLE)) continue; if (rover->master->frontsector->damagetype != SD_FIRE && rover->master->frontsector->damagetype != SD_LAVA) diff --git a/src/r_bsp.c b/src/r_bsp.c index f0a761d7b..c9591b254 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -919,7 +919,7 @@ static void R_Subsector(size_t num) for (rover = frontsector->ffloors; rover && numffloors < MAXFFLOORS; rover = rover->next) { - if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERPLANES)) + if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_RENDERPLANES)) continue; if (frontsector->cullheight) @@ -939,8 +939,8 @@ static void R_Subsector(size_t num) planecenterz = P_GetFFloorBottomZAt(rover, frontsector->soundorg.x, frontsector->soundorg.y); if (planecenterz <= ceilingcenterz && planecenterz >= floorcenterz - && ((viewz < heightcheck && (rover->flags & FF_BOTHPLANES || !(rover->flags & FF_INVERTPLANES))) - || (viewz > heightcheck && (rover->flags & FF_BOTHPLANES || rover->flags & FF_INVERTPLANES)))) + && ((viewz < heightcheck && (rover->fofflags & FOF_BOTHPLANES || !(rover->fofflags & FOF_INVERTPLANES))) + || (viewz > heightcheck && (rover->fofflags & FOF_BOTHPLANES || rover->fofflags & FOF_INVERTPLANES)))) { light = R_GetPlaneLight(frontsector, planecenterz, viewz < heightcheck); @@ -969,8 +969,8 @@ static void R_Subsector(size_t num) planecenterz = P_GetFFloorTopZAt(rover, frontsector->soundorg.x, frontsector->soundorg.y); if (planecenterz >= floorcenterz && planecenterz <= ceilingcenterz - && ((viewz > heightcheck && (rover->flags & FF_BOTHPLANES || !(rover->flags & FF_INVERTPLANES))) - || (viewz < heightcheck && (rover->flags & FF_BOTHPLANES || rover->flags & FF_INVERTPLANES)))) + && ((viewz > heightcheck && (rover->fofflags & FOF_BOTHPLANES || !(rover->fofflags & FOF_INVERTPLANES))) + || (viewz < heightcheck && (rover->fofflags & FOF_BOTHPLANES || rover->fofflags & FOF_INVERTPLANES)))) { light = R_GetPlaneLight(frontsector, planecenterz, viewz < heightcheck); @@ -1106,11 +1106,11 @@ void R_Prep3DFloors(sector_t *sector) count = 1; for (rover = sector->ffloors; rover; rover = rover->next) { - if ((rover->flags & FF_EXISTS) && (!(rover->flags & FF_NOSHADE) - || (rover->flags & FF_CUTLEVEL) || (rover->flags & FF_CUTSPRITES))) + if ((rover->fofflags & FOF_EXISTS) && (!(rover->fofflags & FOF_NOSHADE) + || (rover->fofflags & FOF_CUTLEVEL) || (rover->fofflags & FOF_CUTSPRITES))) { count++; - if (rover->flags & FF_DOUBLESHADOW) + if (rover->fofflags & FOF_DOUBLESHADOW) count++; } } @@ -1141,8 +1141,8 @@ void R_Prep3DFloors(sector_t *sector) for (rover = sector->ffloors; rover; rover = rover->next) { rover->lastlight = 0; - if (!(rover->flags & FF_EXISTS) || (rover->flags & FF_NOSHADE - && !(rover->flags & FF_CUTLEVEL) && !(rover->flags & FF_CUTSPRITES))) + if (!(rover->fofflags & FOF_EXISTS) || (rover->fofflags & FOF_NOSHADE + && !(rover->fofflags & FOF_CUTLEVEL) && !(rover->fofflags & FOF_CUTSPRITES))) continue; heighttest = P_GetFFloorTopZAt(rover, sector->soundorg.x, sector->soundorg.y); @@ -1154,7 +1154,7 @@ void R_Prep3DFloors(sector_t *sector) bestslope = *rover->t_slope; continue; } - if (rover->flags & FF_DOUBLESHADOW) { + if (rover->fofflags & FOF_DOUBLESHADOW) { heighttest = P_GetFFloorBottomZAt(rover, sector->soundorg.x, sector->soundorg.y); if (heighttest > bestheight @@ -1175,16 +1175,16 @@ void R_Prep3DFloors(sector_t *sector) sector->lightlist[i].height = maxheight = bestheight; sector->lightlist[i].caster = best; - sector->lightlist[i].flags = best->flags; + sector->lightlist[i].flags = best->fofflags; sector->lightlist[i].slope = bestslope; sec = §ors[best->secnum]; - if (best->flags & FF_NOSHADE) + if (best->fofflags & FOF_NOSHADE) { sector->lightlist[i].lightlevel = sector->lightlist[i-1].lightlevel; sector->lightlist[i].extra_colormap = sector->lightlist[i-1].extra_colormap; } - else if (best->flags & FF_COLORMAPONLY) + else if (best->fofflags & FOF_COLORMAPONLY) { sector->lightlist[i].lightlevel = sector->lightlist[i-1].lightlevel; sector->lightlist[i].extra_colormap = &sec->extra_colormap; @@ -1195,7 +1195,7 @@ void R_Prep3DFloors(sector_t *sector) sector->lightlist[i].extra_colormap = &sec->extra_colormap; } - if (best->flags & FF_DOUBLESHADOW) + if (best->fofflags & FOF_DOUBLESHADOW) { heighttest = P_GetFFloorBottomZAt(best, sector->soundorg.x, sector->soundorg.y); if (bestheight == heighttest) ///TODO: do this in a more efficient way -Red diff --git a/src/r_defs.h b/src/r_defs.h index 76fcaf2fc..6c9c91ab1 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -115,41 +115,41 @@ typedef struct */ typedef enum { - FF_EXISTS = 0x1, ///< Always set, to check for validity. - FF_BLOCKPLAYER = 0x2, ///< Solid to player, but nothing else - FF_BLOCKOTHERS = 0x4, ///< Solid to everything but player - FF_SOLID = 0x6, ///< Clips things. - FF_RENDERSIDES = 0x8, ///< Renders the sides. - FF_RENDERPLANES = 0x10, ///< Renders the floor/ceiling. - FF_RENDERALL = 0x18, ///< Renders everything. - FF_SWIMMABLE = 0x20, ///< Is a water block. - FF_NOSHADE = 0x40, ///< Messes with the lighting? - FF_CUTSOLIDS = 0x80, ///< Cuts out hidden solid pixels. - FF_CUTEXTRA = 0x100, ///< Cuts out hidden translucent pixels. - FF_CUTLEVEL = 0x180, ///< Cuts out all hidden pixels. - FF_CUTSPRITES = 0x200, ///< Final step in making 3D water. - FF_BOTHPLANES = 0x400, ///< Render inside and outside planes. - FF_EXTRA = 0x800, ///< Gets cut by ::FF_CUTEXTRA. - FF_TRANSLUCENT = 0x1000, ///< See through! - FF_FOG = 0x2000, ///< Fog "brush." - FF_INVERTPLANES = 0x4000, ///< Only render inside planes. - FF_ALLSIDES = 0x8000, ///< Render inside and outside sides. - FF_INVERTSIDES = 0x10000, ///< Only render inside sides. - FF_DOUBLESHADOW = 0x20000, ///< Make two lightlist entries to reset light? - FF_FLOATBOB = 0x40000, ///< Floats on water and bobs if you step on it. - FF_NORETURN = 0x80000, ///< Used with ::FF_CRUMBLE. Will not return to its original position after falling. - FF_CRUMBLE = 0x100000, ///< Falls 2 seconds after being stepped on, and randomly brings all touching crumbling 3dfloors down with it, providing their master sectors share the same tag (allows crumble platforms above or below, to also exist). - FF_GOOWATER = 0x200000, ///< Used with ::FF_SWIMMABLE. Makes thick bouncey goop. - FF_MARIO = 0x400000, ///< Acts like a question block when hit from underneath. Goodie spawned at top is determined by master sector. - FF_BUSTUP = 0x800000, ///< You can spin through/punch this block and it will crumble! - FF_QUICKSAND = 0x1000000, ///< Quicksand! - FF_PLATFORM = 0x2000000, ///< You can jump up through this to the top. - FF_REVERSEPLATFORM = 0x4000000, ///< A fall-through floor in normal gravity, a platform in reverse gravity. - FF_INTANGIBLEFLATS = 0x6000000, ///< Both flats are intangible, but the sides are still solid. - FF_RIPPLE = 0x8000000, ///< Ripple the flats - FF_COLORMAPONLY = 0x10000000, ///< Only copy the colormap, not the lightlevel - FF_BOUNCY = 0x20000000, ///< Bounces players - FF_SPLAT = 0x40000000, ///< Use splat flat renderer (treat cyan pixels as invisible) + FOF_EXISTS = 0x1, ///< Always set, to check for validity. + FOF_BLOCKPLAYER = 0x2, ///< Solid to player, but nothing else + FOF_BLOCKOTHERS = 0x4, ///< Solid to everything but player + FOF_SOLID = 0x6, ///< Clips things. + FOF_RENDERSIDES = 0x8, ///< Renders the sides. + FOF_RENDERPLANES = 0x10, ///< Renders the floor/ceiling. + FOF_RENDERALL = 0x18, ///< Renders everything. + FOF_SWIMMABLE = 0x20, ///< Is a water block. + FOF_NOSHADE = 0x40, ///< Messes with the lighting? + FOF_CUTSOLIDS = 0x80, ///< Cuts out hidden solid pixels. + FOF_CUTEXTRA = 0x100, ///< Cuts out hidden translucent pixels. + FOF_CUTLEVEL = 0x180, ///< Cuts out all hidden pixels. + FOF_CUTSPRITES = 0x200, ///< Final step in making 3D water. + FOF_BOTHPLANES = 0x400, ///< Render inside and outside planes. + FOF_EXTRA = 0x800, ///< Gets cut by ::FOF_CUTEXTRA. + FOF_TRANSLUCENT = 0x1000, ///< See through! + FOF_FOG = 0x2000, ///< Fog "brush." + FOF_INVERTPLANES = 0x4000, ///< Only render inside planes. + FOF_ALLSIDES = 0x8000, ///< Render inside and outside sides. + FOF_INVERTSIDES = 0x10000, ///< Only render inside sides. + FOF_DOUBLESHADOW = 0x20000, ///< Make two lightlist entries to reset light? + FOF_FLOATBOB = 0x40000, ///< Floats on water and bobs if you step on it. + FOF_NORETURN = 0x80000, ///< Used with ::FOF_CRUMBLE. Will not return to its original position after falling. + FOF_CRUMBLE = 0x100000, ///< Falls 2 seconds after being stepped on, and randomly brings all touching crumbling 3dfloors down with it, providing their master sectors share the same tag (allows crumble platforms above or below, to also exist). + FOF_GOOWATER = 0x200000, ///< Used with ::FOF_SWIMMABLE. Makes thick bouncey goop. + FOF_MARIO = 0x400000, ///< Acts like a question block when hit from underneath. Goodie spawned at top is determined by master sector. + FOF_BUSTUP = 0x800000, ///< You can spin through/punch this block and it will crumble! + FOF_QUICKSAND = 0x1000000, ///< Quicksand! + FOF_PLATFORM = 0x2000000, ///< You can jump up through this to the top. + FOF_REVERSEPLATFORM = 0x4000000, ///< A fall-through floor in normal gravity, a platform in reverse gravity. + FOF_INTANGIBLEFLATS = 0x6000000, ///< Both flats are intangible, but the sides are still solid. + FOF_RIPPLE = 0x8000000, ///< Ripple the flats + FOF_COLORMAPONLY = 0x10000000, ///< Only copy the colormap, not the lightlevel + FOF_BOUNCY = 0x20000000, ///< Bounces players + FOF_SPLAT = 0x40000000, ///< Use splat flat renderer (treat cyan pixels as invisible) } ffloortype_e; typedef enum @@ -228,7 +228,7 @@ typedef struct ffloor_s struct pslope_s **b_slope; size_t secnum; - ffloortype_e flags; + ffloortype_e fofflags; struct line_s *master; struct sector_s *target; @@ -241,16 +241,16 @@ typedef struct ffloor_s UINT8 blend; // blendmode tic_t norender; // for culling - // Only relevant for FF_BUSTUP + // Only relevant for FOF_BUSTUP ffloorbustflags_e bustflags; UINT8 busttype; INT16 busttag; - // Only relevant for FF_QUICKSAND + // Only relevant for FOF_QUICKSAND fixed_t sinkspeed; fixed_t friction; - // Only relevant for FF_BOUNCY + // Only relevant for FOF_BOUNCY fixed_t bouncestrength; // these are saved for netgames, so do not let Lua touch these! @@ -271,7 +271,7 @@ typedef struct lightlist_s extracolormap_t **extra_colormap; // pointer-to-a-pointer, so we can react to colormap changes INT32 flags; ffloor_t *caster; - struct pslope_s *slope; // FF_DOUBLESHADOW makes me have to store this pointer here. Bluh bluh. + struct pslope_s *slope; // FOF_DOUBLESHADOW makes me have to store this pointer here. Bluh bluh. } lightlist_t; diff --git a/src/r_draw8.c b/src/r_draw8.c index c9a9e9575..4504ad1bd 100644 --- a/src/r_draw8.c +++ b/src/r_draw8.c @@ -2128,7 +2128,7 @@ void R_DrawColumnShadowed_8(void) { // If the height of the light is above the column, get the colormap // anyway because the lighting of the top should be affected. - solid = dc_lightlist[i].flags & FF_CUTSOLIDS; + solid = dc_lightlist[i].flags & FOF_CUTSOLIDS; height = dc_lightlist[i].height >> LIGHTSCALESHIFT; if (solid) diff --git a/src/r_plane.c b/src/r_plane.c index 7ea10f616..5f0ed9340 100644 --- a/src/r_plane.c +++ b/src/r_plane.c @@ -836,13 +836,13 @@ void R_DrawSinglePlane(visplane_t *pl) // Don't draw planes that shouldn't be drawn. for (rover = pl->ffloor->target->ffloors; rover; rover = rover->next) { - if ((pl->ffloor->flags & FF_CUTEXTRA) && (rover->flags & FF_EXTRA)) + if ((pl->ffloor->fofflags & FOF_CUTEXTRA) && (rover->fofflags & FOF_EXTRA)) { - if (pl->ffloor->flags & FF_EXTRA) + if (pl->ffloor->fofflags & FOF_EXTRA) { // The plane is from an extra 3D floor... Check the flags so // there are no undesired cuts. - if (((pl->ffloor->flags & (FF_FOG|FF_SWIMMABLE)) == (rover->flags & (FF_FOG|FF_SWIMMABLE))) + if (((pl->ffloor->fofflags & (FOF_FOG|FOF_SWIMMABLE)) == (rover->fofflags & (FOF_FOG|FOF_SWIMMABLE))) && pl->height < *rover->topheight && pl->height > *rover->bottomheight) return; @@ -850,9 +850,9 @@ void R_DrawSinglePlane(visplane_t *pl) } } - if (pl->ffloor->flags & FF_TRANSLUCENT) + if (pl->ffloor->fofflags & FOF_TRANSLUCENT) { - spanfunctype = (pl->ffloor->flags & FF_SPLAT) ? SPANDRAWFUNC_TRANSSPLAT : SPANDRAWFUNC_TRANS; + spanfunctype = (pl->ffloor->fofflags & FOF_SPLAT) ? SPANDRAWFUNC_TRANSSPLAT : SPANDRAWFUNC_TRANS; // Hacked up support for alpha value in software mode Tails 09-24-2002 // ...unhacked by toaster 04-01-2021, re-hacked a little by sphere 19-11-2021 @@ -871,14 +871,14 @@ void R_DrawSinglePlane(visplane_t *pl) else light = LIGHTLEVELS-1; } - else if (pl->ffloor->flags & FF_FOG) + else if (pl->ffloor->fofflags & FOF_FOG) { spanfunctype = SPANDRAWFUNC_FOG; light = (pl->lightlevel >> LIGHTSEGSHIFT); } else light = (pl->lightlevel >> LIGHTSEGSHIFT); - if (pl->ffloor->flags & FF_RIPPLE) + if (pl->ffloor->fofflags & FOF_RIPPLE) { INT32 top, bottom; diff --git a/src/r_segs.c b/src/r_segs.c index c9f5f0d7b..43a7f945f 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -244,7 +244,7 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2) rlight->flags = light->flags; if ((colfunc != colfuncs[COLDRAWFUNC_FUZZY]) - || (rlight->flags & FF_FOG) + || (rlight->flags & FOF_FOG) || (rlight->extra_colormap && (rlight->extra_colormap->flags & CMF_FOG))) lightnum = (rlight->lightlevel >> LIGHTSEGSHIFT); else @@ -387,7 +387,7 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2) { rlight = &dc_lightlist[i]; - if ((rlight->flags & FF_NOSHADE)) + if ((rlight->flags & FOF_NOSHADE)) continue; if (rlight->lightnum < 0) @@ -547,7 +547,7 @@ static boolean R_IsFFloorTranslucent(visffloor_t *pfloor) // Polyobjects have no ffloors, and they're handled in the conditional above. if (pfloor->ffloor != NULL) - return (pfloor->ffloor->flags & (FF_TRANSLUCENT|FF_FOG)); + return (pfloor->ffloor->fofflags & (FOF_TRANSLUCENT|FOF_FOG)); return false; } @@ -602,7 +602,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) texnum = R_GetTextureNum(sides[newline->sidenum[0]].midtexture); } - if (pfloor->flags & FF_TRANSLUCENT) + if (pfloor->fofflags & FOF_TRANSLUCENT) { boolean fuzzy = true; @@ -621,7 +621,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) if (fuzzy) colfunc = colfuncs[COLDRAWFUNC_FUZZY]; } - else if (pfloor->flags & FF_FOG) + else if (pfloor->fofflags & FOF_FOG) colfunc = colfuncs[COLDRAWFUNC_FOG]; range = max(ds->x2-ds->x1, 1); @@ -684,7 +684,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) else rlight->heightstep = CLAMPMIN; rlight->heightstep = (rlight->heightstep-rlight->height)/(range); rlight->flags = light->flags; - if (light->flags & FF_CUTLEVEL) + if (light->flags & FOF_CUTLEVEL) { SLOPEPARAMS(*light->caster->b_slope, leftheight, rightheight, *light->caster->bottomheight) #undef SLOPEPARAMS @@ -708,12 +708,12 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) rlight->extra_colormap = *light->extra_colormap; // Check if the current light effects the colormap/lightlevel - if (pfloor->flags & FF_FOG) + if (pfloor->fofflags & FOF_FOG) rlight->lightnum = (pfloor->master->frontsector->lightlevel >> LIGHTSEGSHIFT); else rlight->lightnum = (rlight->lightlevel >> LIGHTSEGSHIFT); - if (pfloor->flags & FF_FOG || rlight->flags & FF_FOG || (rlight->extra_colormap && (rlight->extra_colormap->flags & CMF_FOG))) + if (pfloor->fofflags & FOF_FOG || rlight->flags & FOF_FOG || (rlight->extra_colormap && (rlight->extra_colormap->flags & CMF_FOG))) ; else if (curline->v1->y == curline->v2->y) rlight->lightnum--; @@ -730,7 +730,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) // Get correct light level! if ((frontsector->extra_colormap && (frontsector->extra_colormap->flags & CMF_FOG))) lightnum = (frontsector->lightlevel >> LIGHTSEGSHIFT); - else if (pfloor->flags & FF_FOG) + else if (pfloor->fofflags & FOF_FOG) lightnum = (pfloor->master->frontsector->lightlevel >> LIGHTSEGSHIFT); else if (colfunc == colfuncs[COLDRAWFUNC_FUZZY]) lightnum = LIGHTLEVELS-1; @@ -738,7 +738,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) lightnum = R_FakeFlat(frontsector, &tempsec, &templight, &templight, false) ->lightlevel >> LIGHTSEGSHIFT; - if (pfloor->flags & FF_FOG || (frontsector->extra_colormap && (frontsector->extra_colormap->flags & CMF_FOG))); + if (pfloor->fofflags & FOF_FOG || (frontsector->extra_colormap && (frontsector->extra_colormap->flags & CMF_FOG))); else if (curline->v1->y == curline->v2->y) lightnum--; else if (curline->v1->x == curline->v2->x) @@ -885,7 +885,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) { rlight = &dc_lightlist[i]; rlight->height += rlight->heightstep; - if (rlight->flags & FF_CUTLEVEL) + if (rlight->flags & FOF_CUTLEVEL) rlight->botheight += rlight->botheightstep; } } @@ -912,7 +912,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) { // Check if the current light effects the colormap/lightlevel rlight = &dc_lightlist[i]; - lighteffect = !(dc_lightlist[i].flags & FF_NOSHADE); + lighteffect = !(dc_lightlist[i].flags & FOF_NOSHADE); if (lighteffect) { lightnum = rlight->lightnum; @@ -929,7 +929,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) if (pindex >= MAXLIGHTSCALE) pindex = MAXLIGHTSCALE-1; - if (pfloor->flags & FF_FOG) + if (pfloor->fofflags & FOF_FOG) { if (pfloor->master->frontsector->extra_colormap) rlight->rcolormap = pfloor->master->frontsector->extra_colormap->colormap + (xwalllights[pindex] - colormaps); @@ -948,15 +948,15 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) solid = 0; // don't carry over solid-cutting flag from the previous light // Check if the current light can cut the current 3D floor. - if (rlight->flags & FF_CUTSOLIDS && !(pfloor->flags & FF_EXTRA)) + if (rlight->flags & FOF_CUTSOLIDS && !(pfloor->fofflags & FOF_EXTRA)) solid = 1; - else if (rlight->flags & FF_CUTEXTRA && pfloor->flags & FF_EXTRA) + else if (rlight->flags & FOF_CUTEXTRA && pfloor->fofflags & FOF_EXTRA) { - if (rlight->flags & FF_EXTRA) + if (rlight->flags & FOF_EXTRA) { // The light is from an extra 3D floor... Check the flags so // there are no undesired cuts. - if ((rlight->flags & (FF_FOG|FF_SWIMMABLE)) == (pfloor->flags & (FF_FOG|FF_SWIMMABLE))) + if ((rlight->flags & (FOF_FOG|FOF_SWIMMABLE)) == (pfloor->fofflags & (FOF_FOG|FOF_SWIMMABLE))) solid = 1; } else @@ -993,7 +993,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) { rlight = &dc_lightlist[i]; rlight->height += rlight->heightstep; - if (rlight->flags & FF_CUTLEVEL) + if (rlight->flags & FOF_CUTLEVEL) rlight->botheight += rlight->botheightstep; } continue; @@ -1024,7 +1024,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) dc_colormap = walllights[pindex]; - if (pfloor->flags & FF_FOG && pfloor->master->frontsector->extra_colormap) + if (pfloor->fofflags & FOF_FOG && pfloor->master->frontsector->extra_colormap) dc_colormap = pfloor->master->frontsector->extra_colormap->colormap + (dc_colormap - colormaps); else if (frontsector->extra_colormap) dc_colormap = frontsector->extra_colormap->colormap + (dc_colormap - colormaps); @@ -1466,7 +1466,7 @@ static void R_RenderSegLoop (void) for (i = 0; i < dc_numlights; i++) { dc_lightlist[i].height += dc_lightlist[i].heightstep; - if (dc_lightlist[i].flags & FF_CUTSOLIDS) + if (dc_lightlist[i].flags & FOF_CUTSOLIDS) dc_lightlist[i].botheight += dc_lightlist[i].botheightstep; } } @@ -2052,9 +2052,9 @@ void R_StoreWallRange(INT32 start, INT32 stop) i = 0; for (rover = backsector->ffloors; rover && i < MAXFFLOORS; rover = rover->next) { - if (!(rover->flags & FF_RENDERSIDES) || !(rover->flags & FF_EXISTS)) + if (!(rover->fofflags & FOF_RENDERSIDES) || !(rover->fofflags & FOF_EXISTS)) continue; - if (!(rover->flags & FF_ALLSIDES) && rover->flags & FF_INVERTSIDES) + if (!(rover->fofflags & FOF_ALLSIDES) && rover->fofflags & FOF_INVERTSIDES) continue; if (rover->norender == leveltime) @@ -2071,23 +2071,23 @@ void R_StoreWallRange(INT32 start, INT32 stop) if (r2->master == rover->master) // Skip if same control line. break; - if (!(r2->flags & FF_EXISTS) || !(r2->flags & FF_RENDERSIDES)) + if (!(r2->fofflags & FOF_EXISTS) || !(r2->fofflags & FOF_RENDERSIDES)) continue; if (r2->norender == leveltime) continue; - if (rover->flags & FF_EXTRA) + if (rover->fofflags & FOF_EXTRA) { - if (!(r2->flags & FF_CUTEXTRA)) + if (!(r2->fofflags & FOF_CUTEXTRA)) continue; - if (r2->flags & FF_EXTRA && (r2->flags & (FF_TRANSLUCENT|FF_FOG)) != (rover->flags & (FF_TRANSLUCENT|FF_FOG))) + if (r2->fofflags & FOF_EXTRA && (r2->fofflags & (FOF_TRANSLUCENT|FOF_FOG)) != (rover->fofflags & (FOF_TRANSLUCENT|FOF_FOG))) continue; } else { - if (!(r2->flags & FF_CUTSOLIDS)) + if (!(r2->fofflags & FOF_CUTSOLIDS)) continue; } @@ -2110,9 +2110,9 @@ void R_StoreWallRange(INT32 start, INT32 stop) for (rover = frontsector->ffloors; rover && i < MAXFFLOORS; rover = rover->next) { - if (!(rover->flags & FF_RENDERSIDES) || !(rover->flags & FF_EXISTS)) + if (!(rover->fofflags & FOF_RENDERSIDES) || !(rover->fofflags & FOF_EXISTS)) continue; - if (!(rover->flags & FF_ALLSIDES || rover->flags & FF_INVERTSIDES)) + if (!(rover->fofflags & FOF_ALLSIDES || rover->fofflags & FOF_INVERTSIDES)) continue; if (rover->norender == leveltime) @@ -2129,23 +2129,23 @@ void R_StoreWallRange(INT32 start, INT32 stop) if (r2->master == rover->master) // Skip if same control line. break; - if (!(r2->flags & FF_EXISTS) || !(r2->flags & FF_RENDERSIDES)) + if (!(r2->fofflags & FOF_EXISTS) || !(r2->fofflags & FOF_RENDERSIDES)) continue; if (r2->norender == leveltime) continue; - if (rover->flags & FF_EXTRA) + if (rover->fofflags & FOF_EXTRA) { - if (!(r2->flags & FF_CUTEXTRA)) + if (!(r2->fofflags & FOF_CUTEXTRA)) continue; - if (r2->flags & FF_EXTRA && (r2->flags & (FF_TRANSLUCENT|FF_FOG)) != (rover->flags & (FF_TRANSLUCENT|FF_FOG))) + if (r2->fofflags & FOF_EXTRA && (r2->fofflags & (FOF_TRANSLUCENT|FOF_FOG)) != (rover->fofflags & (FOF_TRANSLUCENT|FOF_FOG))) continue; } else { - if (!(r2->flags & FF_CUTSOLIDS)) + if (!(r2->fofflags & FOF_CUTSOLIDS)) continue; } @@ -2170,9 +2170,9 @@ void R_StoreWallRange(INT32 start, INT32 stop) { for (rover = backsector->ffloors, i = 0; rover && i < MAXFFLOORS; rover = rover->next) { - if (!(rover->flags & FF_RENDERSIDES) || !(rover->flags & FF_EXISTS)) + if (!(rover->fofflags & FOF_RENDERSIDES) || !(rover->fofflags & FOF_EXISTS)) continue; - if (!(rover->flags & FF_ALLSIDES) && rover->flags & FF_INVERTSIDES) + if (!(rover->fofflags & FOF_ALLSIDES) && rover->fofflags & FOF_INVERTSIDES) continue; if (rover->norender == leveltime) continue; @@ -2192,9 +2192,9 @@ void R_StoreWallRange(INT32 start, INT32 stop) { for (rover = frontsector->ffloors, i = 0; rover && i < MAXFFLOORS; rover = rover->next) { - if (!(rover->flags & FF_RENDERSIDES) || !(rover->flags & FF_EXISTS)) + if (!(rover->fofflags & FOF_RENDERSIDES) || !(rover->fofflags & FOF_EXISTS)) continue; - if (!(rover->flags & FF_ALLSIDES || rover->flags & FF_INVERTSIDES)) + if (!(rover->fofflags & FOF_ALLSIDES || rover->fofflags & FOF_INVERTSIDES)) continue; if (rover->norender == leveltime) continue; @@ -2416,7 +2416,7 @@ void R_StoreWallRange(INT32 start, INT32 stop) rlight->heightstep = (rlight->heightstep-rlight->height)/(range); rlight->flags = light->flags; - if (light->caster && light->caster->flags & FF_CUTSOLIDS) + if (light->caster && light->caster->fofflags & FOF_CUTSOLIDS) { leftheight = P_GetFFloorBottomZAt(light->caster, segleft.x, segleft.y); rightheight = P_GetFFloorBottomZAt(light->caster, segright.x, segright.y); @@ -2503,7 +2503,7 @@ void R_StoreWallRange(INT32 start, INT32 stop) { for (rover = backsector->ffloors; rover && i < MAXFFLOORS; rover = rover->next) { - if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERPLANES)) + if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_RENDERPLANES)) continue; if (rover->norender == leveltime) continue; @@ -2518,8 +2518,8 @@ void R_StoreWallRange(INT32 start, INT32 stop) if ((roverleft>>4 <= worldhigh || roverright>>4 <= worldhighslope) && (roverleft>>4 >= worldlow || roverright>>4 >= worldlowslope) && - ((viewz < planevistest && (rover->flags & FF_BOTHPLANES || !(rover->flags & FF_INVERTPLANES))) || - (viewz > planevistest && (rover->flags & FF_BOTHPLANES || rover->flags & FF_INVERTPLANES)))) + ((viewz < planevistest && (rover->fofflags & FOF_BOTHPLANES || !(rover->fofflags & FOF_INVERTPLANES))) || + (viewz > planevistest && (rover->fofflags & FOF_BOTHPLANES || rover->fofflags & FOF_INVERTPLANES)))) { //ffloor[i].slope = *rover->b_slope; ffloor[i].b_pos = roverleft; @@ -2541,8 +2541,8 @@ void R_StoreWallRange(INT32 start, INT32 stop) if ((roverleft>>4 <= worldhigh || roverright>>4 <= worldhighslope) && (roverleft>>4 >= worldlow || roverright>>4 >= worldlowslope) && - ((viewz > planevistest && (rover->flags & FF_BOTHPLANES || !(rover->flags & FF_INVERTPLANES))) || - (viewz < planevistest && (rover->flags & FF_BOTHPLANES || rover->flags & FF_INVERTPLANES)))) + ((viewz > planevistest && (rover->fofflags & FOF_BOTHPLANES || !(rover->fofflags & FOF_INVERTPLANES))) || + (viewz < planevistest && (rover->fofflags & FOF_BOTHPLANES || rover->fofflags & FOF_INVERTPLANES)))) { //ffloor[i].slope = *rover->t_slope; ffloor[i].b_pos = roverleft; @@ -2560,7 +2560,7 @@ void R_StoreWallRange(INT32 start, INT32 stop) { for (rover = frontsector->ffloors; rover && i < MAXFFLOORS; rover = rover->next) { - if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERPLANES)) + if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_RENDERPLANES)) continue; if (rover->norender == leveltime) continue; @@ -2575,8 +2575,8 @@ void R_StoreWallRange(INT32 start, INT32 stop) if ((roverleft>>4 <= worldhigh || roverright>>4 <= worldhighslope) && (roverleft>>4 >= worldlow || roverright>>4 >= worldlowslope) && - ((viewz < planevistest && (rover->flags & FF_BOTHPLANES || !(rover->flags & FF_INVERTPLANES))) || - (viewz > planevistest && (rover->flags & FF_BOTHPLANES || rover->flags & FF_INVERTPLANES)))) + ((viewz < planevistest && (rover->fofflags & FOF_BOTHPLANES || !(rover->fofflags & FOF_INVERTPLANES))) || + (viewz > planevistest && (rover->fofflags & FOF_BOTHPLANES || rover->fofflags & FOF_INVERTPLANES)))) { //ffloor[i].slope = *rover->b_slope; ffloor[i].b_pos = roverleft; @@ -2598,8 +2598,8 @@ void R_StoreWallRange(INT32 start, INT32 stop) if ((roverleft>>4 <= worldhigh || roverright>>4 <= worldhighslope) && (roverleft>>4 >= worldlow || roverright>>4 >= worldlowslope) && - ((viewz > planevistest && (rover->flags & FF_BOTHPLANES || !(rover->flags & FF_INVERTPLANES))) || - (viewz < planevistest && (rover->flags & FF_BOTHPLANES || rover->flags & FF_INVERTPLANES)))) + ((viewz > planevistest && (rover->fofflags & FOF_BOTHPLANES || !(rover->fofflags & FOF_INVERTPLANES))) || + (viewz < planevistest && (rover->fofflags & FOF_BOTHPLANES || rover->fofflags & FOF_INVERTPLANES)))) { //ffloor[i].slope = *rover->t_slope; ffloor[i].b_pos = roverleft; diff --git a/src/r_things.c b/src/r_things.c index db4263a6a..10ab1be7b 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1055,7 +1055,7 @@ static void R_SplitSprite(vissprite_t *sprite) { fixed_t testheight; - if (!(sector->lightlist[i].caster->flags & FF_CUTSPRITES)) + if (!(sector->lightlist[i].caster->fofflags & FOF_CUTSPRITES)) continue; testheight = P_GetLightZAt(§or->lightlist[i], sprite->gx, sprite->gy); @@ -1096,7 +1096,7 @@ static void R_SplitSprite(vissprite_t *sprite) newsprite->szt -= 8; newsprite->cut |= SC_TOP; - if (!(sector->lightlist[i].caster->flags & FF_NOSHADE)) + if (!(sector->lightlist[i].caster->fofflags & FOF_NOSHADE)) { lightnum = (*sector->lightlist[i].lightlevel >> LIGHTSEGSHIFT); @@ -1162,7 +1162,7 @@ fixed_t R_GetShadowZ(mobj_t *thing, pslope_t **shadowslope) if (sector->ffloors) for (rover = sector->ffloors; rover; rover = rover->next) { - if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERPLANES) || (rover->alpha < 90 && !(rover->flags & FF_SWIMMABLE))) + if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_RENDERPLANES) || (rover->alpha < 90 && !(rover->fofflags & FOF_SWIMMABLE))) continue; z = isflipped ? P_GetFFloorBottomZAt(rover, thing->x, thing->y) : P_GetFFloorTopZAt(rover, thing->x, thing->y); From 1049eca15ebc0695539a57613b772ebdf432e979 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Sun, 31 Jul 2022 13:01:45 +0200 Subject: [PATCH 3/5] Forgot to add fofflags to ffloor_opt --- src/lua_maplib.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lua_maplib.c b/src/lua_maplib.c index 0051718c3..f65ea852f 100644 --- a/src/lua_maplib.c +++ b/src/lua_maplib.c @@ -240,6 +240,7 @@ static const char *const ffloor_opt[] = { "t_slope", "b_slope", "sector", // secnum pushed as control sector userdata + "fofflags", "flags", "master", // control linedef "target", // target sector From 7389e2ceb6cc9e5cfcecb50c897de808431d2f98 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Sun, 31 Jul 2022 13:24:45 +0200 Subject: [PATCH 4/5] Use the correct bustflags constant --- src/lua_maplib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lua_maplib.c b/src/lua_maplib.c index f65ea852f..b4565121d 100644 --- a/src/lua_maplib.c +++ b/src/lua_maplib.c @@ -1888,7 +1888,7 @@ static INT32 P_GetOldFOFFlags(ffloor_t *fflr) result |= FF_OLD_NORETURN; if (fflr->fofflags & FOF_CRUMBLE) result |= FF_OLD_CRUMBLE; - if (fflr->bustflags & TMFB_ONLYBOTTOM) + if (fflr->bustflags & FB_ONLYBOTTOM) result |= FF_OLD_SHATTERBOTTOM; if (fflr->fofflags & FOF_GOOWATER) result |= FF_OLD_GOOWATER; @@ -2094,9 +2094,9 @@ static void P_SetOldFOFFlags(ffloor_t *fflr, oldffloortype_e oldflags) fflr->busttype = BT_REGULAR; if (oldflags & FF_OLD_SHATTERBOTTOM) - fflr->bustflags |= TMFB_ONLYBOTTOM; + fflr->bustflags |= FB_ONLYBOTTOM; else - fflr->bustflags &= ~TMFB_ONLYBOTTOM; + fflr->bustflags &= ~FB_ONLYBOTTOM; } static int ffloor_set(lua_State *L) From 26236498718f802d73bbe59784c5bd2245621a36 Mon Sep 17 00:00:00 2001 From: spherallic Date: Wed, 28 Sep 2022 22:57:34 +0200 Subject: [PATCH 5/5] "That line shouldn't be there at all :v" -MascaraSnake --- src/deh_tables.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/deh_tables.c b/src/deh_tables.c index 302fa4245..e45d552c9 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -5357,7 +5357,6 @@ struct int_const_s const INT_CONST[] = { {"FOF_PLATFORM",FOF_PLATFORM}, ///< You can jump up through this to the top. {"FOF_REVERSEPLATFORM",FOF_REVERSEPLATFORM}, ///< A fall-through floor in normal gravity, a platform in reverse gravity. {"FOF_INTANGIBLEFLATS",FOF_INTANGIBLEFLATS}, ///< Both flats are intangible, but the sides are still solid. - {"FF_INTANGABLEFLATS",FOF_INTANGIBLEFLATS}, ///< Both flats are intangable, but the sides are still solid. //TODO {"FOF_RIPPLE",FOF_RIPPLE}, ///< Ripple the flats {"FOF_COLORMAPONLY",FOF_COLORMAPONLY}, ///< Only copy the colormap, not the lightlevel {"FOF_BOUNCY",FOF_BOUNCY}, ///< Bounces players