summaryrefslogtreecommitdiff
path: root/src/heretic/mn_menu.c
diff options
context:
space:
mode:
authorSimon Howard2011-09-05 22:18:16 +0000
committerSimon Howard2011-09-05 22:18:16 +0000
commit5d82119ccad9476d5db479f81952e56cef0e1751 (patch)
treed72ccd12d3618bb111cc637aea684d6984767a85 /src/heretic/mn_menu.c
parent9ff63977237ba7d7edb7f863c9a6ad4dd5b07cbe (diff)
downloadchocolate-doom-5d82119ccad9476d5db479f81952e56cef0e1751.tar.gz
chocolate-doom-5d82119ccad9476d5db479f81952e56cef0e1751.tar.bz2
chocolate-doom-5d82119ccad9476d5db479f81952e56cef0e1751.zip
Store Heretic savegames in the configuration directory, as with Doom
savegames. Subversion-branch: /branches/raven-branch Subversion-revision: 2361
Diffstat (limited to 'src/heretic/mn_menu.c')
-rw-r--r--src/heretic/mn_menu.c31
1 files changed, 11 insertions, 20 deletions
diff --git a/src/heretic/mn_menu.c b/src/heretic/mn_menu.c
index 955e0124..930df426 100644
--- a/src/heretic/mn_menu.c
+++ b/src/heretic/mn_menu.c
@@ -645,19 +645,14 @@ void MN_LoadSlotText(void)
FILE *fp;
int count;
int i;
- char name[256];
+ char *filename;
for (i = 0; i < 6; i++)
{
- if (cdrom)
- {
- sprintf(name, SAVEGAMENAMECD "%d.hsg", i);
- }
- else
- {
- sprintf(name, SAVEGAMENAME "%d.hsg", i);
- }
- fp = fopen(name, "rb+");
+ filename = SV_Filename(i);
+ fp = fopen(filename, "rb+");
+ free(filename);
+
if (!fp)
{
SlotText[i][0] = 0; // empty the string
@@ -826,21 +821,17 @@ static boolean SCMessages(int option)
static boolean SCLoadGame(int option)
{
- char name[256];
+ char *filename;
if (!SlotStatus[option])
{ // slot's empty...don't try and load
return false;
}
- if (cdrom)
- {
- sprintf(name, SAVEGAMENAMECD "%d.hsg", option);
- }
- else
- {
- sprintf(name, SAVEGAMENAME "%d.hsg", option);
- }
- G_LoadGame(name);
+
+ filename = SV_Filename(option);
+ G_LoadGame(filename);
+ free(filename);
+
MN_DeactivateMenu();
BorderNeedRefresh = true;
if (quickload == -1)