summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Howard2006-01-14 02:06:48 +0000
committerSimon Howard2006-01-14 02:06:48 +0000
commit5b378612cd308c77be72e5636430368ad713a40d (patch)
tree26ee674b94e0775cbff5b2d19c433e516b35ea32 /src
parent30d42171fd1dbf114cd55debe9ec626571816741 (diff)
downloadchocolate-doom-5b378612cd308c77be72e5636430368ad713a40d.tar.gz
chocolate-doom-5b378612cd308c77be72e5636430368ad713a40d.tar.bz2
chocolate-doom-5b378612cd308c77be72e5636430368ad713a40d.zip
Include the game version in the settings structure.
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 295
Diffstat (limited to 'src')
-rw-r--r--src/d_main.c35
-rw-r--r--src/net_client.c6
-rw-r--r--src/net_defs.h6
-rw-r--r--src/net_structrw.c9
4 files changed, 40 insertions, 16 deletions
diff --git a/src/d_main.c b/src/d_main.c
index f90b331d..b6836871 100644
--- a/src/d_main.c
+++ b/src/d_main.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: d_main.c 291 2006-01-13 23:56:00Z fraggle $
+// $Id: d_main.c 295 2006-01-14 02:06:48Z fraggle $
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
// 02111-1307, USA.
//
// $Log$
+// Revision 1.39 2006/01/14 02:06:48 fraggle
+// Include the game version in the settings structure.
+//
// Revision 1.38 2006/01/13 23:56:00 fraggle
// Add text-mode I/O functions.
// Use text-mode screen for the waiting screen.
@@ -170,7 +173,7 @@
//-----------------------------------------------------------------------------
-static const char rcsid[] = "$Id: d_main.c 291 2006-01-13 23:56:00Z fraggle $";
+static const char rcsid[] = "$Id: d_main.c 295 2006-01-14 02:06:48Z fraggle $";
#define BGCOLOR 7
#define FGCOLOR 8
@@ -1292,16 +1295,6 @@ static void InitGameVersion(void)
}
}
- for (i=0; gameversions[i].description != NULL; ++i)
- {
- if (gameversions[i].version == gameversion)
- {
- printf("InitGameVersion: Emulating the behaviour of the "
- "'%s' executable.\n", gameversions[i].description);
- break;
- }
- }
-
// The original exe does not support retail - 4th episode not supported
if (gameversion < exe_ultimate && gamemode == retail)
@@ -1317,6 +1310,22 @@ static void InitGameVersion(void)
}
}
+void PrintGameVersion(void)
+{
+ int i;
+
+ for (i=0; gameversions[i].description != NULL; ++i)
+ {
+ if (gameversions[i].version == gameversion)
+ {
+ printf("Emulating the behaviour of the "
+ "'%s' executable.\n", gameversions[i].description);
+ break;
+ }
+ }
+}
+
+
//
// D_DoomMain
//
@@ -1586,6 +1595,8 @@ void D_DoomMain (void)
printf ("D_CheckNetGame: Checking network game status.\n");
D_CheckNetGame ();
+ PrintGameVersion();
+
printf ("S_Init: Setting up sound.\n");
S_Init (snd_SfxVolume /* *8 */, snd_MusicVolume /* *8*/ );
diff --git a/src/net_client.c b/src/net_client.c
index 1dcdf0a8..6d69ea46 100644
--- a/src/net_client.c
+++ b/src/net_client.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: net_client.c 290 2006-01-13 23:52:12Z fraggle $
+// $Id: net_client.c 295 2006-01-14 02:06:48Z fraggle $
//
// Copyright(C) 2005 Simon Howard
//
@@ -21,6 +21,9 @@
// 02111-1307, USA.
//
// $Log$
+// Revision 1.21 2006/01/14 02:06:48 fraggle
+// Include the game version in the settings structure.
+//
// Revision 1.20 2006/01/13 23:52:12 fraggle
// Fix game start packet parsing logic.
//
@@ -184,6 +187,7 @@ void NET_CL_StartGame(void)
settings.episode = startepisode;
settings.map = startmap;
settings.skill = startskill;
+ settings.gameversion = gameversion;
// Send packet
diff --git a/src/net_defs.h b/src/net_defs.h
index 940e6540..be4ad0df 100644
--- a/src/net_defs.h
+++ b/src/net_defs.h
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: net_defs.h 281 2006-01-11 01:37:53Z fraggle $
+// $Id: net_defs.h 295 2006-01-14 02:06:48Z fraggle $
//
// Copyright(C) 2005 Simon Howard
//
@@ -21,6 +21,9 @@
// 02111-1307, USA.
//
// $Log$
+// Revision 1.9 2006/01/14 02:06:48 fraggle
+// Include the game version in the settings structure.
+//
// Revision 1.8 2006/01/11 01:37:53 fraggle
// ticcmd diffs: allow compare and patching ticcmds, and reading/writing
// ticdiffs to packets.
@@ -148,6 +151,7 @@ typedef struct
int episode;
int map;
int skill;
+ int gameversion;
} net_gamesettings_t;
#define NET_TICDIFF_FORWARD (1 << 0)
diff --git a/src/net_structrw.c b/src/net_structrw.c
index e09cbd5d..a2662023 100644
--- a/src/net_structrw.c
+++ b/src/net_structrw.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: net_structrw.c 288 2006-01-13 02:22:47Z fraggle $
+// $Id: net_structrw.c 295 2006-01-14 02:06:48Z fraggle $
//
// Copyright(C) 2005 Simon Howard
//
@@ -21,6 +21,9 @@
// 02111-1307, USA.
//
// $Log$
+// Revision 1.5 2006/01/14 02:06:48 fraggle
+// Include the game version in the settings structure.
+//
// Revision 1.4 2006/01/13 02:22:47 fraggle
// Update prototypes to match header. Make sure we include the header in the
// source file.
@@ -55,6 +58,7 @@ void NET_WriteSettings(net_packet_t *packet, net_gamesettings_t *settings)
NET_WriteInt8(packet, settings->episode);
NET_WriteInt8(packet, settings->map);
NET_WriteInt8(packet, settings->skill);
+ NET_WriteInt8(packet, settings->gameversion);
}
boolean NET_ReadSettings(net_packet_t *packet, net_gamesettings_t *settings)
@@ -64,7 +68,8 @@ boolean NET_ReadSettings(net_packet_t *packet, net_gamesettings_t *settings)
&& NET_ReadInt8(packet, (unsigned int *) &settings->deathmatch)
&& NET_ReadInt8(packet, (unsigned int *) &settings->episode)
&& NET_ReadInt8(packet, (unsigned int *) &settings->map)
- && NET_ReadInt8(packet, (unsigned int *) &settings->skill);
+ && NET_ReadInt8(packet, (unsigned int *) &settings->skill)
+ && NET_ReadInt8(packet, (unsigned int *) &settings->gameversion);
}
void NET_WriteTiccmdDiff(net_packet_t *packet, net_ticdiff_t *diff,