Organize
This commit is contained in:
parent
9d17614c55
commit
4ea3513076
|
@ -180,6 +180,9 @@ void D_ProcessEvents(void)
|
||||||
if (M_ScreenshotResponder(ev))
|
if (M_ScreenshotResponder(ev))
|
||||||
continue; // ate the event
|
continue; // ate the event
|
||||||
|
|
||||||
|
if (WipeStageTitle)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (gameaction == ga_nothing && gamestate == GS_TITLESCREEN)
|
if (gameaction == ga_nothing && gamestate == GS_TITLESCREEN)
|
||||||
{
|
{
|
||||||
if (cht_Responder(ev))
|
if (cht_Responder(ev))
|
||||||
|
@ -440,7 +443,7 @@ static void D_Display(void)
|
||||||
{
|
{
|
||||||
lt_ticker--;
|
lt_ticker--;
|
||||||
lt_lasttic = lt_ticker;
|
lt_lasttic = lt_ticker;
|
||||||
ST_preLevelTitleCardLoop(0, false);
|
ST_preLevelTitleCardDrawer(0, false);
|
||||||
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, levelfadecol);
|
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, levelfadecol);
|
||||||
F_WipeStartScreen();
|
F_WipeStartScreen();
|
||||||
}
|
}
|
||||||
|
|
44
src/g_game.c
44
src/g_game.c
|
@ -1703,6 +1703,50 @@ void G_DoLoadLevel(boolean resetplayer)
|
||||||
CON_ClearHUD();
|
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;
|
INT32 pausedelay = 0;
|
||||||
boolean pausebreakkey = false;
|
boolean pausebreakkey = false;
|
||||||
static INT32 camtoggledelay, camtoggledelay2 = 0;
|
static INT32 camtoggledelay, camtoggledelay2 = 0;
|
||||||
|
|
|
@ -140,7 +140,8 @@ void G_SpawnPlayer(INT32 playernum, boolean starpost);
|
||||||
void G_DeferedInitNew(boolean pultmode, const char *mapname, INT32 pickedchar,
|
void G_DeferedInitNew(boolean pultmode, const char *mapname, INT32 pickedchar,
|
||||||
boolean SSSG, boolean FLS);
|
boolean SSSG, boolean FLS);
|
||||||
void G_DoLoadLevel(boolean resetplayer);
|
void G_DoLoadLevel(boolean resetplayer);
|
||||||
|
void G_StartTitleCard(void);
|
||||||
|
void G_PreLevelTitleCard(tic_t ticker, boolean update);
|
||||||
void G_DeferedPlayDemo(const char *demo);
|
void G_DeferedPlayDemo(const char *demo);
|
||||||
|
|
||||||
// Can be called by the startup code or M_Responder, calls P_SetupLevel.
|
// Can be called by the startup code or M_Responder, calls P_SetupLevel.
|
||||||
|
|
|
@ -3227,8 +3227,9 @@ boolean P_SetupLevel(boolean skipprecip)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stage title!
|
// Stage title!
|
||||||
WipeStageTitle = (!titlemapinaction);
|
G_StartTitleCard();
|
||||||
ST_startTitleCard();
|
|
||||||
|
// Can the title card actually run, though?
|
||||||
if (rendermode != render_none
|
if (rendermode != render_none
|
||||||
&& WipeStageTitle
|
&& WipeStageTitle
|
||||||
&& ranspecialwipe != 2
|
&& ranspecialwipe != 2
|
||||||
|
@ -3237,10 +3238,7 @@ boolean P_SetupLevel(boolean skipprecip)
|
||||||
&& LUA_HudEnabled(hud_stagetitle)
|
&& LUA_HudEnabled(hud_stagetitle)
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
{
|
G_PreLevelTitleCard(lt_ticker, true);
|
||||||
ST_runTitleCard();
|
|
||||||
ST_runPreLevelTitleCard(lt_ticker, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include "v_video.h"
|
#include "v_video.h"
|
||||||
#include "z_zone.h"
|
#include "z_zone.h"
|
||||||
#include "hu_stuff.h"
|
#include "hu_stuff.h"
|
||||||
|
#include "console.h"
|
||||||
#include "s_sound.h"
|
#include "s_sound.h"
|
||||||
#include "i_system.h"
|
#include "i_system.h"
|
||||||
#include "m_menu.h"
|
#include "m_menu.h"
|
||||||
|
@ -1197,7 +1198,10 @@ static void ST_cacheLevelTitle(void)
|
||||||
//
|
//
|
||||||
void ST_startTitleCard(void)
|
void ST_startTitleCard(void)
|
||||||
{
|
{
|
||||||
|
// cache every HUD patch used
|
||||||
ST_cacheLevelTitle();
|
ST_cacheLevelTitle();
|
||||||
|
|
||||||
|
// initialize HUD variables
|
||||||
lt_ticker = lt_exitticker = lt_lasttic = 0;
|
lt_ticker = lt_exitticker = lt_lasttic = 0;
|
||||||
lt_endtime = 2*TICRATE;
|
lt_endtime = 2*TICRATE;
|
||||||
lt_scroll = BASEVIDWIDTH * FRACUNIT;
|
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);
|
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, levelfadecol);
|
||||||
if (ticker < PRELEVELTIME-1)
|
if (ticker < PRELEVELTIME-1)
|
||||||
|
@ -1335,34 +1339,11 @@ void ST_preLevelTitleCardLoop(tic_t ticker, boolean update)
|
||||||
I_UpdateNoBlit();
|
I_UpdateNoBlit();
|
||||||
if (update)
|
if (update)
|
||||||
I_FinishUpdate(); // page flip or blit buffer
|
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.
|
// Draw the title card while on a wipe.
|
||||||
// Also used in ST_runPreLevelTitleCard.
|
// Also used in G_PreLevelTitleCard.
|
||||||
//
|
//
|
||||||
void ST_drawWipeTitleCard(void)
|
void ST_drawWipeTitleCard(void)
|
||||||
{
|
{
|
||||||
|
@ -1375,6 +1356,12 @@ void ST_drawWipeTitleCard(void)
|
||||||
ST_preDrawTitleCard();
|
ST_preDrawTitleCard();
|
||||||
ST_drawTitleCard();
|
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)
|
static void ST_drawPowerupHUD(void)
|
||||||
|
|
|
@ -52,8 +52,7 @@ void ST_startTitleCard(void);
|
||||||
void ST_preDrawTitleCard(void);
|
void ST_preDrawTitleCard(void);
|
||||||
void ST_runTitleCard(void);
|
void ST_runTitleCard(void);
|
||||||
void ST_drawTitleCard(void);
|
void ST_drawTitleCard(void);
|
||||||
void ST_preLevelTitleCardLoop(tic_t ticker, boolean update);
|
void ST_preLevelTitleCardDrawer(tic_t ticker, boolean update);
|
||||||
void ST_runPreLevelTitleCard(tic_t ticker, boolean update);
|
|
||||||
void ST_drawWipeTitleCard(void);
|
void ST_drawWipeTitleCard(void);
|
||||||
|
|
||||||
extern tic_t lt_ticker, lt_lasttic;
|
extern tic_t lt_ticker, lt_lasttic;
|
||||||
|
|
Loading…
Reference in New Issue