summaryrefslogtreecommitdiff
path: root/src/p_saveg.c
diff options
context:
space:
mode:
authorSimon Howard2005-10-16 01:18:10 +0000
committerSimon Howard2005-10-16 01:18:10 +0000
commit8d9ee8259d629ef11a33e6710091f4f9bb15a1a2 (patch)
treed6ffea91332b2118fac999a289e19ff91f27ee02 /src/p_saveg.c
parent6dfceb2ce609dcf05ce4b94ebeb2407f7990374f (diff)
downloadchocolate-doom-8d9ee8259d629ef11a33e6710091f4f9bb15a1a2.tar.gz
chocolate-doom-8d9ee8259d629ef11a33e6710091f4f9bb15a1a2.tar.bz2
chocolate-doom-8d9ee8259d629ef11a33e6710091f4f9bb15a1a2.zip
Global "configdir" variable with directory to store config files in.
Create a function to find the filename for a savegame slot. Store savegames in the config dir. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 202
Diffstat (limited to 'src/p_saveg.c')
-rw-r--r--src/p_saveg.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/p_saveg.c b/src/p_saveg.c
index 41ff403b..0073e6e3 100644
--- a/src/p_saveg.c
+++ b/src/p_saveg.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: p_saveg.c 8 2005-07-23 16:44:57Z fraggle $
+// $Id: p_saveg.c 202 2005-10-16 01:18:10Z fraggle $
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005 Simon Howard
@@ -22,6 +22,11 @@
// 02111-1307, USA.
//
// $Log$
+// Revision 1.3 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
+// savegames in the config dir.
+//
// Revision 1.2 2005/07/23 16:44:56 fraggle
// Update copyright to GNU GPL
//
@@ -35,8 +40,10 @@
//-----------------------------------------------------------------------------
static const char
-rcsid[] = "$Id: p_saveg.c 8 2005-07-23 16:44:57Z fraggle $";
+rcsid[] = "$Id: p_saveg.c 202 2005-10-16 01:18:10Z fraggle $";
+#include "dstrings.h"
+#include "deh_main.h"
#include "i_system.h"
#include "z_zone.h"
#include "p_local.h"
@@ -53,6 +60,18 @@ byte* save_p;
#define PADSAVEP() save_p += (4 - ((int) save_p & 3)) & 3
+char *P_SaveGameFile(int slot)
+{
+ static char filename[256];
+ char basename[32];
+
+ sprintf(basename, DEH_String(SAVEGAMENAME "%d.dsg"), slot);
+
+ sprintf(filename, "%s%s", configdir, basename);
+
+ return filename;
+}
+
//
// P_ArchivePlayers