From ac3dd146c7cf238df536f47d2649e276cbaf798f Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Sun, 12 Dec 2021 07:02:17 +0100 Subject: [PATCH] Expose blendmodes to UDMF --- extras/conf/udb/Includes/SRB222_common.cfg | 4 ++-- extras/conf/udb/Includes/SRB222_misc.cfg | 9 ++++++--- src/p_setup.c | 13 +++++++++++++ 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/extras/conf/udb/Includes/SRB222_common.cfg b/extras/conf/udb/Includes/SRB222_common.cfg index d67835aeb..b752e3654 100644 --- a/extras/conf/udb/Includes/SRB222_common.cfg +++ b/extras/conf/udb/Includes/SRB222_common.cfg @@ -264,10 +264,10 @@ mapformat_udmf } // LINEDEF RENDERSTYLES - /*linedefrenderstyles + linedefrenderstyles { include("SRB222_misc.cfg", "linedefrenderstyles"); - }*/ + } // THING FLAGS thingflags diff --git a/extras/conf/udb/Includes/SRB222_misc.cfg b/extras/conf/udb/Includes/SRB222_misc.cfg index 68629149e..1b4fb4b4b 100644 --- a/extras/conf/udb/Includes/SRB222_misc.cfg +++ b/extras/conf/udb/Includes/SRB222_misc.cfg @@ -63,11 +63,14 @@ linedefflags_udmf transfer = "Transfer Line"; } -/*linedefrenderstyles +linedefrenderstyles { translucent = "Translucent"; - fog = "Fog"; -}*/ + add = "Add"; + subtract = "Subtract"; + reversesubtract = "Reverse subtract"; + modulate = "Modulate"; +} sectorflags { diff --git a/src/p_setup.c b/src/p_setup.c index 6320edc22..6f0e11c03 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -1701,6 +1701,19 @@ static void ParseTextmapLinedefParameter(UINT32 i, char *param, char *val) lines[i].sidenum[1] = atol(val); else if (fastcmp(param, "alpha")) lines[i].alpha = FLOAT_TO_FIXED(atof(val)); + else if (fastcmp(param, "blendmode") || fastcmp(param, "renderstyle")) + { + if (fastcmp(val, "translucent")) + lines[i].blendmode = AST_COPY; + else if (fastcmp(val, "add")) + lines[i].blendmode = AST_ADD; + else if (fastcmp(val, "subtract")) + lines[i].blendmode = AST_SUBTRACT; + else if (fastcmp(val, "reversesubtract")) + lines[i].blendmode = AST_REVERSESUBTRACT; + else if (fastcmp(val, "modulate")) + lines[i].blendmode = AST_MODULATE; + } else if (fastcmp(param, "executordelay")) lines[i].executordelay = atol(val);