summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Howard2005-10-16 20:55:50 +0000
committerSimon Howard2005-10-16 20:55:50 +0000
commit860c6b8691ae2b48fc8b3be22d78d0f5fefc9696 (patch)
tree05d856b4ca23fc06322493810c74b2b73ec24daa
parente2c0f46e4f64f7970005a66056be85a6929b5227 (diff)
downloadchocolate-doom-860c6b8691ae2b48fc8b3be22d78d0f5fefc9696.tar.gz
chocolate-doom-860c6b8691ae2b48fc8b3be22d78d0f5fefc9696.tar.bz2
chocolate-doom-860c6b8691ae2b48fc8b3be22d78d0f5fefc9696.zip
Fix the '-cdrom' command-line option.
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 204
-rw-r--r--src/d_main.c43
-rw-r--r--src/g_game.c14
-rw-r--r--src/i_video.c12
-rw-r--r--src/m_menu.c18
4 files changed, 38 insertions, 49 deletions
diff --git a/src/d_main.c b/src/d_main.c
index c0d6e8d4..6941d6b8 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 fac27351..a4e32d02 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 da8af154..1e894033 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 2b0d4187..555337e4 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);