From df965b157882f76caf996125f8618deb95e0b00b Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Fri, 25 Jun 2021 18:41:14 +0200 Subject: [PATCH 1/8] Fix thwomps going too fast by a factor of 8 --- src/p_spec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_spec.c b/src/p_spec.c index 6a5bb9451..a3c356194 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -6476,7 +6476,7 @@ void P_SpawnSpecials(boolean fromnetsave) if (lines[l].special < 100 || lines[l].special >= 300) continue; - P_AddThwompThinker(lines[l].frontsector, &lines[l], lines[i].args[1] << FRACBITS, lines[i].args[2] << FRACBITS, sound); + P_AddThwompThinker(lines[l].frontsector, &lines[l], lines[i].args[1] << (FRACBITS - 3), lines[i].args[2] << (FRACBITS - 3), sound); } } break; @@ -6731,7 +6731,7 @@ void P_SpawnSpecials(boolean fromnetsave) case 251: // A THWOMP! { 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, lines[i].args[2] << FRACBITS, sound); + P_AddThwompThinker(lines[i].frontsector, &lines[i], lines[i].args[1] << (FRACBITS - 3), lines[i].args[2] << (FRACBITS - 3), sound); P_AddFakeFloorsByLine(i, 0xff, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_CUTLEVEL, secthinkers); break; } From 09bcc918c5a41786ce4407345e9e99ea1941959d Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Sun, 27 Jun 2021 17:14:34 +0200 Subject: [PATCH 2/8] Fix alpha for rising and intangible FOFs --- src/p_spec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_spec.c b/src/p_spec.c index a3c356194..6f66cb4a8 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -6664,7 +6664,7 @@ void P_SpawnSpecials(boolean fromnetsave) ffloorflags |= FF_CUTLEVEL; } - P_AddFakeFloorsByLine(i, (ffloorflags & FF_TRANSLUCENT) ? (lines[i].alpha * 0xff) >> FRACBITS : 0xff, ffloorflags, secthinkers); + P_AddFakeFloorsByLine(i, lines[i].args[1], ffloorflags, secthinkers); P_AddRaiseThinker(lines[i].frontsector, lines[i].args[0], lines[i].args[4] << FRACBITS, ceilingtop, ceilingbottom, !!(lines[i].args[5] & TMFR_REVERSE), !!(lines[i].args[5] & TMFR_SPINDASH)); break; } @@ -6711,7 +6711,7 @@ void P_SpawnSpecials(boolean fromnetsave) if (lines[i].args[2] & TMFA_SPLAT) ffloorflags |= FF_SPLAT; - P_AddFakeFloorsByLine(i, (ffloorflags & FF_TRANSLUCENT) ? (lines[i].alpha * 0xff) >> FRACBITS : 0xff, ffloorflags, secthinkers); + P_AddFakeFloorsByLine(i, lines[i].args[1], ffloorflags, secthinkers); break; case 223: // FOF (intangible, invisible) - for combining specials in a sector From b0a762a45e710b111c756c5fbf466309fa712e71 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Sun, 27 Jun 2021 17:49:00 +0200 Subject: [PATCH 3/8] Add missing null checks after P_AddFakeFloor calls --- src/p_spec.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/p_spec.c b/src/p_spec.c index 6f66cb4a8..0b1b8e90f 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -6776,6 +6776,8 @@ void P_SpawnSpecials(boolean fromnetsave) TAG_ITER_SECTORS(lines[i].args[0], s) { ffloor_t *fflr = P_AddFakeFloor(§ors[s], lines[i].frontsector, lines + i, lines[i].args[1], ffloorflags, secthinkers); + if (!fflr) + continue; fflr->busttype = busttype; fflr->specialflags = bustflags; fflr->busttag = lines[i].args[4]; @@ -6790,6 +6792,8 @@ void P_SpawnSpecials(boolean fromnetsave) TAG_ITER_SECTORS(lines[i].args[0], s) { ffloor_t *fflr = P_AddFakeFloor(§ors[s], lines[i].frontsector, lines + i, 0xff, ffloorflags, secthinkers); + if (!fflr) + continue; fflr->sinkspeed = abs(lines[i].args[2]) << (FRACBITS - 1); fflr->friction = abs(lines[i].args[3]) << (FRACBITS - 6); } @@ -6807,6 +6811,8 @@ void P_SpawnSpecials(boolean fromnetsave) TAG_ITER_SECTORS(lines[i].args[0], s) { ffloor_t *fflr = P_AddFakeFloor(§ors[s], lines[i].frontsector, lines + i, lines[i].args[1], lines[i].args[2], secthinkers); + if (!fflr) + continue; if (!udmf) // Ugly backwards compatibility stuff { if (lines[i].args[2] & FF_QUICKSAND) From 06e06a1cb652e0df572067b4c54d82ec2f4214f6 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Sun, 27 Jun 2021 18:45:56 +0200 Subject: [PATCH 4/8] Replicate old hack in binary maps: Translucent FOFs set to full opacity cut cyan pixels --- src/p_setup.c | 49 +++++++++++++++++++++++++++++++++++++++++-------- src/p_spec.c | 2 +- 2 files changed, 42 insertions(+), 9 deletions(-) diff --git a/src/p_setup.c b/src/p_setup.c index b0488dbbb..c88aa02f5 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -3104,17 +3104,21 @@ static void P_ConvertBinaryMap(void) lines[i].args[1] = sides[lines[i].sidenum[0]].toptexture; else lines[i].args[1] = 128; + + //Replicate old hack: Translucent FOFs set to full opacity cut cyan pixels + if (lines[i].args[1] == 256) + lines[i].args[2] |= TMFA_SPLAT; } else lines[i].args[1] = 255; //Appearance if (lines[i].special == 105) - lines[i].args[2] = TMFA_NOPLANES|TMFA_NOSIDES; + lines[i].args[2] |= TMFA_NOPLANES|TMFA_NOSIDES; else if (lines[i].special == 104) - lines[i].args[2] = TMFA_NOSIDES; + lines[i].args[2] |= TMFA_NOSIDES; else if (lines[i].special == 103) - lines[i].args[2] = TMFA_NOPLANES; + lines[i].args[2] |= TMFA_NOPLANES; if (lines[i].special != 100 && (lines[i].special != 104 || !(lines[i].flags & ML_NOCLIMB))) lines[i].args[2] |= TMFA_NOSHADE; if (lines[i].flags & ML_EFFECT6) @@ -3145,6 +3149,10 @@ static void P_ConvertBinaryMap(void) lines[i].args[1] = sides[lines[i].sidenum[0]].toptexture; else lines[i].args[1] = 128; + + //Replicate old hack: Translucent FOFs set to full opacity cut cyan pixels + if (lines[i].args[1] == 256) + lines[i].args[2] |= TMFW_SPLAT; } //No sides? @@ -3187,15 +3195,19 @@ static void P_ConvertBinaryMap(void) lines[i].args[1] = sides[lines[i].sidenum[0]].toptexture; else lines[i].args[1] = 128; + + //Replicate old hack: Translucent FOFs set to full opacity cut cyan pixels + if (lines[i].args[1] == 256) + lines[i].args[2] |= TMFA_SPLAT; } else lines[i].args[1] = 255; //Appearance if (lines[i].special == 142 || lines[i].special == 145) - lines[i].args[2] = TMFA_NOSIDES; + lines[i].args[2] |= TMFA_NOSIDES; else if (lines[i].special == 146) - lines[i].args[2] = TMFA_NOPLANES; + lines[i].args[2] |= TMFA_NOPLANES; if (lines[i].special != 146 && (lines[i].flags & ML_NOCLIMB)) lines[i].args[2] |= TMFA_NOSHADE; if (lines[i].flags & ML_EFFECT6) @@ -3256,6 +3268,10 @@ static void P_ConvertBinaryMap(void) lines[i].args[1] = sides[lines[i].sidenum[0]].toptexture; else lines[i].args[1] = 128; + + //Replicate old hack: Translucent FOFs set to full opacity cut cyan pixels + if (lines[i].args[1] == 256) + lines[i].args[3] |= TMFC_SPLAT; } else lines[i].args[1] = 255; @@ -3298,15 +3314,19 @@ static void P_ConvertBinaryMap(void) lines[i].args[1] = sides[lines[i].sidenum[0]].toptexture; else lines[i].args[1] = 128; + + //Replicate old hack: Translucent FOFs set to full opacity cut cyan pixels + if (lines[i].args[1] == 256) + lines[i].args[2] |= TMFA_SPLAT; } else lines[i].args[1] = 255; //Appearance if (lines[i].special == 193) - lines[i].args[2] = TMFA_NOPLANES|TMFA_NOSIDES; + lines[i].args[2] |= TMFA_NOPLANES|TMFA_NOSIDES; if (lines[i].special >= 194) - lines[i].args[2] = TMFA_INSIDES; + lines[i].args[2] |= TMFA_INSIDES; if (lines[i].special != 190 && (lines[i].special <= 193 || lines[i].flags & ML_NOCLIMB)) lines[i].args[2] |= TMFA_NOSHADE; if (lines[i].flags & ML_EFFECT6) @@ -3354,6 +3374,10 @@ static void P_ConvertBinaryMap(void) lines[i].args[1] = sides[lines[i].sidenum[0]].toptexture; else lines[i].args[1] = 128; + + //Replicate old hack: Translucent FOFs set to full opacity cut cyan pixels + if (lines[i].args[1] == 256) + lines[i].args[2] |= TMFA_SPLAT; } else lines[i].args[1] = 255; @@ -3411,6 +3435,10 @@ static void P_ConvertBinaryMap(void) lines[i].args[1] = sides[lines[i].sidenum[0]].toptexture; else lines[i].args[1] = 128; + + //Replicate old hack: Translucent FOFs set to full opacity cut cyan pixels + if (lines[i].args[1] == 256) + lines[i].args[3] |= TMFB_SPLAT; } else lines[i].args[1] = 255; @@ -3459,7 +3487,8 @@ static void P_ConvertBinaryMap(void) //Flags if (lines[i].flags & ML_EFFECT1) lines[i].args[2] = TMFL_NOBOSSES; - if (lines[i].flags & ML_EFFECT6) + //Replicate old hack: Translucent FOFs set to full opacity cut cyan pixels + if (lines[i].flags & ML_EFFECT6 || lines[i].args[1] == 256) lines[i].args[2] = TMFL_SPLAT; break; @@ -3478,6 +3507,10 @@ static void P_ConvertBinaryMap(void) lines[i].args[1] = sides[lines[i].sidenum[0]].toptexture; else lines[i].args[1] = 128; + + //Replicate old hack: Translucent FOFs set to full opacity cut cyan pixels + if (lines[i].args[1] == 256) + lines[i].args[2] |= FF_SPLAT; } else lines[i].args[1] = 255; diff --git a/src/p_spec.c b/src/p_spec.c index 0b1b8e90f..ae144307e 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -5635,7 +5635,7 @@ 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) + if (fflr->alpha < 0xff || flags & FF_SPLAT) { fflr->flags |= FF_TRANSLUCENT; fflr->spawnflags = fflr->flags; From 9d3dc98939ab37abe416cea89a4577617fd491ee Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Fri, 17 Sep 2021 09:57:53 +0200 Subject: [PATCH 5/8] Fix "render insides" condition being inverted for intangible FOFs --- src/p_setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_setup.c b/src/p_setup.c index c88aa02f5..17d71a8bf 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -3385,7 +3385,7 @@ static void P_ConvertBinaryMap(void) //Appearance if (lines[i].special == 222) lines[i].args[2] |= TMFA_NOPLANES; - if (lines[i].special != 221) + if (lines[i].special == 221) lines[i].args[2] |= TMFA_INSIDES; if (lines[i].special != 220 && !(lines[i].flags & ML_NOCLIMB)) lines[i].args[2] |= TMFA_NOSHADE; From dbf6cd8b420170c6c557f7d00547e6834922c40e Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Tue, 21 Sep 2021 11:52:29 +0200 Subject: [PATCH 6/8] Add linedef type 76 to ZB config --- extras/conf/SRB2-22.cfg | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/extras/conf/SRB2-22.cfg b/extras/conf/SRB2-22.cfg index f457fe972..b26dc6a28 100644 --- a/extras/conf/SRB2-22.cfg +++ b/extras/conf/SRB2-22.cfg @@ -771,6 +771,13 @@ linedeftypes flags2text = "[1] Use control sector tag"; flags64text = "[6] No sound effect"; } + + 76 + { + title = "Make FOF Bouncy"; + prefix = "(76)"; + flags16384text = "[14] Dampen"; + } } polyobject @@ -1273,7 +1280,7 @@ linedeftypes 160 { - title = "Floating, Bobbing"; + title = "Water Bobbing"; prefix = "(160)"; flags8text = "[3] Slope skew sides"; flags32text = "[5] Only block player"; From 19823fadbcf208a121a3d964e2bf825219c8f2e1 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Tue, 21 Sep 2021 11:55:15 +0200 Subject: [PATCH 7/8] Mark bouncy FOF sector type as deprecated in ZB config --- extras/conf/SRB2-22.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extras/conf/SRB2-22.cfg b/extras/conf/SRB2-22.cfg index b26dc6a28..fd12b5c81 100644 --- a/extras/conf/SRB2-22.cfg +++ b/extras/conf/SRB2-22.cfg @@ -425,7 +425,7 @@ sectortypes 12 = "Space Countdown"; 13 = "Ramp Sector (double step-up/down)"; 14 = "Non-Ramp Sector (no step-down)"; - 15 = "Bouncy FOF"; + 15 = "Bouncy FOF "; 16 = "Trigger Line Ex. (Pushable Objects)"; 32 = "Trigger Line Ex. (Anywhere, All Players)"; 48 = "Trigger Line Ex. (Floor Touch, All Players)"; @@ -475,7 +475,7 @@ gen_sectortypes 12 = "Space Countdown"; 13 = "Ramp Sector (double step-up/down)"; 14 = "Non-Ramp Sector (no step-down)"; - 15 = "Bouncy FOF"; + 15 = "Bouncy FOF "; } second From f26f41e03ac9b2d8ee033d627cc9218bdf5a3141 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Sun, 26 Sep 2021 06:48:26 +0200 Subject: [PATCH 8/8] Fix thinker functions that still use tag instead of args[0] for FOFs --- src/p_floor.c | 13 +++++-------- src/p_spec.c | 10 +++++----- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/p_floor.c b/src/p_floor.c index 102ac67e0..6641c6904 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -634,7 +634,6 @@ void T_BounceCheese(bouncecheese_t *bouncer) sector_t *actionsector; boolean remove; INT32 i; - mtag_t tag = Tag_FGet(&bouncer->sourceline->tags); if (bouncer->sector->crumblestate == CRUMBLE_RESTORE || bouncer->sector->crumblestate == CRUMBLE_WAIT || bouncer->sector->crumblestate == CRUMBLE_ACTIVATED) // Oops! Crumbler says to remove yourself! @@ -649,7 +648,7 @@ void T_BounceCheese(bouncecheese_t *bouncer) } // You can use multiple target sectors, but at your own risk!!! - TAG_ITER_SECTORS(tag, i) + TAG_ITER_SECTORS(bouncer->sourceline->args[0], i) { actionsector = §ors[i]; actionsector->moved = true; @@ -773,7 +772,7 @@ void T_StartCrumble(crumble_t *crumble) ffloor_t *rover; sector_t *sector; INT32 i; - mtag_t tag = Tag_FGet(&crumble->sourceline->tags); + mtag_t tag = crumble->sourceline->args[0]; // Once done, the no-return thinker just sits there, // constantly 'returning'... kind of an oxymoron, isn't it? @@ -1301,14 +1300,13 @@ void T_NoEnemiesSector(noenemies_t *nobaddies) for (i = 0; i < sec->linecount; i++) { INT32 targetsecnum = -1; - mtag_t tag2 = Tag_FGet(&sec->lines[i]->tags); if (sec->lines[i]->special < 100 || sec->lines[i]->special >= 300) continue; FOFsector = true; - TAG_ITER_SECTORS(tag2, targetsecnum) + TAG_ITER_SECTORS(sec->lines[i]->args[0], targetsecnum) { if (T_SectorHasEnemies(§ors[targetsecnum])) return; @@ -1421,14 +1419,13 @@ void T_EachTimeThinker(eachtime_t *eachtime) for (i = 0; i < sec->linecount; i++) { INT32 targetsecnum = -1; - mtag_t tag2 = Tag_FGet(&sec->lines[i]->tags); if (sec->lines[i]->special < 100 || sec->lines[i]->special >= 300) continue; FOFsector = true; - TAG_ITER_SECTORS(tag2, targetsecnum) + TAG_ITER_SECTORS(sec->lines[i]->args[0], targetsecnum) { targetsec = §ors[targetsecnum]; @@ -2418,7 +2415,7 @@ void EV_MarioBlock(ffloor_t *rover, sector_t *sector, mobj_t *puncher) block->direction = 1; block->floorstartheight = block->sector->floorheight; block->ceilingstartheight = block->sector->ceilingheight; - block->tag = (INT16)Tag_FGet(§or->tags); + block->tag = (INT16)rover->master->args[0]; if (itsamonitor) { diff --git a/src/p_spec.c b/src/p_spec.c index ae144307e..f1c3e10ad 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -5660,7 +5660,7 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, I if ((flags & FF_FLOATBOB)) { - P_AddFloatThinker(sec2, Tag_FGet(&master->tags), master); + P_AddFloatThinker(sec2, master->args[0], master); CheckForFloatBob = true; } @@ -5840,7 +5840,7 @@ static inline void P_AddThwompThinker(sector_t *sec, line_t *sourceline, fixed_t thwomp->floorstartheight = sec->floorheight; thwomp->ceilingstartheight = sec->ceilingheight; thwomp->delay = 1; - thwomp->tag = Tag_FGet(&sourceline->tags); + thwomp->tag = sourceline->args[0]; thwomp->sound = sound; sec->floordata = thwomp; @@ -7477,7 +7477,7 @@ void T_Scroll(scroll_t *s) if (!is3dblock) continue; - TAG_ITER_SECTORS(Tag_FGet(&line->tags), sect) + TAG_ITER_SECTORS(line->args[0], sect) { sector_t *psec; psec = sectors + sect; @@ -7552,7 +7552,7 @@ void T_Scroll(scroll_t *s) if (!is3dblock) continue; - TAG_ITER_SECTORS(Tag_FGet(&line->tags), sect) + TAG_ITER_SECTORS(line->args[0], sect) { sector_t *psec; psec = sectors + sect; @@ -7828,7 +7828,7 @@ void T_Disappear(disappear_t *d) { ffloor_t *rover; register INT32 s; - mtag_t afftag = Tag_FGet(&lines[d->affectee].tags); + mtag_t afftag = lines[d->affectee].args[0]; TAG_ITER_SECTORS(afftag, s) {