From cd85240ec3d6b59b15212f4dd85a16c385cd58a9 Mon Sep 17 00:00:00 2001 From: spherallic Date: Sat, 17 Sep 2022 11:40:44 +0200 Subject: [PATCH 1/3] Add toggle for action 439 to use backside textures --- extras/conf/SRB2-22.cfg | 3 ++- extras/conf/udb/Includes/SRB222_linedefs.cfg | 8 +++++++- src/p_setup.c | 1 + src/p_spec.c | 3 +++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/extras/conf/SRB2-22.cfg b/extras/conf/SRB2-22.cfg index 969f645f3..a2f56880b 100644 --- a/extras/conf/SRB2-22.cfg +++ b/extras/conf/SRB2-22.cfg @@ -2481,6 +2481,7 @@ linedeftypes prefix = "(439)"; flags8text = "[3] Set delay by backside sector"; flags64text = "[6] Only existing"; + flags8192text = "[13] Use backside textures"; } 440 @@ -6949,7 +6950,7 @@ thingtypes { color = 10; // Green title = "Tutorial"; - + 799 { title = "Tutorial Plant"; diff --git a/extras/conf/udb/Includes/SRB222_linedefs.cfg b/extras/conf/udb/Includes/SRB222_linedefs.cfg index fff9edf10..1dec9ab88 100644 --- a/extras/conf/udb/Includes/SRB222_linedefs.cfg +++ b/extras/conf/udb/Includes/SRB222_linedefs.cfg @@ -2593,7 +2593,7 @@ udmf } } } - + 190 { title = "Rising"; @@ -4588,6 +4588,12 @@ udmf type = 11; enum = "yesno"; } + arg3 + { + title = "Use backside textures?"; + type = 11; + enum = "noyes"; + } } 440 diff --git a/src/p_setup.c b/src/p_setup.c index 146d5d302..a3fad52af 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -5198,6 +5198,7 @@ static void P_ConvertBinaryLinedefTypes(void) lines[i].args[0] = tag; lines[i].args[1] = TMSD_FRONTBACK; lines[i].args[2] = !!(lines[i].flags & ML_NOCLIMB); + lines[i].args[3] = !!(lines[i].flags & ML_EFFECT6); break; case 441: //Condition set trigger lines[i].args[0] = sides[lines[i].sidenum[0]].textureoffset >> FRACBITS; diff --git a/src/p_spec.c b/src/p_spec.c index 78878de1d..e8b0bcc87 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -2906,6 +2906,9 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) if (always || this->bottomtexture) this->bottomtexture = set->bottomtexture; } + if (line->args[3] && lines[linenum].sidenum[1] != 0xffff) + set = &sides[line->sidenum[1]]; // Use back side textures + // Back side if (line->args[1] != TMSD_FRONT && lines[linenum].sidenum[1] != 0xffff) { From 81b1526c2c12edece253bc44f2fa3d5a25f5d2d6 Mon Sep 17 00:00:00 2001 From: spherallic Date: Sun, 9 Oct 2022 18:53:34 +0200 Subject: [PATCH 2/3] Check the correct backside for textures, then go back to front textures. --- src/p_spec.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/p_spec.c b/src/p_spec.c index e8b0bcc87..cc2a2d253 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -2906,8 +2906,8 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) if (always || this->bottomtexture) this->bottomtexture = set->bottomtexture; } - if (line->args[3] && lines[linenum].sidenum[1] != 0xffff) - set = &sides[line->sidenum[1]]; // Use back side textures + if (line->args[3] && line->sidenum[1] != 0xffff) + set = &sides[line->sidenum[1]]; // Use back side textures for target's back side // Back side if (line->args[1] != TMSD_FRONT && lines[linenum].sidenum[1] != 0xffff) @@ -2917,6 +2917,8 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) if (always || this->midtexture) this->midtexture = set->midtexture; if (always || this->bottomtexture) this->bottomtexture = set->bottomtexture; } + + set = &sides[line->sidenum[0]]; // Go back to front side textures } } break; From a6a1b0a72029c4ee798e534750bd5ddf5f5da179 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Mon, 10 Oct 2022 07:39:34 +0200 Subject: [PATCH 3/3] Refactor linedef type 439 a little --- src/p_spec.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/p_spec.c b/src/p_spec.c index cc2a2d253..9cb8a411d 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -2886,7 +2886,9 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) case 439: // Set texture { size_t linenum; - side_t *set = &sides[line->sidenum[0]], *this; + side_t *setfront = &sides[line->sidenum[0]]; + side_t *setback = (line->args[3] && line->sidenum[1] != 0xffff) ? &sides[line->sidenum[1]] : setfront; + side_t *this; boolean always = !(line->args[2]); // If args[2] is set: Only change mid texture if mid texture already exists on tagged lines, etc. for (linenum = 0; linenum < numlines; linenum++) @@ -2901,24 +2903,19 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) if (line->args[1] != TMSD_BACK) { this = &sides[lines[linenum].sidenum[0]]; - if (always || this->toptexture) this->toptexture = set->toptexture; - if (always || this->midtexture) this->midtexture = set->midtexture; - if (always || this->bottomtexture) this->bottomtexture = set->bottomtexture; + if (always || this->toptexture) this->toptexture = setfront->toptexture; + if (always || this->midtexture) this->midtexture = setfront->midtexture; + if (always || this->bottomtexture) this->bottomtexture = setfront->bottomtexture; } - if (line->args[3] && line->sidenum[1] != 0xffff) - set = &sides[line->sidenum[1]]; // Use back side textures for target's back side - // Back side if (line->args[1] != TMSD_FRONT && lines[linenum].sidenum[1] != 0xffff) { this = &sides[lines[linenum].sidenum[1]]; - if (always || this->toptexture) this->toptexture = set->toptexture; - if (always || this->midtexture) this->midtexture = set->midtexture; - if (always || this->bottomtexture) this->bottomtexture = set->bottomtexture; + if (always || this->toptexture) this->toptexture = setback->toptexture; + if (always || this->midtexture) this->midtexture = setback->midtexture; + if (always || this->bottomtexture) this->bottomtexture = setback->bottomtexture; } - - set = &sides[line->sidenum[0]]; // Go back to front side textures } } break;