diff --git a/src/am_map.cpp b/src/am_map.cpp index 4cab453f7..20f99de36 100644 --- a/src/am_map.cpp +++ b/src/am_map.cpp @@ -324,6 +324,30 @@ struct AMColorset } }; +//============================================================================= +// +// automap colors forced by linedef +// +//============================================================================= + +static const int AUTOMAP_LINE_COLORS[AMLS_COUNT] = +{ + -1, // AMLS_Default (unused) + AMColorset::WallColor, // AMLS_OneSided, + AMColorset::TSWallColor, // AMLS_TwoSided + AMColorset::FDWallColor, // AMLS_FloorDiff + AMColorset::CDWallColor, // AMLS_CeilingDiff + AMColorset::EFWallColor, // AMLS_ExtraFloor + AMColorset::SpecialWallColor, // AMLS_Special + AMColorset::SecretWallColor, // AMLS_Secret + AMColorset::NotSeenColor, // AMLS_NotSeen + AMColorset::LockedColor, // AMLS_Locked + AMColorset::IntraTeleportColor, // AMLS_IntraTeleport + AMColorset::InterTeleportColor, // AMLS_InterTeleport + AMColorset::UnexploredSecretColor, // AMLS_UnexploredSecret + AMColorset::PortalColor, // AMLS_Portal +}; + //============================================================================= // // predefined colorsets @@ -2583,6 +2607,13 @@ void AM_drawWalls (bool allmap) } } + if (line.automapstyle > AMLS_Default && line.automapstyle < AMLS_COUNT + && (am_cheat == 0 || am_cheat >= 4)) + { + AM_drawMline(&l, AUTOMAP_LINE_COLORS[line.automapstyle]); + continue; + } + if (portalmode) { AM_drawMline(&l, AMColors.PortalColor); diff --git a/src/namedef.h b/src/namedef.h index 05f2c55cb..b098a06c0 100644 --- a/src/namedef.h +++ b/src/namedef.h @@ -538,6 +538,7 @@ xx(Conversation) xx(Locknumber) xx(Midtex3dimpassible) xx(Revealed) +xx(AutomapStyle) xx(Playercross) xx(Playeruse) diff --git a/src/p_udmf.cpp b/src/p_udmf.cpp index f0d34c8ee..283fac000 100644 --- a/src/p_udmf.cpp +++ b/src/p_udmf.cpp @@ -1111,6 +1111,10 @@ public: Flag(ld->flags, ML_REVEALED, key); continue; + case NAME_AutomapStyle: + ld->automapstyle = AutomapLineStyle(CheckInt(key)); + continue; + case NAME_MoreIds: // delay parsing of the tag string until parsing of the sector is complete // This ensures that the ID is always the first tag in the list. diff --git a/src/r_defs.h b/src/r_defs.h index a9e7e57c7..d5b104624 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -1281,6 +1281,26 @@ struct side_t }; +enum AutomapLineStyle : int +{ + AMLS_Default, + AMLS_OneSided, + AMLS_TwoSided, + AMLS_FloorDiff, + AMLS_CeilingDiff, + AMLS_ExtraFloor, + AMLS_Special, + AMLS_Secret, + AMLS_NotSeen, + AMLS_Locked, + AMLS_IntraTeleport, + AMLS_InterTeleport, + AMLS_UnexploredSecret, + AMLS_Portal, + + AMLS_COUNT +}; + struct line_t { vertex_t *v1, *v2; // vertices, from v1 to v2 @@ -1297,6 +1317,7 @@ struct line_t int locknumber; // [Dusk] lock number for special unsigned portalindex; unsigned portaltransferred; + AutomapLineStyle automapstyle; DVector2 Delta() const {