summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Howard2007-05-16 13:49:04 +0000
committerSimon Howard2007-05-16 13:49:04 +0000
commit07a5c09bb0163a1714912e7480ba6c6e8836a613 (patch)
tree2cff33280f26ffc6af49cd492f472737165c93bf
parent8e024a47e049234fc0502ad723dc165388f6e795 (diff)
downloadchocolate-doom-07a5c09bb0163a1714912e7480ba6c6e8836a613.tar.gz
chocolate-doom-07a5c09bb0163a1714912e7480ba6c6e8836a613.tar.bz2
chocolate-doom-07a5c09bb0163a1714912e7480ba6c6e8836a613.zip
Rejig net_cl_new_sync and drone to be in d_net.c instead of
net_client.c. Fix FEATURE_MULTIPLAYER conditional compile. Move some function definitions in d_net.c into headers. Reorganise the Makefile to split out files into sections based on features. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 875
-rw-r--r--src/Makefile.am76
-rw-r--r--src/d_main.c3
-rw-r--r--src/d_main.h5
-rw-r--r--src/d_net.c26
-rw-r--r--src/d_net.h3
-rw-r--r--src/g_game.h6
-rw-r--r--src/net_client.c8
-rw-r--r--src/net_client.h2
8 files changed, 84 insertions, 45 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index b3ef5c25..9f66577b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -22,21 +22,8 @@ z_native.c z_zone.h
chocolate_server_SOURCES=$(DEDSERV_FILES)
chocolate_server_LDADD = @LDFLAGS@ @SDL_LIBS@ @SDLNET_LIBS@
-SOURCE_FILES=\
+MAIN_SOURCE_FILES=\
am_map.c am_map.h \
-deh_ammo.c \
-deh_cheat.c \
-deh_defs.h \
-deh_frame.c \
-deh_io.c deh_io.h \
-deh_main.c deh_main.h \
-deh_mapping.c deh_mapping.h \
-deh_misc.c deh_misc.h \
-deh_ptr.c \
-deh_sound.c \
-deh_text.c \
-deh_thing.c \
-deh_weapon.c \
d_englsh.h \
d_event.h \
d_items.c d_items.h \
@@ -78,18 +65,6 @@ md5.c md5.h \
memio.c memio.h \
mus2mid.c mus2mid.h \
m_random.c m_random.h \
-net_client.c net_client.h \
-net_common.c net_common.h \
-net_dedicated.c net_dedicated.h \
-net_defs.h \
-net_gui.c net_gui.h \
-net_io.c net_io.h \
-net_loop.c net_loop.h \
-net_packet.c net_packet.h \
-net_query.c net_query.h \
-net_sdl.c net_sdl.h \
-net_server.c net_server.h \
-net_structrw.c net_structrw.h \
p_ceilng.c \
p_doors.c \
p_enemy.c \
@@ -121,7 +96,6 @@ r_segs.c r_segs.h \
r_sky.c r_sky.h \
r_state.h \
r_things.c r_things.h \
-sounds.c sounds.h \
s_sound.c s_sound.h \
st_lib.c st_lib.h \
st_stuff.c st_stuff.h \
@@ -129,10 +103,56 @@ tables.c tables.h \
v_video.c v_video.h \
wi_stuff.c wi_stuff.h \
w_checksum.c w_checksum.h \
-w_merge.c w_merge.h \
w_wad.c w_wad.h \
z_zone.c z_zone.h
+ASDF=\
+sounds.c sounds.h \
+asdf
+
+# source files needed for FEATURE_DEHACKED
+
+FEATURE_DEHACKED_SOURCE_FILES= \
+deh_ammo.c \
+deh_cheat.c \
+deh_defs.h \
+deh_frame.c \
+deh_io.c deh_io.h \
+deh_main.c deh_main.h \
+deh_mapping.c deh_mapping.h \
+deh_misc.c deh_misc.h \
+deh_ptr.c \
+deh_sound.c \
+deh_text.c \
+deh_thing.c \
+deh_weapon.c
+
+# source files needed for FEATURE_MULTIPLAYER
+
+FEATURE_MULTIPLAYER_SOURCE_FILES= \
+net_client.c net_client.h \
+net_common.c net_common.h \
+net_dedicated.c net_dedicated.h \
+net_defs.h \
+net_gui.c net_gui.h \
+net_io.c net_io.h \
+net_loop.c net_loop.h \
+net_packet.c net_packet.h \
+net_query.c net_query.h \
+net_sdl.c net_sdl.h \
+net_server.c net_server.h \
+net_structrw.c net_structrw.h
+
+# source files needed for FEATURE_WAD_MERGE
+
+FEATURE_WAD_MERGE_SOURCE_FILES = \
+w_merge.c w_merge.h
+
+SOURCE_FILES = $(MAIN_SOURCE_FILES) \
+ $(FEATURE_DEHACKED_SOURCE_FILES) \
+ $(FEATURE_MULTIPLAYER_SOURCE_FILES) \
+ $(FEATURE_WAD_MERGE_SOURCE_FILES)
+
if HAVE_WINDRES
chocolate_doom_SOURCES=$(SOURCE_FILES) chocolate-doom-res.rc
else
diff --git a/src/d_main.c b/src/d_main.c
index 1d758cca..b27f833e 100644
--- a/src/d_main.c
+++ b/src/d_main.c
@@ -791,6 +791,7 @@ void D_DoomMain (void)
printf (DEH_String("Z_Init: Init zone memory allocation daemon. \n"));
Z_Init ();
+#ifdef FEATURE_MULTIPLAYER
//!
// @category net
//
@@ -829,6 +830,8 @@ void D_DoomMain (void)
if (M_CheckParm("-search"))
NET_LANQuery();
+
+#endif
#ifdef FEATURE_DEHACKED
printf("DEH_Init: Init Dehacked support.\n");
diff --git a/src/d_main.h b/src/d_main.h
index 04f7e8be..14536447 100644
--- a/src/d_main.h
+++ b/src/d_main.h
@@ -48,6 +48,9 @@ void D_PostEvent (event_t *ev);
event_t *D_PopEvent(void);
+// Read events from all input devices
+
+void D_ProcessEvents (void);
//
@@ -56,6 +59,8 @@ event_t *D_PopEvent(void);
void D_PageTicker (void);
void D_PageDrawer (void);
void D_AdvanceDemo (void);
+void D_DoAdvanceDemo (void);
void D_StartTitle (void);
+
#endif
diff --git a/src/d_net.c b/src/d_net.c
index 559bd448..a46c4c51 100644
--- a/src/d_net.c
+++ b/src/d_net.c
@@ -67,17 +67,31 @@ int nettics[MAXPLAYERS];
int maketic;
+// Used for original sync code.
+
int lastnettic;
-int skiptics;
-int ticdup;
+int skiptics = 0;
+
+// Reduce the bandwidth needed by sampling game input less and transmitting
+// less. If ticdup is 2, sample half normal, 3 = one third normal, etc.
+
+int ticdup;
+
+// Send this many extra (backup) tics in each packet.
+
int extratics;
+
+// Amount to offset the timer for game sync.
+
fixed_t offsetms;
+// Use new client syncronisation code
+
+boolean net_cl_new_sync = true;
+
+// Connected but not participating in the game (observer)
-void D_ProcessEvents (void);
-void G_BuildTiccmd (ticcmd_t *cmd);
-void D_DoAdvanceDemo (void);
-
+boolean drone = false;
// 35 fps clock adjusted by offsetms milliseconds
diff --git a/src/d_net.h b/src/d_net.h
index b2e06666..df3d2d4b 100644
--- a/src/d_net.h
+++ b/src/d_net.h
@@ -50,5 +50,8 @@ void TryRunTics (void);
// Called at start of game loop to initialise timers
void D_StartGameLoop(void);
+extern boolean drone;
+extern boolean net_cl_new_sync;
+
#endif
diff --git a/src/g_game.h b/src/g_game.h
index a32a8987..65fb06b0 100644
--- a/src/g_game.h
+++ b/src/g_game.h
@@ -30,7 +30,7 @@
#include "doomdef.h"
#include "d_event.h"
-
+#include "d_ticcmd.h"
//
@@ -70,6 +70,10 @@ void G_SecretExitLevel (void);
void G_WorldDone (void);
+// Read current data from inputs and build a player movement command.
+
+void G_BuildTiccmd (ticcmd_t *cmd);
+
void G_Ticker (void);
boolean G_Responder (event_t* ev);
diff --git a/src/net_client.c b/src/net_client.c
index 96e31986..e367df67 100644
--- a/src/net_client.c
+++ b/src/net_client.c
@@ -182,14 +182,6 @@ unsigned int net_local_is_freedoom;
static fixed_t average_latency;
-// Use new-style ticcmd sync (fixes indigo lag)
-
-boolean net_cl_new_sync = true;
-
-// Connected but not participating in the game (observer)
-
-boolean drone = false;
-
#define NET_CL_ExpandTicNum(b) NET_ExpandTicNum(recvwindow_start, (b))
// Called when a player leaves the game
diff --git a/src/net_client.h b/src/net_client.h
index 688cadaa..7c124e3f 100644
--- a/src/net_client.h
+++ b/src/net_client.h
@@ -50,8 +50,6 @@ extern char net_player_names[MAXPLAYERS][MAXPLAYERNAME];
extern char net_player_addresses[MAXPLAYERS][MAXPLAYERNAME];
extern int net_player_number;
extern char *net_player_name;
-extern boolean net_cl_new_sync;
-extern boolean drone;
extern md5_digest_t net_server_wad_md5sum;
extern md5_digest_t net_server_deh_md5sum;