From 6920d20a0f5ee4c14b96f330e4a994a1fadef4ca Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Mon, 18 Nov 2019 14:08:47 -0300 Subject: [PATCH] map header option --- src/dehacked.c | 8 ++++++++ src/doomstat.h | 1 + src/f_wipe.c | 1 + src/g_game.c | 8 ++++++++ src/p_setup.c | 18 ++++++++++++------ src/st_stuff.c | 2 +- 6 files changed, 31 insertions(+), 7 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index fff9dbee8..250bfb4b7 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -1573,6 +1573,13 @@ static void readlevelheader(MYFILE *f, INT32 num) else mapheaderinfo[num-1]->levelflags &= ~LF_MIXNIGHTSCOUNTDOWN; } + else if (fastcmp(word, "NOTITLECARD")) + { + if (i || word2[0] == 'T' || word2[0] == 'Y') + mapheaderinfo[num-1]->levelflags |= LF_NOTITLECARD; + else + mapheaderinfo[num-1]->levelflags &= ~LF_NOTITLECARD; + } // Individual triggers for menu flags else if (fastcmp(word, "HIDDEN")) @@ -9012,6 +9019,7 @@ struct { {"LF_NOZONE",LF_NOZONE}, {"LF_SAVEGAME",LF_SAVEGAME}, {"LF_MIXNIGHTSCOUNTDOWN",LF_MIXNIGHTSCOUNTDOWN}, + {"LF_NOTITLECARD",LF_NOTITLECARD}, // And map flags {"LF2_HIDEINMENU",LF2_HIDEINMENU}, {"LF2_HIDEINSTATS",LF2_HIDEINSTATS}, diff --git a/src/doomstat.h b/src/doomstat.h index 7d06f03e2..d9c9b92ac 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -349,6 +349,7 @@ typedef struct #define LF_NOZONE 16 ///< Don't include "ZONE" on level title #define LF_SAVEGAME 32 ///< Save the game upon loading this level #define LF_MIXNIGHTSCOUNTDOWN 64 ///< Play sfx_timeup instead of music change for NiGHTS countdown +#define LF_NOTITLECARD 128 ///< Don't start the title card #define LF2_HIDEINMENU 1 ///< Hide in the multiplayer menu #define LF2_HIDEINSTATS 2 ///< Hide in the statistics screen diff --git a/src/f_wipe.c b/src/f_wipe.c index 9adbcbc02..d3786c69f 100644 --- a/src/f_wipe.c +++ b/src/f_wipe.c @@ -375,6 +375,7 @@ void F_RunWipe(UINT8 wipetype, boolean drawMenu) // draw level title if ((WipeStageTitle && st_overlay) + && !(mapheaderinfo[gamemap-1]->levelflags & LF_NOTITLECARD) && *mapheaderinfo[gamemap-1]->lvlttl != '\0') { ST_runTitleCard(); diff --git a/src/g_game.c b/src/g_game.c index a4dc16b95..c16c28489 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1712,6 +1712,14 @@ void G_DoLoadLevel(boolean resetplayer) // void G_StartTitleCard(void) { + // The title card has been disabled for this map. + // Oh well. + if (mapheaderinfo[gamemap-1]->levelflags & LF_NOTITLECARD) + { + WipeStageTitle = false; + return; + } + // clear the hud CON_ClearHUD(); diff --git a/src/p_setup.c b/src/p_setup.c index fc88a5e5e..34a7c1437 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -3226,15 +3226,21 @@ boolean P_SetupLevel(boolean skipprecip) #endif } - // Stage title! + // No render mode, stop here. + if (rendermode == render_none) + return true; + + // Title card! G_StartTitleCard(); // Can the title card actually run, though? - if (rendermode != render_none - && WipeStageTitle - && ranspecialwipe != 2 - && *mapheaderinfo[gamemap-1]->lvlttl != '\0' - ) + if (!WipeStageTitle) + return true; + if (ranspecialwipe == 2) + return true; + + // If so... + if ((!(mapheaderinfo[gamemap-1]->levelflags & LF_NOTITLECARD)) && (*mapheaderinfo[gamemap-1]->lvlttl != '\0')) G_PreLevelTitleCard(lt_ticker, true); return true; diff --git a/src/st_stuff.c b/src/st_stuff.c index 00371a6e8..504fa3b8e 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -2539,7 +2539,7 @@ static void ST_overlayDrawer(void) // Check for a valid level title // If the HUD is enabled // And, if Lua is running, if the HUD library has the stage title enabled - if (*mapheaderinfo[gamemap-1]->lvlttl != '\0' && !(hu_showscores && (netgame || multiplayer))) + if (!(mapheaderinfo[gamemap-1]->levelflags & LF_NOTITLECARD) && *mapheaderinfo[gamemap-1]->lvlttl != '\0' && !(hu_showscores && (netgame || multiplayer))) { stagetitle = true; ST_preDrawTitleCard();