summaryrefslogtreecommitdiff
path: root/src/d_loop.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/d_loop.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/d_loop.c')
-rw-r--r--src/d_loop.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/d_loop.c b/src/d_loop.c
index 04d6ef0f..8dad478d 100644
--- a/src/d_loop.c
+++ b/src/d_loop.c
@@ -313,7 +313,8 @@ void D_StartGameLoop(void)
// Block until the game start message is received from the server.
//
-void D_BlockUntilStart(net_gamesettings_t *settings)
+static void BlockUntilStart(net_gamesettings_t *settings,
+ netgame_startup_callback_t callback)
{
while (!NET_CL_GetSettings(settings))
{
@@ -324,10 +325,17 @@ void D_BlockUntilStart(net_gamesettings_t *settings)
{
I_Error("Lost connection to server");
}
+
+ if (callback != NULL && !callback(net_client_wait_data.ready_players,
+ net_client_wait_data.num_players))
+ {
+ I_Error("Netgame startup aborted.");
+ }
}
}
-void D_StartNetGame(net_gamesettings_t *settings)
+void D_StartNetGame(net_gamesettings_t *settings,
+ netgame_startup_callback_t callback)
{
int i;
@@ -384,7 +392,7 @@ void D_StartNetGame(net_gamesettings_t *settings)
// from the server.
NET_CL_StartGame(settings);
- D_BlockUntilStart(settings);
+ BlockUntilStart(settings, callback);
// Read the game settings that were received.