summaryrefslogtreecommitdiff
path: root/src/strife
diff options
context:
space:
mode:
authorSimon Howard2011-10-17 18:51:27 +0000
committerSimon Howard2011-10-17 18:51:27 +0000
commit7a8b8e57e7bd6b6a61b8492031bf5e995272e6bf (patch)
treecc5f64c1e9d6b1bd04e401f5a98518f06ac49b0b /src/strife
parent854cb8073a336455d0bcd9b6a40d67c1b4226bb3 (diff)
downloadchocolate-doom-7a8b8e57e7bd6b6a61b8492031bf5e995272e6bf.tar.gz
chocolate-doom-7a8b8e57e7bd6b6a61b8492031bf5e995272e6bf.tar.bz2
chocolate-doom-7a8b8e57e7bd6b6a61b8492031bf5e995272e6bf.zip
Always show the Strife intro splash screen in windowed mode, and finish
the splash screen before network startup. Subversion-branch: /branches/v2-branch Subversion-revision: 2435
Diffstat (limited to 'src/strife')
-rw-r--r--src/strife/d_main.c99
1 files changed, 78 insertions, 21 deletions
diff --git a/src/strife/d_main.c b/src/strife/d_main.c
index 62520e4f..08274636 100644
--- a/src/strife/d_main.c
+++ b/src/strife/d_main.c
@@ -84,6 +84,11 @@
#include "d_main.h"
+// Size of startup splash screen window.
+
+#define INTRO_SCREEN_W 640
+#define INTRO_SCREEN_H 480
+
//
// D-DoomLoop()
// Not a globally visible function,
@@ -494,11 +499,9 @@ void D_DoomLoop (void)
TryRunTics();
- if(!showintro) // [STRIFE]
- {
- I_SetWindowTitle(gamedescription);
- I_InitGraphics();
- }
+ I_SetWindowTitle(gamedescription);
+ I_InitGraphics();
+
I_EnableLoadingDisk();
I_SetGrabMouseCallback(D_GrabMouseCallback);
@@ -1174,10 +1177,38 @@ static void D_IntroBackground(void)
// [STRIFE] New function
// haleyjd 20110206: Initialize the graphical introduction sequence
//
+
+static int saved_screen_width, saved_screen_height;
+static int saved_fullscreen, saved_aspect_ratio_correct;
+
static void D_InitIntroSequence(void)
{
if(showintro)
{
+ // Intro splash screen runs in a window. We must save the actual
+ // display settings, and temporarily overwrite them with the
+ // windowed-mode settings. The real settings will be restored
+ // when the intro screen finishes.
+
+ saved_screen_width = screen_width;
+ saved_screen_height = screen_height;
+ saved_aspect_ratio_correct = aspect_ratio_correct;
+ saved_fullscreen = fullscreen;
+
+ // If the game display settings are to run in a small window, it
+ // makes no sense to switch to a larger window for the splash
+ // screen, so use the configured settings.
+
+ if (fullscreen
+ || screen_width > INTRO_SCREEN_W || screen_height > INTRO_SCREEN_H)
+ {
+ screen_width = INTRO_SCREEN_W;
+ screen_height = INTRO_SCREEN_H;
+ aspect_ratio_correct = 1;
+ }
+
+ fullscreen = 0;
+
// In vanilla Strife, Mode 13h was initialized directly in D_DoomMain.
// We have to be a little more courteous of the low-level code here.
I_SetWindowTitle(gamedescription);
@@ -1214,6 +1245,23 @@ static void D_InitIntroSequence(void)
*/
}
+// End of intro splash screen.
+
+static void D_FinishIntroSequence(void)
+{
+ if (showintro)
+ {
+ I_ShutdownGraphics();
+
+ // Restore display settings to the actual ones.
+
+ screen_width = saved_screen_width;
+ screen_height = saved_screen_height;
+ fullscreen = saved_fullscreen;
+ aspect_ratio_correct = saved_aspect_ratio_correct;
+ }
+}
+
//
// D_DrawIntroSequence
//
@@ -1648,6 +1696,8 @@ void D_DoomMain (void)
D_SetGameDescription();
SetSaveGameDir(iwadfile);
+ I_GraphicsCheckCommandLine();
+
// haleyjd 20110206 [STRIFE] Startup the introduction sequence
D_InitIntroSequence();
@@ -1874,33 +1924,39 @@ void D_DoomMain (void)
if(devparm)
DEH_printf(" Play voices = %d\n", disable_voices == 0);
+ // [STRIFE]: This has been rearranged. These intro ticks occur
+ // further down in Vanilla Strife; however, we have to finish
+ // the intro sequence here so that netgame startup can begin.
+ // The original calls to D_IntroTick() are commented-out below.
+
+ D_IntroTick();
+ D_IntroTick();
+ D_IntroTick();
+ D_IntroTick();
+ D_IntroTick();
+ D_IntroTick();
+ D_IntroTick();
+
+ D_FinishIntroSequence();
+
if(devparm) // [STRIFE]
DEH_printf("D_CheckNetGame: Checking network game status.\n");
D_CheckNetGame ();
- // STRIFE-TODO: This is a temporary hack. The startup splash screen
- // stuff needs to be reworked.
- // The netgame waiting screen killed the graphics display. Re-run
- // I_InitGraphics() to bring it back again.
- if (showintro && netgame)
- {
- I_InitGraphics();
- }
-
PrintGameVersion();
if(devparm)
DEH_printf("HU_Init: Setting up heads up display.\n");
HU_Init ();
- D_IntroTick(); // [STRIFE]
+ //D_IntroTick(); // [STRIFE]
if(devparm)
DEH_printf("ST_Init: Init status bar.\n");
ST_Init ();
- D_IntroTick(); // [STRIFE]
+ //D_IntroTick(); // [STRIFE]
// haleyjd [STRIFE] -statcopy used to be here...
- D_IntroTick();
+ //D_IntroTick(); // [STRIFE]
// If Doom II without a MAP01 lump, this is a store demo.
// Moved this here so that MAP01 isn't constantly looked up
@@ -1926,7 +1982,7 @@ void D_DoomMain (void)
G_RecordDemo (myargv[p+1]);
autostart = true;
}
- D_IntroTick(); // [STRIFE]
+ //D_IntroTick(); // [STRIFE]
p = M_CheckParmWithArgs("-playdemo", 1);
if (p)
@@ -1935,7 +1991,7 @@ void D_DoomMain (void)
G_DeferedPlayDemo (demolumpname);
D_DoomLoop (); // never returns
}
- D_IntroTick(); // [STRIFE]
+ //D_IntroTick(); // [STRIFE]
p = M_CheckParmWithArgs("-timedemo", 1);
if (p)
@@ -1943,14 +1999,15 @@ void D_DoomMain (void)
G_TimeDemo (demolumpname);
D_DoomLoop (); // never returns
}
- D_IntroTick(); // [STRIFE]
+ //D_IntroTick(); // [STRIFE]
if (startloadgame >= 0)
{
// [STRIFE]: different, for hubs
M_LoadSelect(startloadgame);
}
- D_IntroTick(); // [STRIFE]
+ //D_IntroTick(); // [STRIFE]
+
if (gameaction != ga_loadgame )
{