This commit is contained in:
Jaime Passos 2019-11-18 12:56:41 -03:00
parent 9d17614c55
commit 4ea3513076
6 changed files with 68 additions and 36 deletions

View File

@ -180,6 +180,9 @@ void D_ProcessEvents(void)
if (M_ScreenshotResponder(ev))
continue; // ate the event
if (WipeStageTitle)
continue;
if (gameaction == ga_nothing && gamestate == GS_TITLESCREEN)
{
if (cht_Responder(ev))
@ -440,7 +443,7 @@ static void D_Display(void)
{
lt_ticker--;
lt_lasttic = lt_ticker;
ST_preLevelTitleCardLoop(0, false);
ST_preLevelTitleCardDrawer(0, false);
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, levelfadecol);
F_WipeStartScreen();
}

View File

@ -1703,6 +1703,50 @@ void G_DoLoadLevel(boolean resetplayer)
CON_ClearHUD();
}
//
// Start the title card.
//
void G_StartTitleCard(void)
{
// clear the hud
CON_ClearHUD();
// prepare status bar
ST_startTitleCard();
// start the title card
WipeStageTitle = (!titlemapinaction);
}
//
// Run the title card before fading in to the level.
//
void G_PreLevelTitleCard(tic_t ticker, boolean update)
{
tic_t starttime = I_GetTime();
tic_t endtime = starttime + (PRELEVELTIME*NEWTICRATERATIO);
tic_t nowtime = starttime;
tic_t lasttime = starttime;
while (nowtime < endtime)
{
// draw loop
while (!((nowtime = I_GetTime()) - lasttime))
I_Sleep();
lasttime = nowtime;
// Run some bullshit whatever
D_ProcessEvents();
ST_runTitleCard();
ST_preLevelTitleCardDrawer(ticker, update);
if (moviemode)
M_SaveFrame();
if (takescreenshot) // Only take screenshots after drawing.
M_DoScreenShot();
}
}
INT32 pausedelay = 0;
boolean pausebreakkey = false;
static INT32 camtoggledelay, camtoggledelay2 = 0;

View File

@ -140,7 +140,8 @@ void G_SpawnPlayer(INT32 playernum, boolean starpost);
void G_DeferedInitNew(boolean pultmode, const char *mapname, INT32 pickedchar,
boolean SSSG, boolean FLS);
void G_DoLoadLevel(boolean resetplayer);
void G_StartTitleCard(void);
void G_PreLevelTitleCard(tic_t ticker, boolean update);
void G_DeferedPlayDemo(const char *demo);
// Can be called by the startup code or M_Responder, calls P_SetupLevel.

View File

@ -3227,8 +3227,9 @@ boolean P_SetupLevel(boolean skipprecip)
}
// Stage title!
WipeStageTitle = (!titlemapinaction);
ST_startTitleCard();
G_StartTitleCard();
// Can the title card actually run, though?
if (rendermode != render_none
&& WipeStageTitle
&& ranspecialwipe != 2
@ -3237,10 +3238,7 @@ boolean P_SetupLevel(boolean skipprecip)
&& LUA_HudEnabled(hud_stagetitle)
#endif
)
{
ST_runTitleCard();
ST_runPreLevelTitleCard(lt_ticker, true);
}
G_PreLevelTitleCard(lt_ticker, true);
return true;
}

View File

@ -23,6 +23,7 @@
#include "v_video.h"
#include "z_zone.h"
#include "hu_stuff.h"
#include "console.h"
#include "s_sound.h"
#include "i_system.h"
#include "m_menu.h"
@ -1197,7 +1198,10 @@ static void ST_cacheLevelTitle(void)
//
void ST_startTitleCard(void)
{
// cache every HUD patch used
ST_cacheLevelTitle();
// initialize HUD variables
lt_ticker = lt_exitticker = lt_lasttic = 0;
lt_endtime = 2*TICRATE;
lt_scroll = BASEVIDWIDTH * FRACUNIT;
@ -1323,9 +1327,9 @@ void ST_drawTitleCard(void)
}
//
// Drawer for ST_runPreLevelTitleCard.
// Drawer for G_PreLevelTitleCard.
//
void ST_preLevelTitleCardLoop(tic_t ticker, boolean update)
void ST_preLevelTitleCardDrawer(tic_t ticker, boolean update)
{
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, levelfadecol);
if (ticker < PRELEVELTIME-1)
@ -1335,34 +1339,11 @@ void ST_preLevelTitleCardLoop(tic_t ticker, boolean update)
I_UpdateNoBlit();
if (update)
I_FinishUpdate(); // page flip or blit buffer
if (moviemode) // make sure we save frames for the white hold too
M_SaveFrame();
}
//
// Run the title card before fading in to the level.
//
void ST_runPreLevelTitleCard(tic_t ticker, boolean update)
{
tic_t starttime = I_GetTime();
tic_t endtime = starttime + (PRELEVELTIME*NEWTICRATERATIO);
tic_t nowtime = starttime;
tic_t lasttime = starttime;
while (nowtime < endtime)
{
// draw loop
while (!((nowtime = I_GetTime()) - lasttime))
I_Sleep();
lasttime = nowtime;
ST_runTitleCard();
ST_preLevelTitleCardLoop(ticker, update);
}
}
//
// Draw the title card while on a wipe.
// Also used in ST_runPreLevelTitleCard.
// Also used in G_PreLevelTitleCard.
//
void ST_drawWipeTitleCard(void)
{
@ -1375,6 +1356,12 @@ void ST_drawWipeTitleCard(void)
ST_preDrawTitleCard();
ST_drawTitleCard();
}
// Draw on top of the title card,
// which is already on top of the wipe
// What a mess
CON_Drawer();
M_Drawer();
}
static void ST_drawPowerupHUD(void)

View File

@ -52,8 +52,7 @@ void ST_startTitleCard(void);
void ST_preDrawTitleCard(void);
void ST_runTitleCard(void);
void ST_drawTitleCard(void);
void ST_preLevelTitleCardLoop(tic_t ticker, boolean update);
void ST_runPreLevelTitleCard(tic_t ticker, boolean update);
void ST_preLevelTitleCardDrawer(tic_t ticker, boolean update);
void ST_drawWipeTitleCard(void);
extern tic_t lt_ticker, lt_lasttic;