[chocolate-doom] 67/79: Include the game version in the settings structure.

Jonathan Dowland jmtd at moszumanska.debian.org
Mon Jan 30 15:07:26 UTC 2017


This is an automated email from the git hooks/post-receive script.

jmtd pushed a commit to annotated tag chocolate-doom-0.1.3
in repository chocolate-doom.

commit 5b378612cd308c77be72e5636430368ad713a40d
Author: Simon Howard <fraggle at gmail.com>
Date:   Sat Jan 14 02:06:48 2006 +0000

    Include the game version in the settings structure.
    
    Subversion-branch: /trunk/chocolate-doom
    Subversion-revision: 295
---
 src/d_main.c       | 35 +++++++++++++++++++++++------------
 src/net_client.c   |  6 +++++-
 src/net_defs.h     |  6 +++++-
 src/net_structrw.c |  9 +++++++--
 4 files changed, 40 insertions(+), 16 deletions(-)

diff --git a/src/d_main.c b/src/d_main.c
index f90b331..b683687 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 1dcdf0a..6d69ea4 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 940e654..be4ad0d 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 e09cbd5..a266202 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, 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/chocolate-doom.git



More information about the Pkg-games-commits mailing list