summaryrefslogtreecommitdiff
path: root/src/hexen/h2_main.c
diff options
context:
space:
mode:
authorSimon Howard2011-10-14 18:14:34 +0000
committerSimon Howard2011-10-14 18:14:34 +0000
commit2344223e648ca693945fe014bb3162c272bf27ec (patch)
tree53269b0822b53fbef073bd4c4bea180d48d7907c /src/hexen/h2_main.c
parent031c8ff2d2dcb1a94d730d28555989722aeffdea (diff)
downloadchocolate-doom-2344223e648ca693945fe014bb3162c272bf27ec.tar.gz
chocolate-doom-2344223e648ca693945fe014bb3162c272bf27ec.tar.bz2
chocolate-doom-2344223e648ca693945fe014bb3162c272bf27ec.zip
Convert Hexen to use common main loop code. Working multiplayer!
Subversion-branch: /branches/v2-branch Subversion-revision: 2423
Diffstat (limited to 'src/hexen/h2_main.c')
-rw-r--r--src/hexen/h2_main.c46
1 files changed, 18 insertions, 28 deletions
diff --git a/src/hexen/h2_main.c b/src/hexen/h2_main.c
index 20720e4e..d66e27e1 100644
--- a/src/hexen/h2_main.c
+++ b/src/hexen/h2_main.c
@@ -31,6 +31,7 @@
#include <time.h>
#include "config.h"
+#include "doomfeatures.h"
#include "h2def.h"
#include "ct_chat.h"
@@ -44,6 +45,7 @@
#include "m_argv.h"
#include "m_config.h"
#include "m_controls.h"
+#include "net_client.h"
#include "p_local.h"
#include "v_video.h"
#include "w_main.h"
@@ -66,7 +68,6 @@ typedef struct
void R_ExecuteSetViewSize(void);
void D_CheckNetGame(void);
-void G_BuildTiccmd(ticcmd_t * cmd);
void F_Drawer(void);
boolean F_Responder(event_t * ev);
void I_StartupKeyboard(void);
@@ -314,6 +315,11 @@ 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();
@@ -350,20 +356,21 @@ void D_DoomMain(void)
// MAPINFO.TXT script must be already processed.
WarpCheck();
+ ST_Message("SB_Init: Loading patches.\n");
+ SB_Init();
+
+ ST_Done();
+
+ // Netgame start must be here, after the splash screen has finished.
+ ST_Message("D_CheckNetGame: Checking network game status.\n");
+ D_CheckNetGame();
+
if (autostart)
{
ST_Message("Warp to Map %d (\"%s\":%d), Skill %d\n",
WarpMap, P_GetMapName(startmap), startmap, startskill + 1);
}
- ST_Message("D_CheckNetGame: Checking network game status.\n");
- D_CheckNetGame();
-
- ST_Message("SB_Init: Loading patches.\n");
- SB_Init();
-
- ST_Done();
-
CheckRecordFrom();
p = M_CheckParm("-record");
@@ -566,24 +573,8 @@ void H2_GameLoop(void)
I_StartFrame();
// Process one or more tics
- if (singletics)
- {
- I_StartTic();
- H2_ProcessEvents();
- G_BuildTiccmd(&netcmds[consoleplayer][maketic % BACKUPTICS]);
- if (advancedemo)
- {
- H2_DoAdvanceDemo();
- }
- G_Ticker();
- gametic++;
- maketic++;
- }
- else
- {
- // Will run at least one tic
- TryRunTics();
- }
+ // Will run at least one tic
+ TryRunTics();
// Move positional sounds
S_UpdateSounds(players[displayplayer].mo);
@@ -887,4 +878,3 @@ static void CreateSavePath(void)
{
M_MakeDirectory(SavePath);
}
-