Get rid of basenummapheaders

More oddball differences causing merge conflicts...
This commit is contained in:
GenericHeroGuy 2025-02-11 16:53:21 +01:00
parent 92af45dac5
commit 66f965c2c0
5 changed files with 16 additions and 9 deletions

View file

@ -1506,8 +1506,7 @@ void D_SRB2Main(void)
// conversion sometimes needs the palette
V_ReloadPalette();
P_InitMapData();
basenummapheaders = nummapheaders;
P_InitMapData(false);
CON_SetLoadingProgress(LOADED_IWAD);
@ -1566,7 +1565,7 @@ void D_SRB2Main(void)
//
// search for pwad maps
//
P_InitMapData();
P_InitMapData(true);
HU_LoadGraphics();
}

View file

@ -449,7 +449,7 @@ struct mapheader_t
#define LF2_VISITNEEDED (1<<3) ///< Not available in Time Attack modes until you visit the level
extern mapheader_t** mapheaderinfo;
extern INT32 nummapheaders, basenummapheaders, mapallocsize;
extern INT32 nummapheaders, mapallocsize;
#define MAXMAPLUMPNAME 64 // includes \0, for cleaner savedata

View file

@ -184,7 +184,6 @@ struct quake quake;
// Map Header Information
mapheader_t** mapheaderinfo = {NULL};
INT32 nummapheaders, mapallocsize = 0;
INT32 basenummapheaders = 0;
// Kart cup definitions
cupheader_t *kartcupheaders = NULL;

View file

@ -8674,7 +8674,7 @@ lumpnum_t wadnamelump = LUMPERROR;
INT16 wadnamemap = 0; // gamemap based
// Initialising map data...
UINT8 P_InitMapData(void)
UINT8 P_InitMapData(boolean existingmapheaders)
{
UINT8 ret = 0;
INT32 i;
@ -8691,7 +8691,15 @@ UINT8 P_InitMapData(void)
// Doesn't exist?
if (maplump == INT16_MAX)
{
#ifndef DEVELOP
if (!existingmapheaders)
{
I_Error("P_InitMapData: Base map %s has a header but no level\n", name);
}
#endif
continue;
}
// No change?
if (mapheaderinfo[i]->lumpnum == maplump)
@ -8701,7 +8709,7 @@ UINT8 P_InitMapData(void)
{
ret |= MAPRET_ADDED;
if (basenummapheaders)
if (existingmapheaders)
{
CONS_Printf("%s\n", name);
@ -8714,6 +8722,7 @@ UINT8 P_InitMapData(void)
ret |= MAPRET_CURRENTREPLACED;
}
}
mapheaderinfo[i]->lumpnum = maplump;
if (maplump == wadnamelump)
wadnamemap = i+1;
@ -9008,7 +9017,7 @@ boolean P_MultiSetupWadFiles(boolean fullsetup)
if (partadd_stage == 2)
{
UINT8 mapsadded = P_InitMapData();
UINT8 mapsadded = P_InitMapData(true);
if (!mapsadded)
CONS_Printf(M_GetText("No maps added\n"));

View file

@ -113,7 +113,7 @@ boolean P_AddWadFile(const char *wadfilename, wadcompat_t compat);
#define MAPRET_ADDED (1)
#define MAPRET_CURRENTREPLACED (1<<1)
UINT8 P_InitMapData(void);
UINT8 P_InitMapData(boolean existingmapheaders);
extern lumpnum_t wadnamelump;
extern INT16 wadnamemap;
#define WADNAMECHECK(name) (!strncmp(name, "WADNAME", 7))