mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-23 12:04:38 -04:00
process TRAKINFO in IWADs, introduce process_wad_t flags (#2053)
* add PROCESS_ALL
This commit is contained in:
parent
71bb824efa
commit
ac5ec75838
13
src/d_main.c
13
src/d_main.c
@ -2260,7 +2260,7 @@ void D_DoomMain(void)
|
|||||||
|
|
||||||
if (!M_ParmExists("-nodeh"))
|
if (!M_ParmExists("-nodeh"))
|
||||||
{
|
{
|
||||||
W_ProcessInWads("DEHACKED", ProcessDehLump, true);
|
W_ProcessInWads("DEHACKED", ProcessDehLump, PROCESS_IWAD);
|
||||||
}
|
}
|
||||||
|
|
||||||
// process .deh files specified on the command line with -deh or -bex.
|
// process .deh files specified on the command line with -deh or -bex.
|
||||||
@ -2273,7 +2273,7 @@ void D_DoomMain(void)
|
|||||||
// killough 10/98: now process all deh in wads
|
// killough 10/98: now process all deh in wads
|
||||||
if (!M_ParmExists("-nodeh"))
|
if (!M_ParmExists("-nodeh"))
|
||||||
{
|
{
|
||||||
W_ProcessInWads("DEHACKED", ProcessDehLump, false);
|
W_ProcessInWads("DEHACKED", ProcessDehLump, PROCESS_PWAD);
|
||||||
}
|
}
|
||||||
|
|
||||||
// process .deh files from PWADs autoload directories
|
// process .deh files from PWADs autoload directories
|
||||||
@ -2281,7 +2281,7 @@ void D_DoomMain(void)
|
|||||||
|
|
||||||
PostProcessDeh();
|
PostProcessDeh();
|
||||||
|
|
||||||
W_ProcessInWads("BRGHTMPS", R_ParseBrightmaps, false);
|
W_ProcessInWads("BRGHTMPS", R_ParseBrightmaps, PROCESS_PWAD);
|
||||||
|
|
||||||
// Moved after WAD initialization because we are checking the COMPLVL lump
|
// Moved after WAD initialization because we are checking the COMPLVL lump
|
||||||
G_ReloadDefaults(false); // killough 3/4/98: set defaults just loaded.
|
G_ReloadDefaults(false); // killough 3/4/98: set defaults just loaded.
|
||||||
@ -2310,7 +2310,7 @@ void D_DoomMain(void)
|
|||||||
I_Error("\nThis is not the registered version.");
|
I_Error("\nThis is not the registered version.");
|
||||||
}
|
}
|
||||||
|
|
||||||
W_ProcessInWads("UMAPDEF", U_ParseMapDefInfo, false);
|
W_ProcessInWads("UMAPDEF", U_ParseMapDefInfo, PROCESS_PWAD);
|
||||||
|
|
||||||
//!
|
//!
|
||||||
// @category mod
|
// @category mod
|
||||||
@ -2320,8 +2320,7 @@ void D_DoomMain(void)
|
|||||||
|
|
||||||
if (!M_ParmExists("-nomapinfo"))
|
if (!M_ParmExists("-nomapinfo"))
|
||||||
{
|
{
|
||||||
W_ProcessInWads("UMAPINFO", U_ParseMapInfo, true);
|
W_ProcessInWads("UMAPINFO", U_ParseMapInfo, PROCESS_IWAD | PROCESS_PWAD);
|
||||||
W_ProcessInWads("UMAPINFO", U_ParseMapInfo, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
G_ParseCompDatabase();
|
G_ParseCompDatabase();
|
||||||
@ -2403,7 +2402,7 @@ void D_DoomMain(void)
|
|||||||
startloadgame = -1;
|
startloadgame = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
W_ProcessInWads("TRAKINFO", S_ParseTrakInfo, false);
|
W_ProcessInWads("TRAKINFO", S_ParseTrakInfo, PROCESS_IWAD | PROCESS_PWAD);
|
||||||
|
|
||||||
I_Printf(VB_INFO, "M_Init: Init miscellaneous info.");
|
I_Printf(VB_INFO, "M_Init: Init miscellaneous info.");
|
||||||
M_Init();
|
M_Init();
|
||||||
|
22
src/w_wad.c
22
src/w_wad.c
@ -583,16 +583,24 @@ int W_LumpLengthWithName(int lump, char *name)
|
|||||||
// indicated by the third argument, instead of from a file.
|
// indicated by the third argument, instead of from a file.
|
||||||
|
|
||||||
static void ProcessInWad(int i, const char *name, void (*process)(int lumpnum),
|
static void ProcessInWad(int i, const char *name, void (*process)(int lumpnum),
|
||||||
boolean iwad)
|
process_wad_t flag)
|
||||||
{
|
{
|
||||||
if (i >= 0)
|
if (i >= 0)
|
||||||
{
|
{
|
||||||
ProcessInWad(lumpinfo[i].next, name, process, iwad);
|
ProcessInWad(lumpinfo[i].next, name, process, flag);
|
||||||
|
|
||||||
|
int condition = 0;
|
||||||
|
if (flag & PROCESS_IWAD)
|
||||||
|
{
|
||||||
|
condition |= lumpinfo[i].wad_file == wadfiles[0];
|
||||||
|
}
|
||||||
|
if (flag & PROCESS_PWAD)
|
||||||
|
{
|
||||||
|
condition |= lumpinfo[i].wad_file != wadfiles[0];
|
||||||
|
}
|
||||||
|
|
||||||
if (!strncasecmp(lumpinfo[i].name, name, 8)
|
if (!strncasecmp(lumpinfo[i].name, name, 8)
|
||||||
&& lumpinfo[i].namespace == ns_global
|
&& lumpinfo[i].namespace == ns_global && condition)
|
||||||
&& (iwad ? lumpinfo[i].wad_file == wadfiles[0]
|
|
||||||
: lumpinfo[i].wad_file != wadfiles[0]))
|
|
||||||
{
|
{
|
||||||
process(i);
|
process(i);
|
||||||
}
|
}
|
||||||
@ -600,10 +608,10 @@ static void ProcessInWad(int i, const char *name, void (*process)(int lumpnum),
|
|||||||
}
|
}
|
||||||
|
|
||||||
void W_ProcessInWads(const char *name, void (*process)(int lumpnum),
|
void W_ProcessInWads(const char *name, void (*process)(int lumpnum),
|
||||||
boolean iwad)
|
process_wad_t flags)
|
||||||
{
|
{
|
||||||
ProcessInWad(lumpinfo[W_LumpNameHash(name) % (unsigned)numlumps].index,
|
ProcessInWad(lumpinfo[W_LumpNameHash(name) % (unsigned)numlumps].index,
|
||||||
name, process, iwad);
|
name, process, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
void W_Close(void)
|
void W_Close(void)
|
||||||
|
11
src/w_wad.h
11
src/w_wad.h
@ -114,8 +114,17 @@ extern const char **wadfiles;
|
|||||||
boolean W_InitBaseFile(const char *path);
|
boolean W_InitBaseFile(const char *path);
|
||||||
void W_AddBaseDir(const char *path);
|
void W_AddBaseDir(const char *path);
|
||||||
boolean W_AddPath(const char *path);
|
boolean W_AddPath(const char *path);
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
PROCESS_PWAD = 0x01,
|
||||||
|
PROCESS_IWAD = 0x02,
|
||||||
|
PROCESS_ALL = 0x03
|
||||||
|
} process_wad_t;
|
||||||
|
|
||||||
void W_ProcessInWads(const char *name, void (*process)(int lumpnum),
|
void W_ProcessInWads(const char *name, void (*process)(int lumpnum),
|
||||||
boolean iwad);
|
process_wad_t flags);
|
||||||
|
|
||||||
void W_InitMultipleFiles(void);
|
void W_InitMultipleFiles(void);
|
||||||
|
|
||||||
// killough 4/17/98: if W_CheckNumForName() called with only
|
// killough 4/17/98: if W_CheckNumForName() called with only
|
||||||
|
Loading…
x
Reference in New Issue
Block a user