From fed8167a813c28f24caa963fe9b9e11715d7be8e Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sat, 8 Feb 2020 11:13:20 -0600 Subject: [PATCH 1/3] Allow more options for when the titlecard shows up --- src/dehacked.c | 21 +++++++++++++++++++++ src/doomstat.h | 22 +++++++++++++--------- src/f_wipe.c | 3 +-- src/g_game.c | 13 ++++++++++++- 4 files changed, 47 insertions(+), 12 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 45f00b8cf..5f35864e2 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -1831,6 +1831,24 @@ static void readlevelheader(MYFILE *f, INT32 num) else mapheaderinfo[num-1]->levelflags &= ~LF_NOTITLECARD; } + else if (fastcmp(word, "SHOWTITLECARDFOR")) + { + mapheaderinfo[num-1]->levelflags |= LF_NOTITLECARD; + tmp = strtok(word2,","); + do { + if (fastcmp(tmp, "FIRST")) + mapheaderinfo[num-1]->levelflags &= ~LF_NOTITLECARDFIRST; + else if (fastcmp(tmp, "RESPAWN")) + mapheaderinfo[num-1]->levelflags &= ~LF_NOTITLECARDRESPAWN; + else if (fastcmp(tmp, "RECORDATTACK")) + mapheaderinfo[num-1]->levelflags &= ~LF_NOTITLECARDRECORDATTACK; + else if (fastcmp(tmp, "ALL")) + mapheaderinfo[num-1]->levelflags &= ~LF_NOTITLECARD; + else + deh_warning("Level header %d: unknown titlecard show option %s\n", num, tmp); + + } while((tmp = strtok(NULL,",")) != NULL); + } // Individual triggers for menu flags else if (fastcmp(word, "HIDDEN")) @@ -9372,6 +9390,9 @@ struct { {"LF_NOZONE",LF_NOZONE}, {"LF_SAVEGAME",LF_SAVEGAME}, {"LF_MIXNIGHTSCOUNTDOWN",LF_MIXNIGHTSCOUNTDOWN}, + {"LF_NOTITLECARDFIRST",LF_NOTITLECARDFIRST}, + {"LF_NOTITLECARDRESPAWN",LF_NOTITLECARDRESPAWN}, + {"LF_NOTITLECARDRECORDATTACK",LF_NOTITLECARDRECORDATTACK}, {"LF_NOTITLECARD",LF_NOTITLECARD}, {"LF_WARNINGTITLE",LF_WARNINGTITLE}, // And map flags diff --git a/src/doomstat.h b/src/doomstat.h index c7c12632a..ea4efaede 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -351,15 +351,19 @@ typedef struct } mapheader_t; // level flags -#define LF_SCRIPTISFILE 1 ///< True if the script is a file, not a lump. -#define LF_SPEEDMUSIC 2 ///< Speed up act music for super sneakers -#define LF_NOSSMUSIC 4 ///< Disable Super Sonic music -#define LF_NORELOAD 8 ///< Don't reload level on death -#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_WARNINGTITLE 128 ///< WARNING! WARNING! WARNING! WARNING! -#define LF_NOTITLECARD 256 ///< Don't start the title card +#define LF_SCRIPTISFILE 1<<0 ///< True if the script is a file, not a lump. +#define LF_SPEEDMUSIC 1<<1 ///< Speed up act music for super sneakers +#define LF_NOSSMUSIC 1<<2 ///< Disable Super Sonic music +#define LF_NORELOAD 1<<3 ///< Don't reload level on death +#define LF_NOZONE 1<<4 ///< Don't include "ZONE" on level title +#define LF_SAVEGAME 1<<5 ///< Save the game upon loading this level +#define LF_MIXNIGHTSCOUNTDOWN 1<<6 ///< Play sfx_timeup instead of music change for NiGHTS countdown +#define LF_WARNINGTITLE 1<<7 ///< WARNING! WARNING! WARNING! WARNING! + +#define LF_NOTITLECARDFIRST 1<<8 +#define LF_NOTITLECARDRESPAWN 1<<9 +#define LF_NOTITLECARDRECORDATTACK 1<<10 +#define LF_NOTITLECARD (LF_NOTITLECARDFIRST|LF_NOTITLECARDRESPAWN|LF_NOTITLECARDRECORDATTACK) ///< Don't start the title card at all #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 a350e0f36..f8b24d387 100644 --- a/src/f_wipe.c +++ b/src/f_wipe.c @@ -192,8 +192,7 @@ void F_WipeStageTitle(void) // draw level title if ((WipeStageTitle && st_overlay) && (wipestyle == WIPESTYLE_COLORMAP) - && !(mapheaderinfo[gamemap-1]->levelflags & LF_NOTITLECARD) - && *mapheaderinfo[gamemap-1]->lvlttl != '\0') + && G_IsTitleCardAvailable()) { ST_runTitleCard(); ST_drawWipeTitleCard(); diff --git a/src/g_game.c b/src/g_game.c index 8383782cb..e0bb5179c 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1928,13 +1928,22 @@ void G_PreLevelTitleCard(void) wipestyleflags = WSF_CROSSFADE; } +static boolean titlecardforreload = false; + // // Returns true if the current level has a title card. // boolean G_IsTitleCardAvailable(void) { // The current level header explicitly disabled the title card. - if (mapheaderinfo[gamemap-1]->levelflags & LF_NOTITLECARD) + UINT16 titleflag = LF_NOTITLECARDFIRST; + + if (modeattacking) + titleflag = LF_NOTITLECARDRECORDATTACK; + else if (titlecardforreload) + titleflag = LF_NOTITLECARDRESPAWN; + + if (mapheaderinfo[gamemap-1]->levelflags & titleflag) return false; // The current gametype doesn't have a title card. @@ -3024,7 +3033,9 @@ void G_DoReborn(INT32 playernum) #ifdef HAVE_BLUA LUAh_MapChange(gamemap); #endif + titlecardforreload = true; G_DoLoadLevel(true); + titlecardforreload = false; if (metalrecording) G_BeginMetal(); return; From 19cdb002aba11d24d7fe57dd290d7cd254b0c945 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sun, 9 Feb 2020 17:53:13 -0600 Subject: [PATCH 2/3] More fixes for titlecard option stuff --- src/doomstat.h | 22 +++++++++++----------- src/g_game.c | 2 +- src/st_stuff.c | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/doomstat.h b/src/doomstat.h index ea4efaede..1a46e9b4c 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -351,18 +351,18 @@ typedef struct } mapheader_t; // level flags -#define LF_SCRIPTISFILE 1<<0 ///< True if the script is a file, not a lump. -#define LF_SPEEDMUSIC 1<<1 ///< Speed up act music for super sneakers -#define LF_NOSSMUSIC 1<<2 ///< Disable Super Sonic music -#define LF_NORELOAD 1<<3 ///< Don't reload level on death -#define LF_NOZONE 1<<4 ///< Don't include "ZONE" on level title -#define LF_SAVEGAME 1<<5 ///< Save the game upon loading this level -#define LF_MIXNIGHTSCOUNTDOWN 1<<6 ///< Play sfx_timeup instead of music change for NiGHTS countdown -#define LF_WARNINGTITLE 1<<7 ///< WARNING! WARNING! WARNING! WARNING! +#define LF_SCRIPTISFILE (1<<0) ///< True if the script is a file, not a lump. +#define LF_SPEEDMUSIC (1<<1) ///< Speed up act music for super sneakers +#define LF_NOSSMUSIC (1<<2) ///< Disable Super Sonic music +#define LF_NORELOAD (1<<3) ///< Don't reload level on death +#define LF_NOZONE (1<<4) ///< Don't include "ZONE" on level title +#define LF_SAVEGAME (1<<5) ///< Save the game upon loading this level +#define LF_MIXNIGHTSCOUNTDOWN (1<<6) ///< Play sfx_timeup instead of music change for NiGHTS countdown +#define LF_WARNINGTITLE (1<<7) ///< WARNING! WARNING! WARNING! WARNING! -#define LF_NOTITLECARDFIRST 1<<8 -#define LF_NOTITLECARDRESPAWN 1<<9 -#define LF_NOTITLECARDRECORDATTACK 1<<10 +#define LF_NOTITLECARDFIRST (1<<8) +#define LF_NOTITLECARDRESPAWN (1<<9) +#define LF_NOTITLECARDRECORDATTACK (1<<10) #define LF_NOTITLECARD (LF_NOTITLECARDFIRST|LF_NOTITLECARDRESPAWN|LF_NOTITLECARDRECORDATTACK) ///< Don't start the title card at all #define LF2_HIDEINMENU 1 ///< Hide in the multiplayer menu diff --git a/src/g_game.c b/src/g_game.c index e0bb5179c..e7a5e9279 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1938,7 +1938,7 @@ boolean G_IsTitleCardAvailable(void) // The current level header explicitly disabled the title card. UINT16 titleflag = LF_NOTITLECARDFIRST; - if (modeattacking) + if (modeattacking != ATTACKING_NONE) titleflag = LF_NOTITLECARDRECORDATTACK; else if (titlecardforreload) titleflag = LF_NOTITLECARDRESPAWN; diff --git a/src/st_stuff.c b/src/st_stuff.c index d99d564c8..3a140e4ee 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -2625,7 +2625,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]->levelflags & LF_NOTITLECARD) && *mapheaderinfo[gamemap-1]->lvlttl != '\0' && !(hu_showscores && (netgame || multiplayer))) + if (G_IsTitleCardAvailable() && *mapheaderinfo[gamemap-1]->lvlttl != '\0' && !(hu_showscores && (netgame || multiplayer))) { stagetitle = true; ST_preDrawTitleCard(); From ae53c146e6302227134d29d17800b37a6871398f Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sun, 16 Feb 2020 21:32:03 -0600 Subject: [PATCH 3/3] Allow SHOWTITLECARDFOR = NONE --- src/dehacked.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dehacked.c b/src/dehacked.c index 63cfc8d41..875518b40 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -1841,7 +1841,7 @@ static void readlevelheader(MYFILE *f, INT32 num) mapheaderinfo[num-1]->levelflags &= ~LF_NOTITLECARDRECORDATTACK; else if (fastcmp(tmp, "ALL")) mapheaderinfo[num-1]->levelflags &= ~LF_NOTITLECARD; - else + else if (!fastcmp(tmp, "NONE")) deh_warning("Level header %d: unknown titlecard show option %s\n", num, tmp); } while((tmp = strtok(NULL,",")) != NULL);