ref: 5b378612cd308c77be72e5636430368ad713a40d
parent: 30d42171fd1dbf114cd55debe9ec626571816741
author: Simon Howard <[email protected]>
date: Fri Jan 13 21:06:48 EST 2006
Include the game version in the settings structure. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 295
--- 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 @@
}
}
- 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 @@
}
}
+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
//
@@ -1585,6 +1594,8 @@
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*/ );
--- 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 @@
settings.episode = startepisode;
settings.map = startmap;
settings.skill = startskill;
+ settings.gameversion = gameversion;
// Send packet
--- 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 @@
int episode;
int map;
int skill;
+ int gameversion;
} net_gamesettings_t;
#define NET_TICDIFF_FORWARD (1 << 0)
--- 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 @@
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 @@
&& 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,