shithub: choc

Download patch

ref: 4df980f534a9ebb5dd5091e43cedca41f9574a92
parent: 91dabf53557bd9e9cce527ed70f52ea7f73c77a6
author: Fabian Greffrath <[email protected]>
date: Tue Jan 8 03:11:30 EST 2019

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

--- 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 @@
 //
 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;
 }
--- a/src/doom/p_setup.c
+++ b/src/doom/p_setup.c
@@ -760,7 +760,7 @@
     }
 }
 
-// [crispy] pointer to the current map lump info struct
+// pointer to the current map lump info struct
 lumpinfo_t *maplumpinfo;
 
 //
@@ -819,7 +819,6 @@
 
     lumpnum = W_GetNumForName (lumpname);
 	
-    // [crispy] pointer to the current map lump info struct
     maplumpinfo = lumpinfo[lumpnum];
 
     leveltime = 0;
--- 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
--- a/src/w_file.h
+++ b/src/w_file.h
@@ -53,9 +53,6 @@
 
     // 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 
--- a/src/w_wad.c
+++ b/src/w_wad.c
@@ -140,9 +140,6 @@
 	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