factor out some lumpinfo query into separate functions
This commit is contained in:
parent
fff2e0e058
commit
c247ce4a3c
3 changed files with 14 additions and 2 deletions
|
|
@ -636,7 +636,7 @@ void M_DoSave(int slot)
|
||||||
static void SetDefaultSaveName(int slot)
|
static void SetDefaultSaveName(int slot)
|
||||||
{
|
{
|
||||||
// map from IWAD or PWAD?
|
// map from IWAD or PWAD?
|
||||||
if (maplumpinfo->wad_file == lumpinfo[0]->wad_file)
|
if (W_IsIWADLump(maplumpinfo))
|
||||||
{
|
{
|
||||||
M_snprintf(savegamestrings[itemOn], SAVESTRINGSIZE,
|
M_snprintf(savegamestrings[itemOn], SAVESTRINGSIZE,
|
||||||
"%s", maplumpinfo->name);
|
"%s", maplumpinfo->name);
|
||||||
|
|
@ -644,7 +644,7 @@ static void SetDefaultSaveName(int slot)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
M_snprintf(savegamestrings[itemOn], SAVESTRINGSIZE,
|
M_snprintf(savegamestrings[itemOn], SAVESTRINGSIZE,
|
||||||
"%s: %s", M_BaseName(maplumpinfo->wad_file->path),
|
"%s: %s", W_WadNameForLump(maplumpinfo),
|
||||||
maplumpinfo->name);
|
maplumpinfo->name);
|
||||||
}
|
}
|
||||||
M_ForceUppercase(savegamestrings[itemOn]);
|
M_ForceUppercase(savegamestrings[itemOn]);
|
||||||
|
|
|
||||||
|
|
@ -618,3 +618,12 @@ void W_Reload(void)
|
||||||
W_GenerateHashTable();
|
W_GenerateHashTable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *W_WadNameForLump(const lumpinfo_t *lump)
|
||||||
|
{
|
||||||
|
return M_BaseName(lump->wad_file->path);
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean W_IsIWADLump(const lumpinfo_t *lump)
|
||||||
|
{
|
||||||
|
return lump->wad_file == lumpinfo[0]->wad_file;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -72,4 +72,7 @@ extern unsigned int W_LumpNameHash(const char *s);
|
||||||
void W_ReleaseLumpNum(lumpindex_t lump);
|
void W_ReleaseLumpNum(lumpindex_t lump);
|
||||||
void W_ReleaseLumpName(const char *name);
|
void W_ReleaseLumpName(const char *name);
|
||||||
|
|
||||||
|
const char *W_WadNameForLump(const lumpinfo_t *lump);
|
||||||
|
boolean W_IsIWADLump(const lumpinfo_t *lump);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue