[chocolate-doom] 17/31: Fix the '-cdrom' command-line option.
Jonathan Dowland
jmtd at moszumanska.debian.org
Mon Jan 30 15:07:01 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.1
in repository chocolate-doom.
commit 860c6b8691ae2b48fc8b3be22d78d0f5fefc9696
Author: Simon Howard <fraggle at gmail.com>
Date: Sun Oct 16 20:55:50 2005 +0000
Fix the '-cdrom' command-line option.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 204
---
src/d_main.c | 43 +++++++++++++++++++------------------------
src/g_game.c | 14 +++++---------
src/i_video.c | 12 +++++++++---
src/m_menu.c | 18 +++++-------------
4 files changed, 38 insertions(+), 49 deletions(-)
diff --git a/src/d_main.c b/src/d_main.c
index c0d6e8d..6941d6b 100644
--- a/src/d_main.c
+++ b/src/d_main.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: d_main.c 202 2005-10-16 01:18:10Z fraggle $
+// $Id: d_main.c 204 2005-10-16 20:55:50Z fraggle $
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
// 02111-1307, USA.
//
// $Log$
+// Revision 1.29 2005/10/16 20:55:50 fraggle
+// Fix the '-cdrom' command-line option.
+//
// Revision 1.28 2005/10/16 01:18:10 fraggle
// Global "configdir" variable with directory to store config files in.
// Create a function to find the filename for a savegame slot. Store
@@ -130,7 +133,7 @@
//-----------------------------------------------------------------------------
-static const char rcsid[] = "$Id: d_main.c 202 2005-10-16 01:18:10Z fraggle $";
+static const char rcsid[] = "$Id: d_main.c 204 2005-10-16 20:55:50Z fraggle $";
#define BGCOLOR 7
#define FGCOLOR 8
@@ -1112,7 +1115,20 @@ static void SetConfigDir(void)
}
else
{
- configdir = strdup("");
+#ifdef _WIN32
+ // when given the -cdrom option, save config+savegames in
+ // c:\doomdata. This only applies under Windows.
+
+ if (M_CheckParm("-cdrom") > 0)
+ {
+ printf(D_CDROM);
+ configdir = strdup("c:\\doomdata\\");
+ }
+ else
+#endif
+ {
+ configdir = strdup("");
+ }
}
}
@@ -1147,20 +1163,6 @@ void D_DoomMain (void)
if (devparm)
printf(D_DEVSTR);
-#if 0
- // BROKEN: -cdrom option
- if (M_CheckParm("-cdrom"))
- {
- printf(D_CDROM);
-#ifdef _WIN32
- mkdir("c:\\doomdata");
-#else
- mkdir("c:\\doomdata",0);
-#endif
- strcpy (basedefault,"c:/doomdata/default.cfg");
- }
-#endif
-
// find which dir to use for config files
SetConfigDir();
@@ -1430,13 +1432,6 @@ void D_DoomMain (void)
p = M_CheckParm ("-loadgame");
if (p && p < myargc-1)
{
-#if 0
- // -cdrom currently broken
- if (M_CheckParm("-cdrom"))
- sprintf(file, "c:\\doomdata\\"SAVEGAMENAME"%c.dsg",myargv[p+1][0]);
- else
-#endif
-
strcpy(file, P_SaveGameFile(atoi(myargv[p+1])));
G_LoadGame (file);
}
diff --git a/src/g_game.c b/src/g_game.c
index fac2735..a4e32d0 100644
--- a/src/g_game.c
+++ b/src/g_game.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: g_game.c 202 2005-10-16 01:18:10Z fraggle $
+// $Id: g_game.c 204 2005-10-16 20:55:50Z fraggle $
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
// 02111-1307, USA.
//
// $Log$
+// Revision 1.15 2005/10/16 20:55:50 fraggle
+// Fix the '-cdrom' command-line option.
+//
// Revision 1.14 2005/10/16 01:18:10 fraggle
// Global "configdir" variable with directory to store config files in.
// Create a function to find the filename for a savegame slot. Store
@@ -82,7 +85,7 @@
static const char
-rcsid[] = "$Id: g_game.c 202 2005-10-16 01:18:10Z fraggle $";
+rcsid[] = "$Id: g_game.c 204 2005-10-16 20:55:50Z fraggle $";
#include <string.h>
#include <stdlib.h>
@@ -1372,13 +1375,6 @@ void G_DoSaveGame (void)
int length;
int i;
-#if 0
- // -cdrom currently broken
- if (M_CheckParm("-cdrom"))
- sprintf(name,"c:\\doomdata\\"SAVEGAMENAME"%d.dsg",savegameslot);
- else
-#endif
-
strcpy(name, P_SaveGameFile(savegameslot));
description = savedescription;
diff --git a/src/i_video.c b/src/i_video.c
index da8af15..1e89403 100644
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: i_video.c 201 2005-10-15 22:50:57Z fraggle $
+// $Id: i_video.c 204 2005-10-16 20:55:50Z fraggle $
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
// 02111-1307, USA.
//
// $Log$
+// Revision 1.39 2005/10/16 20:55:50 fraggle
+// Fix the '-cdrom' command-line option.
+//
// Revision 1.38 2005/10/15 22:50:57 fraggle
// Fix pink icon on startup
//
@@ -158,7 +161,7 @@
//-----------------------------------------------------------------------------
static const char
-rcsid[] = "$Id: i_video.c 201 2005-10-15 22:50:57Z fraggle $";
+rcsid[] = "$Id: i_video.c 204 2005-10-16 20:55:50Z fraggle $";
#include <SDL.h>
#include <ctype.h>
@@ -285,7 +288,10 @@ static void LoadDiskImage(void)
patch_t *disk;
int y;
- disk = (patch_t *) W_CacheLumpName("STDISK", PU_STATIC);
+ if (M_CheckParm("-cdrom") > 0)
+ disk = (patch_t *) W_CacheLumpName("STCDROM", PU_STATIC);
+ else
+ disk = (patch_t *) W_CacheLumpName("STDISK", PU_STATIC);
V_DrawPatch(0, 0, 0, disk);
disk_image_w = SHORT(disk->width);
diff --git a/src/m_menu.c b/src/m_menu.c
index 2b0d418..555337e 100644
--- a/src/m_menu.c
+++ b/src/m_menu.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: m_menu.c 202 2005-10-16 01:18:10Z fraggle $
+// $Id: m_menu.c 204 2005-10-16 20:55:50Z fraggle $
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
// 02111-1307, USA.
//
// $Log$
+// Revision 1.10 2005/10/16 20:55:50 fraggle
+// Fix the '-cdrom' command-line option.
+//
// Revision 1.9 2005/10/16 01:18:10 fraggle
// Global "configdir" variable with directory to store config files in.
// Create a function to find the filename for a savegame slot. Store
@@ -62,7 +65,7 @@
//-----------------------------------------------------------------------------
static const char
-rcsid[] = "$Id: m_menu.c 202 2005-10-16 01:18:10Z fraggle $";
+rcsid[] = "$Id: m_menu.c 204 2005-10-16 20:55:50Z fraggle $";
#include <stdlib.h>
#include <ctype.h>
@@ -555,12 +558,6 @@ void M_ReadSaveStrings(void)
for (i = 0;i < load_end;i++)
{
-#if 0
- // -cdrom currently broken
- if (M_CheckParm("-cdrom"))
- sprintf(name,"c:\\doomdata\\"SAVEGAMENAME"%d.dsg",i);
- else
-#endif
strcpy(name, P_SaveGameFile(i));
handle = fopen(name, "rb");
@@ -621,11 +618,6 @@ void M_LoadSelect(int choice)
{
char name[256];
-#if 0
- if (M_CheckParm("-cdrom"))
- sprintf(name,"c:\\doomdata\\"SAVEGAMENAME"%d.dsg",choice);
- else
-#endif
strcpy(name, P_SaveGameFile(choice));
G_LoadGame (name);
--
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