summaryrefslogtreecommitdiff
path: root/src/hexen
diff options
context:
space:
mode:
Diffstat (limited to 'src/hexen')
-rw-r--r--src/hexen/d_net.c47
-rw-r--r--src/hexen/h2_main.c19
2 files changed, 46 insertions, 20 deletions
diff --git a/src/hexen/d_net.c b/src/hexen/d_net.c
index bacd1332..2483cd5e 100644
--- a/src/hexen/d_net.c
+++ b/src/hexen/d_net.c
@@ -206,17 +206,9 @@ static void InitConnectData(net_connect_data_t *connect_data)
connect_data->is_freedoom = 0;
}
-//
-// D_CheckNetGame
-// Works out player numbers among the net participants
-//
-
-void D_CheckNetGame (void)
+void D_ConnectNetGame(void)
{
net_connect_data_t connect_data;
- net_gamesettings_t settings;
-
- D_RegisterLoopCallbacks(&hexen_loop_interface);
InitConnectData(&connect_data);
netgame = D_InitNetGame(&connect_data);
@@ -233,6 +225,33 @@ void D_CheckNetGame (void)
{
netgame = true;
}
+}
+
+static boolean StartupProgress(int now_ready, int total)
+{
+ static int ready = 0;
+
+ while (ready < now_ready)
+ {
+ ST_NetProgress();
+ ++ready;
+ }
+
+ ready = now_ready;
+
+ return true;
+}
+
+//
+// D_CheckNetGame
+// Works out player numbers among the net participants
+//
+
+void D_CheckNetGame(void)
+{
+ net_gamesettings_t settings;
+
+ D_RegisterLoopCallbacks(&hexen_loop_interface);
if (netgame)
{
@@ -240,8 +259,16 @@ void D_CheckNetGame (void)
}
SaveGameSettings(&settings);
- D_StartNetGame(&settings);
+ D_StartNetGame(&settings, StartupProgress);
LoadGameSettings(&settings);
+
+ // Finish netgame progress on startup screen.
+
+ if (netgame)
+ {
+ StartupProgress(settings.num_players, settings.num_players);
+ ST_NetDone();
+ }
}
//==========================================================================
diff --git a/src/hexen/h2_main.c b/src/hexen/h2_main.c
index 3d9ae87d..7b7a8168 100644
--- a/src/hexen/h2_main.c
+++ b/src/hexen/h2_main.c
@@ -76,6 +76,7 @@ typedef struct
// EXTERNAL FUNCTION PROTOTYPES --------------------------------------------
void R_ExecuteSetViewSize(void);
+void D_ConnectNetGame(void);
void D_CheckNetGame(void);
boolean F_Responder(event_t * ev);
void I_StartupKeyboard(void);
@@ -331,11 +332,6 @@ void D_DoomMain(void)
ST_Message("MN_Init: Init menu system.\n");
MN_Init();
-#ifdef FEATURE_MULTIPLAYER
- ST_Message("NET_Init: Init networking subsystem.\n");
- NET_Init();
-#endif
-
ST_Message("CT_Init: Init chat mode data.\n");
CT_Init();
@@ -351,6 +347,12 @@ void D_DoomMain(void)
I_InitTimer();
I_InitJoystick();
+#ifdef FEATURE_MULTIPLAYER
+ ST_Message("NET_Init: Init networking subsystem.\n");
+ NET_Init();
+#endif
+ D_ConnectNetGame();
+
S_Init();
S_Start();
@@ -372,17 +374,14 @@ void D_DoomMain(void)
// MAPINFO.TXT script must be already processed.
WarpCheck();
- ST_Done();
-
- // Netgame start must be here, after the splash screen has finished.
ST_Message("D_CheckNetGame: Checking network game status.\n");
D_CheckNetGame();
- // SB_Init has been moved here; the status bar must be initialized
- // *after* the netgame has started.
ST_Message("SB_Init: Loading patches.\n");
SB_Init();
+ ST_Done();
+
if (autostart)
{
ST_Message("Warp to Map %d (\"%s\":%d), Skill %d\n",