diff options
author | Simon Howard | 2013-04-05 20:15:56 +0000 |
---|---|---|
committer | Simon Howard | 2013-04-05 20:15:56 +0000 |
commit | d71cfa9e4af661ace3f957162fa14cbdba8bd83c (patch) | |
tree | d7ee9b4635c4d44fe071ca0e99ab720706b7ee14 /src/doom | |
parent | 6617f41db080196a0e0844c2fcf6e4f982e161b3 (diff) | |
download | chocolate-doom-d71cfa9e4af661ace3f957162fa14cbdba8bd83c.tar.gz chocolate-doom-d71cfa9e4af661ace3f957162fa14cbdba8bd83c.tar.bz2 chocolate-doom-d71cfa9e4af661ace3f957162fa14cbdba8bd83c.zip |
Split Doom netgame startup into two stages.
Subversion-branch: /branches/v2-branch
Subversion-revision: 2583
Diffstat (limited to 'src/doom')
-rw-r--r-- | src/doom/d_main.c | 52 | ||||
-rw-r--r-- | src/doom/d_net.c | 24 |
2 files changed, 40 insertions, 36 deletions
diff --git a/src/doom/d_main.c b/src/doom/d_main.c index 0746a579..9f8b806c 100644 --- a/src/doom/d_main.c +++ b/src/doom/d_main.c @@ -134,7 +134,8 @@ char mapdir[1024]; // directory of development maps int show_endoom = 1; -void D_CheckNetGame (void); +void D_ConnectNetGame(void); +void D_CheckNetGame(void); // @@ -1366,7 +1367,32 @@ void D_DoomMain (void) if (W_CheckNumForName(name[i])<0) I_Error(DEH_String("\nThis is not the registered version.")); } - + + if (W_CheckNumForName("SS_START") >= 0 + || W_CheckNumForName("FF_END") >= 0) + { + I_PrintDivider(); + printf(" WARNING: The loaded WAD file contains modified sprites or\n" + " floor textures. You may want to use the '-merge' command\n" + " line option instead of '-file'.\n"); + } + + I_PrintStartupBanner(gamedescription); + PrintDehackedBanners(); + + DEH_printf("I_Init: Setting up machine state.\n"); + I_CheckIsScreensaver(); + I_InitTimer(); + I_InitJoystick(); + +#ifdef FEATURE_MULTIPLAYER + printf ("NET_Init: Init network subsystem.\n"); + NET_Init (); +#endif + + // Initial netgame startup. Connect to server etc. + D_ConnectNetGame(); + // get skill / episode / map from parms startskill = sk_medium; startepisode = 1; @@ -1502,18 +1528,6 @@ void D_DoomMain (void) startloadgame = -1; } - if (W_CheckNumForName("SS_START") >= 0 - || W_CheckNumForName("FF_END") >= 0) - { - I_PrintDivider(); - printf(" WARNING: The loaded WAD file contains modified sprites or\n" - " floor textures. You may want to use the '-merge' command\n" - " line option instead of '-file'.\n"); - } - - I_PrintStartupBanner(gamedescription); - PrintDehackedBanners(); - DEH_printf("M_Init: Init miscellaneous info.\n"); M_Init (); @@ -1523,16 +1537,6 @@ void D_DoomMain (void) DEH_printf("\nP_Init: Init Playloop state.\n"); P_Init (); - DEH_printf("I_Init: Setting up machine state.\n"); - I_CheckIsScreensaver(); - I_InitTimer(); - I_InitJoystick(); - -#ifdef FEATURE_MULTIPLAYER - printf ("NET_Init: Init network subsystem.\n"); - NET_Init (); -#endif - DEH_printf("S_Init: Setting up sound.\n"); S_Init (sfxVolume * 8, musicVolume * 8); diff --git a/src/doom/d_net.c b/src/doom/d_net.c index 29e2e7c6..15f1098e 100644 --- a/src/doom/d_net.c +++ b/src/doom/d_net.c @@ -216,20 +216,9 @@ static void InitConnectData(net_connect_data_t *connect_data) connect_data->is_freedoom = W_CheckNumForName("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(&doom_loop_interface); - - // Call D_QuitNetGame on exit - - I_AtExit(D_QuitNetGame, true); InitConnectData(&connect_data); netgame = D_InitNetGame(&connect_data); @@ -246,12 +235,23 @@ void D_CheckNetGame (void) { netgame = true; } +} + +// +// D_CheckNetGame +// Works out player numbers among the net participants +// +void D_CheckNetGame (void) +{ + net_gamesettings_t settings; if (netgame) { autostart = true; } + D_RegisterLoopCallbacks(&doom_loop_interface); + SaveGameSettings(&settings); D_StartNetGame(&settings); LoadGameSettings(&settings); |