From 9a410f864f1e9cd470a478d1b51cda5d4c01e170 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 2 May 2008 10:55:48 +0000 Subject: [PATCH] - Separated the linedef activation types into a bit mask that allows combination of all types on the same linedef. Also added a 'first side only' flag. This is not usable from Hexen or Doom format maps though but in preparation of the UDMF format discussed here: http://www.doomworld.com/vb/source-ports/43145-udmf-v0-99-specification-draft-aka-textmap/ - Changed linedef's alpha property from a byte to fixed point after seeing that 255 wasn't handled to be fully opaque. - fixed a GCC warning in fmodsound.cpp SVN r954 (trunk) --- docs/rh-log.txt | 10 ++++ src/am_map.cpp | 3 +- src/b_move.cpp | 4 +- src/doomdata.h | 75 ++++++++++++++------------ src/p_buildmap.cpp | 4 +- src/p_doors.cpp | 2 +- src/p_enemy.cpp | 4 +- src/p_lnspec.cpp | 2 +- src/p_map.cpp | 27 +++++----- src/p_saveg.cpp | 3 +- src/p_setup.cpp | 15 ++++-- src/p_sight.cpp | 4 +- src/p_spec.cpp | 117 +++++++++++++++++----------------------- src/p_trace.cpp | 8 +-- src/p_xlat.cpp | 28 ++++++---- src/r_defs.h | 7 +-- src/r_segs.cpp | 3 +- src/sound/fmodsound.cpp | 2 +- src/version.h | 2 +- src/xlat/xlat.h | 13 ++--- wadsrc/xlat/defines.i | 1 + 21 files changed, 174 insertions(+), 160 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index e5a0a9724..a8790374b 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,13 @@ +May 2, 2008 (Changes by Graf Zahl) +- Separated the linedef activation types into a bit mask that allows combination + of all types on the same linedef. Also added a 'first side only' flag. This + is not usable from Hexen or Doom format maps though but in preparation of + the UDMF format discussed here: + http://www.doomworld.com/vb/source-ports/43145-udmf-v0-99-specification-draft-aka-textmap/ +- Changed linedef's alpha property from a byte to fixed point after seeing that + 255 wasn't handled to be fully opaque. +- fixed a GCC warning in fmodsound.cpp + April 30, 2008 (Changes by Graf Zahl) - Fixed: Warped textures didn't work anymore because the default speed was 0. diff --git a/src/am_map.cpp b/src/am_map.cpp index c0ed1deaa..d179ddd43 100644 --- a/src/am_map.cpp +++ b/src/am_map.cpp @@ -1353,8 +1353,9 @@ void AM_drawWalls (bool allmap) { if ((lines[i].special == Teleport || lines[i].special == Teleport_NoFog || + lines[i].special == Teleport_ZombieChanger || lines[i].special == Teleport_Line) && - GET_SPAC(lines[i].flags) != SPAC_MCROSS && + (lines[i].activation & SPAC_PlayerActivate) && am_usecustomcolors) { // intra-level teleporters AM_drawMline(&l, IntraTeleportColor); diff --git a/src/b_move.cpp b/src/b_move.cpp index 8988eda80..c1803b5a8 100644 --- a/src/b_move.cpp +++ b/src/b_move.cpp @@ -109,8 +109,8 @@ bool FCajunMaster::Move (AActor *actor, ticcmd_t *cmd) tryit = false; if (tryit && - (P_TestActivateLine (ld, actor, 0, SPAC_USE) || - P_TestActivateLine (ld, actor, 0, SPAC_PUSH))) + (P_TestActivateLine (ld, actor, 0, SPAC_Use) || + P_TestActivateLine (ld, actor, 0, SPAC_Push))) { good |= ld == actor->BlockingLine ? 1 : 2; } diff --git a/src/doomdata.h b/src/doomdata.h index e6b3ea5a2..d2b68d322 100644 --- a/src/doomdata.h +++ b/src/doomdata.h @@ -130,41 +130,9 @@ typedef struct #define ML_DONTDRAW 0x0080 // don't draw on the automap #define ML_MAPPED 0x0100 // set if already drawn in automap #define ML_REPEAT_SPECIAL 0x0200 // special is repeatable + #define ML_SPAC_SHIFT 10 -#define ML_SPAC_MASK 0x1c00 -static inline int GET_SPAC (int flags) -{ - return (flags&ML_SPAC_MASK) >> ML_SPAC_SHIFT; -} - -// Special activation types -#define SPAC_CROSS 0 // when player crosses line -#define SPAC_USE 1 // when player uses line -#define SPAC_MCROSS 2 // when monster crosses line -#define SPAC_IMPACT 3 // when projectile hits line -#define SPAC_PUSH 4 // when player/monster pushes line -#define SPAC_PCROSS 5 // when projectile crosses line -#define SPAC_USETHROUGH 6 // SPAC_USE, but passes it through -#define SPAC_PTOUCH 7 // when a projectiles crosses or hits line - -#define SPAC_OTHERCROSS 8 // [RH] Not a real activation type. Here for compatibility. - - -// [RH] BOOM's ML_PASSUSE flag (conflicts with ML_REPEATSPECIAL) -#define ML_PASSUSE_BOOM 0x0200 - -// [RH] In case I feel like it, here it is... -#define ML_3DMIDTEX_ETERNITY 0x0400 - -// If this bit is set, then all non-original-Doom bits are cleared when -// translating the line. Only applies when playing Doom with Doom-format maps. -// Hexen format maps and the other games are not affected by this. -#define ML_RESERVED_ETERNITY 0x0800 - -// [RH] Extra flags for Strife compatibility -#define ML_TRANSLUCENT_STRIFE 0x1000 -#define ML_RAILING_STRIFE 0x0200 -#define ML_BLOCK_FLOATERS_STRIFE 0x0400 +#define ML_SPAC_MASK 0x1c00 // Hexen's activator mask. These flags are no longer used. // Extended flags #define ML_MONSTERSCANACTIVATE 0x00002000 // [RH] Monsters (as well as players) can active the line @@ -177,6 +145,45 @@ static inline int GET_SPAC (int flags) #define ML_WRAP_MIDTEX 0x00100000 #define ML_3DMIDTEX 0x00200000 #define ML_CHECKSWITCHRANGE 0x00400000 +#define ML_FIRSTSIDEONLY 0x00800000 // activated only when crossed from front side + + +static inline int GET_SPAC (int flags) +{ + return (flags&ML_SPAC_MASK) >> ML_SPAC_SHIFT; +} + +// Special activation types +enum SPAC +{ + SPAC_Cross = 1<<0, // when player crosses line + SPAC_Use = 1<<1, // when player uses line + SPAC_MCross = 1<<2, // when monster crosses line + SPAC_Impact = 1<<3, // when projectile hits line + SPAC_Push = 1<<4, // when player pushes line + SPAC_PCross = 1<<5, // when projectile crosses line + SPAC_UseThrough = 1<<6, // when player uses line (doesn't block) + // SPAC_PTOUCH is mapped to SPAC_PCross|SPAC_Impact + SPAC_AnyCross = 1<<7, // when anything without the MF2_TELEPORT flag crosses the line + + SPAC_PlayerActivate = (SPAC_Cross|SPAC_Use|SPAC_Impact|SPAC_Push|SPAC_AnyCross|SPAC_UseThrough), +}; + +// [RH] BOOM's ML_PASSUSE flag (conflicts with ML_REPEATSPECIAL) +#define ML_PASSUSE_BOOM 0x0200 + +#define ML_3DMIDTEX_ETERNITY 0x0400 + +// If this bit is set, then all non-original-Doom bits are cleared when +// translating the line. Only applies when playing Doom with Doom-format maps. +// Hexen format maps and the other games are not affected by this. +#define ML_RESERVED_ETERNITY 0x0800 + +// [RH] Extra flags for Strife compatibility +#define ML_TRANSLUCENT_STRIFE 0x1000 +#define ML_RAILING_STRIFE 0x0200 +#define ML_BLOCK_FLOATERS_STRIFE 0x0400 + // Sector definition, from editing typedef struct diff --git a/src/p_buildmap.cpp b/src/p_buildmap.cpp index 589f2d5d8..96e954677 100644 --- a/src/p_buildmap.cpp +++ b/src/p_buildmap.cpp @@ -525,11 +525,11 @@ static void LoadWalls (walltype *walls, int numwalls, sectortype *bsec) { if (walls[i].cstat & 512) { - lines[j].alpha = 255/3; + lines[j].Alpha = FRACUNIT/3; } else { - lines[j].alpha = 255*2/3; + lines[j].Alpha = FRACUNIT*2/3; } } if (walls[i].cstat & 1) diff --git a/src/p_doors.cpp b/src/p_doors.cpp index a2edd2a5a..7bfdd2f9a 100644 --- a/src/p_doors.cpp +++ b/src/p_doors.cpp @@ -409,7 +409,7 @@ bool EV_DoDoor (DDoor::EVlDoor type, line_t *line, AActor *thing, door->m_Direction = 1; // go back up door->DoorSound (true); // [RH] Make noise } - else if (GET_SPAC(line->flags) != SPAC_PUSH) + else if (!(line->activation & SPAC_Push)) // [RH] activate push doors don't go back down when you // run into them (otherwise opening them would be // a real pain). diff --git a/src/p_enemy.cpp b/src/p_enemy.cpp index 7af3e18fb..459566390 100644 --- a/src/p_enemy.cpp +++ b/src/p_enemy.cpp @@ -525,8 +525,8 @@ bool P_Move (AActor *actor) while (spechit.Pop (ld)) { // [RH] let monsters push lines, as well as use them - if (((actor->flags4 & MF4_CANUSEWALLS) && P_ActivateLine (ld, actor, 0, SPAC_USE)) || - ((actor->flags2 & MF2_PUSHWALL) && P_ActivateLine (ld, actor, 0, SPAC_PUSH))) + if (((actor->flags4 & MF4_CANUSEWALLS) && P_ActivateLine (ld, actor, 0, SPAC_Use)) || + ((actor->flags2 & MF2_PUSHWALL) && P_ActivateLine (ld, actor, 0, SPAC_Push))) { good |= ld == actor->BlockingLine ? 1 : 2; } diff --git a/src/p_lnspec.cpp b/src/p_lnspec.cpp index 8007851e4..7570e5260 100644 --- a/src/p_lnspec.cpp +++ b/src/p_lnspec.cpp @@ -2608,7 +2608,7 @@ FUNC(LS_TranslucentLine) int linenum = -1; while ((linenum = P_FindLineFromID (arg0, linenum)) >= 0) { - lines[linenum].alpha = arg1 & 255; + lines[linenum].Alpha = Scale(clamp(arg1, 0, 255), FRACUNIT, 255); if (arg2 == 0) { sides[lines[linenum].sidenum[0]].Flags &= ~WALLF_ADDTRANS; diff --git a/src/p_map.cpp b/src/p_map.cpp index f1b18e264..bdb2e89e5 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -1281,7 +1281,7 @@ static void CheckForPushSpecial (line_t *line, int side, AActor *mobj) { if (mobj->flags2 & MF2_PUSHWALL) { - P_ActivateLine (line, mobj, side, SPAC_PUSH); + P_ActivateLine (line, mobj, side, SPAC_Push); } else if (mobj->flags2 & MF2_IMPACT) { @@ -1289,11 +1289,11 @@ static void CheckForPushSpecial (line_t *line, int side, AActor *mobj) !(mobj->flags & MF_MISSILE) || (mobj->target == NULL)) { - P_ActivateLine (line, mobj, side, SPAC_IMPACT); + P_ActivateLine (line, mobj, side, SPAC_Impact); } else { - P_ActivateLine (line, mobj->target, side, SPAC_IMPACT); + P_ActivateLine (line, mobj->target, side, SPAC_Impact); } } } @@ -1537,27 +1537,25 @@ bool P_TryMove (AActor *thing, fixed_t x, fixed_t y, { if (thing->player) { - P_ActivateLine (ld, thing, oldside, SPAC_CROSS); + P_ActivateLine (ld, thing, oldside, SPAC_Cross); } else if (thing->flags2 & MF2_MCROSS) { - P_ActivateLine (ld, thing, oldside, SPAC_MCROSS); + P_ActivateLine (ld, thing, oldside, SPAC_MCross); } else if (thing->flags2 & MF2_PCROSS) { - P_ActivateLine (ld, thing, oldside, SPAC_PCROSS); + P_ActivateLine (ld, thing, oldside, SPAC_PCross); } else if ((ld->special == Teleport || ld->special == Teleport_NoFog || ld->special == Teleport_Line)) { // [RH] Just a little hack for BOOM compatibility - P_ActivateLine (ld, thing, oldside, SPAC_MCROSS); + P_ActivateLine (ld, thing, oldside, SPAC_MCross); } else { - // I don't think allowing non-monsters to activate - // monster-allowed lines will hurt Hexen compatibility. - P_ActivateLine (ld, thing, oldside, SPAC_OTHERCROSS); + P_ActivateLine (ld, thing, oldside, SPAC_AnyCross); } } } @@ -3164,8 +3162,7 @@ bool P_UseTraverse(AActor *usething, fixed_t endx, fixed_t endy, bool &foundline if (open.range <= 0) return false; else continue; } - if (in->d.line->special == 0 || (GET_SPAC(in->d.line->flags) != SPAC_USETHROUGH && - GET_SPAC(in->d.line->flags) != SPAC_USE)) + if (in->d.line->special == 0 || !(in->d.line->activation & (SPAC_Use|SPAC_UseThrough))) { blocked: if (in->d.line->flags & ML_BLOCKEVERYTHING) @@ -3215,7 +3212,7 @@ bool P_UseTraverse(AActor *usething, fixed_t endx, fixed_t endy, bool &foundline //return in->d.line->backsector != NULL; // don't use back side goto blocked; // do a proper check for back sides of triggers - P_ActivateLine (in->d.line, usething, 0, SPAC_USE); + P_ActivateLine (in->d.line, usething, 0, SPAC_Use); //WAS can't use more than one special line in a row //jff 3/21/98 NOW multiple use allowed with enabling line flag @@ -3224,12 +3221,12 @@ bool P_UseTraverse(AActor *usething, fixed_t endx, fixed_t endy, bool &foundline // it through, including SPAC_USETHROUGH. if (i_compatflags & COMPATF_USEBLOCKING) { - if (GET_SPAC(in->d.line->flags) == SPAC_USETHROUGH) continue; + if (in->d.line->activation & SPAC_UseThrough) continue; else return true; } else { - if (GET_SPAC(in->d.line->flags) != SPAC_USE) continue; + if (!(in->d.line->activation & SPAC_Use)) continue; else return true; } } diff --git a/src/p_saveg.cpp b/src/p_saveg.cpp index a18bdee8e..c52a74632 100644 --- a/src/p_saveg.cpp +++ b/src/p_saveg.cpp @@ -356,8 +356,9 @@ void P_SerializeWorld (FArchive &arc) for (i = 0, li = lines; i < numlines; i++, li++) { arc << li->flags + << li->activation << li->special - << li->alpha + << li->Alpha << li->id << li->args[0] << li->args[1] << li->args[2] << li->args[3] << li->args[4]; diff --git a/src/p_setup.cpp b/src/p_setup.cpp index da0eeba88..893fe0994 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -1897,11 +1897,11 @@ void P_FinishLoadingLineDefs () alpha = sidetemp[ld->sidenum[0]].a.alpha; if (alpha < 0) { - alpha = ld->args[1]; + alpha = Scale(ld->args[1], FRACUNIT, 255); } if (!ld->args[0]) { - ld->alpha = (BYTE)alpha; + ld->Alpha = alpha; if (ld->args[2] == 1) { sides[ld->sidenum[0]].Flags |= WALLF_ADDTRANS; @@ -1917,7 +1917,7 @@ void P_FinishLoadingLineDefs () { if (lines[j].id == ld->args[0]) { - lines[j].alpha = (BYTE)alpha; + lines[j].Alpha = alpha; if (lines[j].args[2] == 1) { sides[lines[j].sidenum[0]].Flags |= WALLF_ADDTRANS; @@ -1993,7 +1993,7 @@ void P_LoadLineDefs (MapData * map) ld = lines; for (i = numlines; i > 0; i--, mld++, ld++) { - ld->alpha = 255; // [RH] Opaque by default + ld->Alpha = FRACUNIT; // [RH] Opaque by default // [RH] Translate old linedef special and flags to be // compatible with the new format. @@ -2077,7 +2077,7 @@ void P_LoadLineDefs2 (MapData * map) ld->v1 = &vertexes[LittleShort(mld->v1)]; ld->v2 = &vertexes[LittleShort(mld->v2)]; - ld->alpha = 255; // [RH] Opaque by default + ld->Alpha = FRACUNIT; // [RH] Opaque by default ld->id = -1; P_SetSideNum (&ld->sidenum[0], LittleShort(mld->sidenum[0])); @@ -2088,6 +2088,11 @@ void P_LoadLineDefs2 (MapData * map) if (level.flags & LEVEL_CLIPMIDTEX) ld->flags |= ML_CLIP_MIDTEX; if (level.flags & LEVEL_WRAPMIDTEX) ld->flags |= ML_WRAP_MIDTEX; if (level.flags & LEVEL_CHECKSWITCHRANGE) ld->flags |= ML_CHECKSWITCHRANGE; + + // convert the activation type + ld->activation = 1 << GET_SPAC(ld->flags); + if (ld->activation == SPAC_AnyCross) ld->activation = SPAC_Impact|SPAC_PCross; // this is really PTouch + ld->flags &= ~ML_SPAC_MASK; } delete[] mldf; } diff --git a/src/p_sight.cpp b/src/p_sight.cpp index e5bf8dd87..2e648c49f 100644 --- a/src/p_sight.cpp +++ b/src/p_sight.cpp @@ -134,8 +134,8 @@ static bool P_SightCheckLine (line_t *ld) return false; } if (SeePastShootableLines && - (GET_SPAC(ld->flags) != SPAC_IMPACT || - (ld->special != ACS_Execute && ld->special != ACS_ExecuteAlways)) || + !(ld->activation & SPAC_Impact) || + (ld->special != ACS_Execute && ld->special != ACS_ExecuteAlways) || (ld->args[1] != 0 && ld->args[1] != level.levelnum)) { // Pretend the other side is invisible if this is not an impact line diff --git a/src/p_spec.cpp b/src/p_spec.cpp index 40371bb35..e0ae65cc6 100644 --- a/src/p_spec.cpp +++ b/src/p_spec.cpp @@ -206,11 +206,7 @@ bool P_ActivateLine (line_t *line, AActor *mo, int side, int activationType) { return false; } - lineActivation = GET_SPAC(line->flags); - if (lineActivation == SPAC_PTOUCH) - { - lineActivation = activationType; - } + lineActivation = line->activation; repeat = line->flags & ML_REPEAT_SPECIAL; buttonSuccess = false; buttonSuccess = LineSpecials[line->special] @@ -223,23 +219,16 @@ bool P_ActivateLine (line_t *line, AActor *mo, int side, int activationType) { // clear the special on non-retriggerable lines line->special = 0; } -// Graf Zahl says: "If you check out the WolfenDoom WAD Operation Rheingold 2 -// you will find that there are lots of shoot triggers that don't have any -// attached sector. In Doom2.exe such switches are changed and this WAD uses -// this to create a lot of shootable stuff on walls (like clocks that get -// destroyed etc.) None of those work in ZDoom. Interestingly this works in -// almost no source port." -// begin of changed code + if (buttonSuccess) { - if (lineActivation == SPAC_USE || lineActivation == SPAC_IMPACT || lineActivation == SPAC_USETHROUGH) + if (activationType == SPAC_Use || activationType == SPAC_Impact) { P_ChangeSwitchTexture (&sides[line->sidenum[0]], repeat, special); } } - // some old WADs use this method to create walls that change the texture when shot. - else if (lineActivation == SPAC_IMPACT && // only for shootable triggers + else if (activationType == SPAC_Impact && // only for shootable triggers !(level.flags & LEVEL_HEXENFORMAT) && // only in Doom-format maps !repeat && // only non-repeatable triggers (specialGeneric_Crusher) && // not for Boom's generalized linedefs @@ -266,44 +255,38 @@ bool P_ActivateLine (line_t *line, AActor *mo, int side, int activationType) bool P_TestActivateLine (line_t *line, AActor *mo, int side, int activationType) { - int lineActivation; + int lineActivation = line->activation; - lineActivation = GET_SPAC(line->flags); - if (lineActivation == SPAC_PTOUCH && - (activationType == SPAC_PCROSS || activationType == SPAC_IMPACT)) + if (line->flags & ML_FIRSTSIDEONLY && side == 1) { - lineActivation = activationType; + return false; } - else if (lineActivation == SPAC_USETHROUGH) + + if (lineActivation & SPAC_UseThrough) { - lineActivation = SPAC_USE; + lineActivation |= SPAC_Use; } else if (line->special == Teleport && - lineActivation == SPAC_CROSS && - activationType == SPAC_PCROSS && + (lineActivation & SPAC_Cross) && + activationType == SPAC_PCross && mo != NULL && mo->flags & MF_MISSILE) { // Let missiles use regular player teleports - lineActivation = SPAC_PCROSS; + lineActivation |= SPAC_PCross; } // BOOM's generalized line types that allow monster use can actually be // activated by anything! - if (activationType == SPAC_OTHERCROSS) + if (activationType == SPAC_AnyCross) { - if (lineActivation == SPAC_CROSS && line->special >= Generic_Floor && - line->special <= Generic_Crusher && !(mo->flags2&MF2_NOTELEPORT)) - { - return (line->flags & ML_MONSTERSCANACTIVATE) != 0; - } - return false; + if (mo->flags2 & MF2_NOTELEPORT) return false; } - if (lineActivation != activationType && - !(activationType == SPAC_MCROSS && lineActivation == SPAC_CROSS)) + if ((lineActivation & activationType) == 0 && + (activationType != SPAC_MCross || lineActivation != SPAC_Cross)) { return false; } - if (activationType == SPAC_USE) + if (activationType == SPAC_Use) { if (!P_CheckSwitchRange(mo, line, side)) return false; } @@ -311,8 +294,9 @@ bool P_TestActivateLine (line_t *line, AActor *mo, int side, int activationType) if (mo && !mo->player && !(mo->flags & MF_MISSILE) && !(line->flags & ML_MONSTERSCANACTIVATE) && - (activationType != SPAC_MCROSS || lineActivation != SPAC_MCROSS)) - { // [RH] monsters' ability to activate this line depends on its type + (activationType != SPAC_MCross || (!(lineActivation & SPAC_MCross)))) + { + // [RH] monsters' ability to activate this line depends on its type // In Hexen, only MCROSS lines could be activated by monsters. With // lax activation checks, monsters can also activate certain lines // even without them being marked as monster activate-able. This is @@ -321,40 +305,16 @@ bool P_TestActivateLine (line_t *line, AActor *mo, int side, int activationType) { return false; } - if ((activationType == SPAC_USE || activationType == SPAC_PUSH) + if ((activationType == SPAC_Use || activationType == SPAC_Push) && (line->flags & ML_SECRET)) return false; // never open secret doors bool noway = true; - switch (lineActivation) + switch (activationType) { - case SPAC_IMPACT: - case SPAC_PCROSS: - // shouldn't really be here if not a missile - case SPAC_MCROSS: - noway = false; - break; - - case SPAC_CROSS: - switch (line->special) - { - case Door_Raise: - if (line->args[1] >= 64) - { - break; - } - case Teleport: - case Teleport_NoFog: - case Teleport_Line: - case Plat_DownWaitUpStayLip: - case Plat_DownWaitUpStay: - noway = false; - } - break; - - case SPAC_USE: - case SPAC_PUSH: + case SPAC_Use: + case SPAC_Push: switch (line->special) { case Door_Raise: @@ -366,11 +326,34 @@ bool P_TestActivateLine (line_t *line, AActor *mo, int side, int activationType) noway = false; } break; + + case SPAC_MCross: + if (!(lineActivation & SPAC_MCross)) + { + switch (line->special) + { + case Door_Raise: + if (line->args[1] >= 64) + { + break; + } + case Teleport: + case Teleport_NoFog: + case Teleport_Line: + case Plat_DownWaitUpStayLip: + case Plat_DownWaitUpStay: + noway = false; + } + } + else noway = false; + break; + + default: + noway = false; } return !noway; } - if (activationType == SPAC_MCROSS && - lineActivation != activationType && + if (activationType == SPAC_MCross && !(lineActivation & SPAC_MCross) && !(line->flags & ML_MONSTERSCANACTIVATE)) { return false; diff --git a/src/p_trace.cpp b/src/p_trace.cpp index de7f14776..62ff20110 100644 --- a/src/p_trace.cpp +++ b/src/p_trace.cpp @@ -228,7 +228,7 @@ bool FTraceInfo::TraceTraverse (int ptflags) hitz >= bc ? TIER_Upper : TIER_Middle; if (TraceFlags & TRACE_Impact) { - P_ActivateLine (in->d.line, IgnoreThis, lineside, SPAC_IMPACT); + P_ActivateLine (in->d.line, IgnoreThis, lineside, SPAC_Impact); } } else @@ -236,12 +236,12 @@ bool FTraceInfo::TraceTraverse (int ptflags) Results->HitType = TRACE_HitNone; if (TraceFlags & TRACE_PCross) { - P_ActivateLine (in->d.line, IgnoreThis, lineside, SPAC_PCROSS); + P_ActivateLine (in->d.line, IgnoreThis, lineside, SPAC_PCross); } if (TraceFlags & TRACE_Impact) { // This is incorrect for "impact", but Hexen did this, so // we need to as well, for compatibility - P_ActivateLine (in->d.line, IgnoreThis, lineside, SPAC_IMPACT); + P_ActivateLine (in->d.line, IgnoreThis, lineside, SPAC_Impact); } } @@ -274,7 +274,7 @@ bool FTraceInfo::TraceTraverse (int ptflags) } if (Results->HitType == TRACE_HitWall && TraceFlags & TRACE_Impact) { - P_ActivateLine (in->d.line, IgnoreThis, lineside, SPAC_IMPACT); + P_ActivateLine (in->d.line, IgnoreThis, lineside, SPAC_Impact); } } diff --git a/src/p_xlat.cpp b/src/p_xlat.cpp index 5a5b48102..dee30cfea 100644 --- a/src/p_xlat.cpp +++ b/src/p_xlat.cpp @@ -71,7 +71,7 @@ void P_TranslateLineDef (line_t *ld, maplinedef_t *mld) if (flags & ML_TRANSLUCENT_STRIFE) { - ld->alpha = 255*3/4; + ld->Alpha = FRACUNIT*3/4; } if (gameinfo.gametype == GAME_Strife) { @@ -130,13 +130,16 @@ void P_TranslateLineDef (line_t *ld, maplinedef_t *mld) ld->args[4] = linetrans->args[4]; ld->flags = flags | ((linetrans->flags & 0x1f) << 9); + if (linetrans->flags & 0x20) ld->flags |= ML_FIRSTSIDEONLY; + ld->activation = 1 << GET_SPAC(ld->flags); + if (ld->activation == SPAC_AnyCross) ld->activation = SPAC_Impact|SPAC_PCross; // this is really PTouch + ld->flags &= ~ML_SPAC_MASK; - if (passthrough && (GET_SPAC(ld->flags) == SPAC_USE)) + if (passthrough && ld->activation == SPAC_Use) { - ld->flags &= ~ML_SPAC_MASK; - ld->flags |= SPAC_USETHROUGH << ML_SPAC_SHIFT; + ld->activation = SPAC_UseThrough; } - switch (linetrans->flags & 0xe0) + switch (linetrans->flags & LINETRANS_TAGMASK) { case LINETRANS_HAS2TAGS: // First two arguments are tags ld->args[1] = tag; @@ -160,7 +163,7 @@ void P_TranslateLineDef (line_t *ld, maplinedef_t *mld) ld->args[4] = tag; break; } - if ((ld->flags & ML_SECRET) && (GET_SPAC(ld->flags) == SPAC_USE || GET_SPAC(ld->flags) == SPAC_USETHROUGH)) + if ((ld->flags & ML_SECRET) && ld->activation & (SPAC_Use|SPAC_UseThrough)) { ld->flags &= ~ML_MONSTERSCANACTIVATE; } @@ -180,7 +183,7 @@ void P_TranslateLineDef (line_t *ld, maplinedef_t *mld) case WalkMany: flags |= ML_REPEAT_SPECIAL; case WalkOnce: - flags |= SPAC_CROSS << ML_SPAC_SHIFT; + ld->activation = SPAC_Cross; break; case SwitchMany: @@ -189,15 +192,15 @@ void P_TranslateLineDef (line_t *ld, maplinedef_t *mld) case SwitchOnce: case PushOnce: if (passthrough) - flags |= SPAC_USETHROUGH << ML_SPAC_SHIFT; + ld->activation = SPAC_UseThrough; else - flags |= SPAC_USE << ML_SPAC_SHIFT; + ld->activation = SPAC_Use; break; case GunMany: flags |= ML_REPEAT_SPECIAL; case GunOnce: - flags |= SPAC_IMPACT << ML_SPAC_SHIFT; + ld->activation = SPAC_Impact; break; } @@ -267,6 +270,11 @@ void P_TranslateLineDef (line_t *ld, maplinedef_t *mld) } } ld->flags = flags; + if (flags & ML_MONSTERSCANACTIVATE && ld->activation == SPAC_Cross) + { + // In Boom anything can activate such a line so set the proper type here. + ld->activation = SPAC_AnyCross; + } return; } } diff --git a/src/r_defs.h b/src/r_defs.h index cf3e419c7..39ba1bb8d 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -558,9 +558,10 @@ struct line_t vertex_t *v1, *v2; // vertices, from v1 to v2 fixed_t dx, dy; // precalculated v2 - v1 for side checking DWORD flags; - BYTE special; // [RH] specials are only one byte (like Hexen) - BYTE alpha; // <--- translucency (0-255/255=opaque) - short id; // <--- same as tag or set with Line_SetIdentification + DWORD activation; // activation type + int special; + fixed_t Alpha; // <--- translucency (0-255/255=opaque) + int id; // <--- same as tag or set with Line_SetIdentification int args[5]; // <--- hexen-style arguments (expanded to ZDoom's full width) int firstid, nextid; DWORD sidenum[2]; // sidenum[1] will be NO_SIDE if one sided diff --git a/src/r_segs.cpp b/src/r_segs.cpp index b785c8b15..4c6031305 100644 --- a/src/r_segs.cpp +++ b/src/r_segs.cpp @@ -209,8 +209,7 @@ void R_RenderMaskedSegRange (drawseg_t *ds, int x1, int x2) ESPSResult drawmode; drawmode = R_SetPatchStyle (LegacyRenderStyles[curline->sidedef->Flags & WALLF_ADDTRANS ? STYLE_Add : STYLE_Translucent], - curline->linedef->alpha < 255 ? curline->linedef->alpha<<8 : FRACUNIT, - 0, 0); + MIN(curline->linedef->Alpha, FRACUNIT), 0, 0); if ((drawmode == DontDraw && !ds->bFogBoundary)) { diff --git a/src/sound/fmodsound.cpp b/src/sound/fmodsound.cpp index f7e87d2dd..da134a9f7 100644 --- a/src/sound/fmodsound.cpp +++ b/src/sound/fmodsound.cpp @@ -269,7 +269,7 @@ class FMODStreamCapsule : public SoundStream public: FMODStreamCapsule(FMOD::Sound *stream, FMODSoundRenderer *owner, const char *url) : Owner(owner), Stream(NULL), Channel(NULL), - UserData(NULL), Callback(NULL), Ended(false), URL(url) + UserData(NULL), Callback(NULL), URL(url), Ended(false) { SetStream(stream); } diff --git a/src/version.h b/src/version.h index 61edd2e90..2e668f261 100644 --- a/src/version.h +++ b/src/version.h @@ -75,7 +75,7 @@ // SAVESIG should match SAVEVER. // MINSAVEVER is the minimum level snapshot version that can be loaded. -#define MINSAVEVER 932 +#define MINSAVEVER 954 #if SVN_REVISION_NUMBER < MINSAVEVER // Never write a savegame with a version lower than what we need diff --git a/src/xlat/xlat.h b/src/xlat/xlat.h index e5c497bf2..3ba4381e6 100644 --- a/src/xlat/xlat.h +++ b/src/xlat/xlat.h @@ -6,13 +6,14 @@ enum { - LINETRANS_HASTAGAT1 = (1<<5), // (tag, x, x, x, x) - LINETRANS_HASTAGAT2 = (2<<5), // (x, tag, x, x, x) - LINETRANS_HASTAGAT3 = (3<<5), // (x, x, tag, x, x) - LINETRANS_HASTAGAT4 = (4<<5), // (x, x, x, tag, x) - LINETRANS_HASTAGAT5 = (5<<5), // (x, x, x, x, tag) + LINETRANS_HASTAGAT1 = (1<<6), // (tag, x, x, x, x) + LINETRANS_HASTAGAT2 = (2<<6), // (x, tag, x, x, x) + LINETRANS_HASTAGAT3 = (3<<6), // (x, x, tag, x, x) + LINETRANS_HASTAGAT4 = (4<<6), // (x, x, x, tag, x) + LINETRANS_HASTAGAT5 = (5<<6), // (x, x, x, x, tag) - LINETRANS_HAS2TAGS = (7<<5), // (tag, tag, x, x, x) + LINETRANS_HAS2TAGS = (7<<6), // (tag, tag, x, x, x) + LINETRANS_TAGMASK = (7<<6) }; struct FLineTrans diff --git a/wadsrc/xlat/defines.i b/wadsrc/xlat/defines.i index b77dca7b7..6673b5ef5 100644 --- a/wadsrc/xlat/defines.i +++ b/wadsrc/xlat/defines.i @@ -75,6 +75,7 @@ define SHOOT (6) define MONST (16) define MONWALK (4) define REP (1) +define FIRSTSIDE (32) enum {