Title card fixes.

This commit is contained in:
Jaime Passos 2019-12-24 16:22:25 -03:00
parent 5b4d587b1a
commit 9319014d8d
3 changed files with 28 additions and 1 deletions

View File

@ -1895,7 +1895,7 @@ void G_StartTitleCard(void)
// The title card has been disabled for this map.
// Oh well.
if ((mapheaderinfo[gamemap-1]->levelflags & LF_NOTITLECARD) || (gametyperules & GTR_NOTITLECARD))
if (!G_IsTitleCardAvailable())
{
WipeStageTitle = false;
return;
@ -1938,6 +1938,23 @@ void G_PreLevelTitleCard(void)
}
}
//
// 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)
return false;
// The current gametype doesn't have a title card.
if (gametyperules & GTR_NOTITLECARD)
return false;
// The title card is available.
return true;
}
INT32 pausedelay = 0;
boolean pausebreakkey = false;
static INT32 camtoggledelay, camtoggledelay2 = 0;

View File

@ -143,6 +143,7 @@ void G_DeferedInitNew(boolean pultmode, const char *mapname, INT32 pickedchar,
void G_DoLoadLevel(boolean resetplayer);
void G_StartTitleCard(void);
void G_PreLevelTitleCard(void);
boolean G_IsTitleCardAvailable(void);
void G_DeferedPlayDemo(const char *demo);
// Can be called by the startup code or M_Responder, calls P_SetupLevel.

View File

@ -1216,6 +1216,9 @@ void ST_startTitleCard(void)
//
void ST_preDrawTitleCard(void)
{
if (!G_IsTitleCardAvailable())
return;
if (lt_ticker >= (lt_endtime + TICRATE))
return;
@ -1231,6 +1234,9 @@ void ST_preDrawTitleCard(void)
//
void ST_runTitleCard(void)
{
if (!G_IsTitleCardAvailable())
return;
if (lt_ticker >= (lt_endtime + TICRATE))
return;
@ -1284,6 +1290,9 @@ void ST_drawTitleCard(void)
INT32 zzticker;
patch_t *actpat, *zigzag, *zztext;
if (!G_IsTitleCardAvailable())
return;
#ifdef HAVE_BLUA
if (!LUA_HudEnabled(hud_stagetitle))
goto luahook;