summaryrefslogtreecommitdiff
path: root/src/hexen/d_net.c
diff options
context:
space:
mode:
authorSimon Howard2013-04-05 21:01:45 +0000
committerSimon Howard2013-04-05 21:01:45 +0000
commitf1bde3d5212cab46aa9f40bec29e8a72013f8a41 (patch)
tree4921b10ec05ead1846327d643700623165aca1e5 /src/hexen/d_net.c
parentd3cd96a9dc73d4b261757a34bf1e3c59b48ddf19 (diff)
downloadchocolate-doom-f1bde3d5212cab46aa9f40bec29e8a72013f8a41.tar.gz
chocolate-doom-f1bde3d5212cab46aa9f40bec29e8a72013f8a41.tar.bz2
chocolate-doom-f1bde3d5212cab46aa9f40bec29e8a72013f8a41.zip
Use two-stage startup for Hexen, and add netgame startup callback for
the spinal loading screen. Subversion-branch: /branches/v2-branch Subversion-revision: 2585
Diffstat (limited to 'src/hexen/d_net.c')
-rw-r--r--src/hexen/d_net.c47
1 files changed, 37 insertions, 10 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();
+ }
}
//==========================================================================