diff --git a/extras/conf/SRB2-22.cfg b/extras/conf/SRB2-22.cfg index d99a9943e..33072643e 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 @@ -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"; diff --git a/src/p_floor.c b/src/p_floor.c index 2da410de5..f421b550f 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -581,7 +581,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! @@ -596,7 +595,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; @@ -720,7 +719,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? @@ -1248,14 +1247,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; @@ -1368,14 +1366,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]; @@ -2248,7 +2245,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_setup.c b/src/p_setup.c index 860a987fc..60ee4aa08 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -3304,17 +3304,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) @@ -3345,6 +3349,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? @@ -3387,15 +3395,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) @@ -3456,6 +3468,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; @@ -3498,15 +3514,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) @@ -3554,6 +3574,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; @@ -3561,7 +3585,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; @@ -3611,6 +3635,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; @@ -3659,7 +3687,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; @@ -3678,6 +3707,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 ef0703c50..c65a10b76 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -5435,7 +5435,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; @@ -5460,7 +5460,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; } @@ -5640,7 +5640,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; @@ -6259,7 +6259,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; @@ -6447,7 +6447,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; } @@ -6494,7 +6494,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 @@ -6514,7 +6514,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; } @@ -6559,6 +6559,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]; @@ -6573,6 +6575,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); } @@ -6590,6 +6594,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) @@ -7248,7 +7254,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; @@ -7323,7 +7329,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; @@ -7542,7 +7548,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) {