summaryrefslogtreecommitdiff
path: root/src/d_iwad.c
diff options
context:
space:
mode:
authorSimon Howard2011-09-05 21:57:23 +0000
committerSimon Howard2011-09-05 21:57:23 +0000
commit9ff63977237ba7d7edb7f863c9a6ad4dd5b07cbe (patch)
tree24897cb4eb0e08f5e53ce2248c87603542e4f5fd /src/d_iwad.c
parentb2318d4849a6cd033372ef9164cd06b74c78583c (diff)
downloadchocolate-doom-9ff63977237ba7d7edb7f863c9a6ad4dd5b07cbe.tar.gz
chocolate-doom-9ff63977237ba7d7edb7f863c9a6ad4dd5b07cbe.tar.bz2
chocolate-doom-9ff63977237ba7d7edb7f863c9a6ad4dd5b07cbe.zip
Refactor savegamedir calculation code to work the same as trunk.
Subversion-branch: /branches/raven-branch Subversion-revision: 2360
Diffstat (limited to 'src/d_iwad.c')
-rw-r--r--src/d_iwad.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/d_iwad.c b/src/d_iwad.c
index 72e3e3ad..5cc31738 100644
--- a/src/d_iwad.c
+++ b/src/d_iwad.c
@@ -727,3 +727,31 @@ iwad_t **D_FindAllIWADs(int mask)
return result;
}
+//
+// Get the IWAD name used for savegames.
+//
+
+char *D_SaveGameIWADName(GameMission_t gamemission)
+{
+ size_t i;
+
+ // Determine the IWAD name to use for savegames.
+ // This determines the directory the savegame files get put into.
+ //
+ // Note that we match on gamemission rather than on IWAD name.
+ // This ensures that doom1.wad and doom.wad saves are stored
+ // in the same place.
+
+ for (i=0; i<arrlen(iwads); ++i)
+ {
+ if (gamemission == iwads[i].mission)
+ {
+ return iwads[i].name;
+ }
+ }
+
+ // Default fallback:
+
+ return "unknown.wad";
+}
+