From 8dd3c78b053162df58bfb107b1b729bfc7ecb662 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Fri, 12 Jun 2020 08:27:10 +0200 Subject: [PATCH] Add FOF flag for splat flat rendering --- extras/conf/udb/Includes/SRB222_linedefs.cfg | 1 + src/dehacked.c | 1 + src/p_spec.c | 2 ++ src/r_defs.h | 1 + src/r_plane.c | 2 +- 5 files changed, 6 insertions(+), 1 deletion(-) diff --git a/extras/conf/udb/Includes/SRB222_linedefs.cfg b/extras/conf/udb/Includes/SRB222_linedefs.cfg index 4f45c12c1..cdf9bdd40 100644 --- a/extras/conf/udb/Includes/SRB222_linedefs.cfg +++ b/extras/conf/udb/Includes/SRB222_linedefs.cfg @@ -2186,6 +2186,7 @@ udmf 134217728 = "Ripple effect"; 268435456 = "Don't copy light level"; 536870912 = "Bouncy"; + 1073741824 = "Cut cyan flat pixels"; } } } diff --git a/src/dehacked.c b/src/dehacked.c index b416eed4d..a55362ec0 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -9820,6 +9820,7 @@ struct { {"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 special flags {"FS_PUSHABLES",FS_PUSHABLES}, diff --git a/src/p_spec.c b/src/p_spec.c index 6d260758d..b39594ee7 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -5697,6 +5697,8 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, I if (sec2->hasslope) sec->hasslope = true; + if (!udmf && master->flags & ML_EFFECT6) + fflr->flags |= FF_SPLAT; //TODO: Temporary fflr->spawnflags = fflr->flags = flags; fflr->master = master; fflr->norender = INFTICS; diff --git a/src/r_defs.h b/src/r_defs.h index ff65a5dc5..0e0adb7c6 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -147,6 +147,7 @@ typedef enum 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) } ffloortype_e; typedef enum diff --git a/src/r_plane.c b/src/r_plane.c index 92795d0fb..7f91d7465 100644 --- a/src/r_plane.c +++ b/src/r_plane.c @@ -984,7 +984,7 @@ void R_DrawSinglePlane(visplane_t *pl) if (pl->ffloor->flags & FF_TRANSLUCENT) { - spanfunctype = (pl->ffloor->master->flags & ML_EFFECT6) ? SPANDRAWFUNC_TRANSSPLAT : SPANDRAWFUNC_TRANS; + spanfunctype = (pl->ffloor->flags & FF_SPLAT) ? SPANDRAWFUNC_TRANSSPLAT : SPANDRAWFUNC_TRANS; // Hacked up support for alpha value in software mode Tails 09-24-2002 if (pl->ffloor->alpha < 12)