foxygit / doom Log in
commit 4df980f534a9ebb5dd5091e43cedca41f9574a92
Author:     Fabian Greffrath <fabian@greffrath.com>
AuthorDate: Tue Jan 8 08:11:30 2019 +0100
Commit:     Fabian Greffrath <fabian@greffrath.com>
CommitDate: Tue Jan 8 08:11:30 2019 +0100

    address raised issues

     - just call M_BaseName() when the basename is needed
     - move maplumpinfo declaration into doom/p_setup.h,
       include w_wad.h for the lumpinfo_t type definition,
       include p_setup.h in doom/m_menu.c
     - remove [crispy] comments, this is going to be Choco code
---
 src/doom/m_menu.c  | 5 ++---
 src/doom/p_setup.c | 3 +--
 src/doom/p_setup.h | 2 ++
 src/w_file.h       | 3 ---
 src/w_wad.c        | 3 ---
 5 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/src/doom/m_menu.c b/src/doom/m_menu.c
index 6383337f..4c08fa8d 100644
--- a/src/doom/m_menu.c
+++ b/src/doom/m_menu.c
@@ -49,6 +49,7 @@
 #include "m_argv.h"
 #include "m_controls.h"
 #include "p_saveg.h"
+#include "p_setup.h"

 #include "s_sound.h"

@@ -634,10 +635,8 @@ void M_DoSave(int slot)
 //
 static void SetDefaultSaveName(int slot)
 {
-    extern lumpinfo_t *maplumpinfo;
-
     M_snprintf(savegamestrings[itemOn], SAVESTRINGSIZE - 1,
-               "%s: %s", maplumpinfo->wad_file->basename,
+               "%s: %s", M_BaseName(maplumpinfo->wad_file->path),
                maplumpinfo->name);
     joypadSave = false;
 }
diff --git a/src/doom/p_setup.c b/src/doom/p_setup.c
index 9d976086..a6e65b5a 100644
--- a/src/doom/p_setup.c
+++ b/src/doom/p_setup.c
@@ -760,7 +760,7 @@ static void P_LoadReject(int lumpnum)
     }
 }

-// [crispy] pointer to the current map lump info struct
+// pointer to the current map lump info struct
 lumpinfo_t *maplumpinfo;

 //
@@ -819,7 +819,6 @@ P_SetupLevel

     lumpnum = W_GetNumForName (lumpname);

-    // [crispy] pointer to the current map lump info struct
     maplumpinfo = lumpinfo[lumpnum];

     leveltime = 0;
diff --git a/src/doom/p_setup.h b/src/doom/p_setup.h
index 9df74162..97ca104e 100644
--- a/src/doom/p_setup.h
+++ b/src/doom/p_setup.h
@@ -20,8 +20,10 @@
 #ifndef __P_SETUP__
 #define __P_SETUP__

+#include "w_wad.h"


+extern lumpinfo_t *maplumpinfo;

 // NOT called by W_Ticker. Fixme.
 void
diff --git a/src/w_file.h b/src/w_file.h
index c883f4af..e31ceaf0 100644
--- a/src/w_file.h
+++ b/src/w_file.h
@@ -53,9 +53,6 @@ struct _wad_file_s

     // File's location on disk.
     const char *path;
-
-    // [crispy] name of this file
-    const char *basename;
 };

 // Open the specified file. Returns a pointer to a new wad_file_t
diff --git a/src/w_wad.c b/src/w_wad.c
index 8eb7f07f..a9ba74b0 100644
--- a/src/w_wad.c
+++ b/src/w_wad.c
@@ -140,9 +140,6 @@ wad_file_t *W_AddFile (const char *filename)
 	return NULL;
     }

-    // [crispy] save the file name
-    wad_file->basename = M_BaseName(wad_file->path);
-
     if (strcasecmp(filename+strlen(filename)-3 , "wad" ) )
     {
 	// single lump file