mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-22 04:01:31 +00:00
load id24res if present
This commit is contained in:
parent
855b7fc026
commit
bcedd6d1f4
3 changed files with 56 additions and 4 deletions
|
@ -111,6 +111,12 @@ void FIWadManager::ParseIWadInfo(const char *fn, const char *data, int datasize,
|
||||||
iwad->prio = sc.Number;
|
iwad->prio = sc.Number;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (sc.Compare("SupportWAD"))
|
||||||
|
{
|
||||||
|
sc.MustGetStringName("=");
|
||||||
|
sc.MustGetString();
|
||||||
|
iwad->SupportWAD = sc.String;
|
||||||
|
}
|
||||||
else if (sc.Compare("Config"))
|
else if (sc.Compare("Config"))
|
||||||
{
|
{
|
||||||
sc.MustGetStringName("=");
|
sc.MustGetStringName("=");
|
||||||
|
@ -558,6 +564,18 @@ void FIWadManager::ValidateIWADs()
|
||||||
|
|
||||||
static bool havepicked = false;
|
static bool havepicked = false;
|
||||||
|
|
||||||
|
|
||||||
|
FString FIWadManager::IWADPathFileSearch(const FString &file)
|
||||||
|
{
|
||||||
|
for(const FString &path : mSearchPaths)
|
||||||
|
{
|
||||||
|
FString f = path + "/" + file;
|
||||||
|
if(FileExists(f)) return f;
|
||||||
|
}
|
||||||
|
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
int FIWadManager::IdentifyVersion (std::vector<std::string>&wadfiles, const char *iwad, const char *zdoom_wad, const char *optional_wad)
|
int FIWadManager::IdentifyVersion (std::vector<std::string>&wadfiles, const char *iwad, const char *zdoom_wad, const char *optional_wad)
|
||||||
{
|
{
|
||||||
const char *iwadparm = Args->CheckValue ("-iwad");
|
const char *iwadparm = Args->CheckValue ("-iwad");
|
||||||
|
@ -798,11 +816,11 @@ int FIWadManager::IdentifyVersion (std::vector<std::string>&wadfiles, const char
|
||||||
D_AddFile (wadfiles, zdoom_wad, true, -1, GameConfig);
|
D_AddFile (wadfiles, zdoom_wad, true, -1, GameConfig);
|
||||||
|
|
||||||
// [SP] Load non-free assets if available. This must be done before the IWAD.
|
// [SP] Load non-free assets if available. This must be done before the IWAD.
|
||||||
int iwadnum;
|
int iwadnum = 1;
|
||||||
if (D_AddFile(wadfiles, optional_wad, true, -1, GameConfig))
|
if (D_AddFile(wadfiles, optional_wad, true, -1, GameConfig))
|
||||||
iwadnum = 2;
|
{
|
||||||
else
|
iwadnum++;
|
||||||
iwadnum = 1;
|
}
|
||||||
|
|
||||||
fileSystem.SetIwadNum(iwadnum);
|
fileSystem.SetIwadNum(iwadnum);
|
||||||
if (picks[pick].mRequiredPath.IsNotEmpty())
|
if (picks[pick].mRequiredPath.IsNotEmpty())
|
||||||
|
@ -814,6 +832,17 @@ int FIWadManager::IdentifyVersion (std::vector<std::string>&wadfiles, const char
|
||||||
fileSystem.SetMaxIwadNum(iwadnum);
|
fileSystem.SetMaxIwadNum(iwadnum);
|
||||||
|
|
||||||
auto info = mIWadInfos[picks[pick].mInfoIndex];
|
auto info = mIWadInfos[picks[pick].mInfoIndex];
|
||||||
|
|
||||||
|
if(info.SupportWAD.IsNotEmpty())
|
||||||
|
{
|
||||||
|
FString supportWAD = IWADPathFileSearch(info.SupportWAD);
|
||||||
|
|
||||||
|
if(supportWAD.IsNotEmpty())
|
||||||
|
{
|
||||||
|
D_AddFile(wadfiles, supportWAD.GetChars(), true, -1, GameConfig);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Load additional resources from the same directory as the IWAD itself.
|
// Load additional resources from the same directory as the IWAD itself.
|
||||||
for (unsigned i=0; i < info.Load.Size(); i++)
|
for (unsigned i=0; i < info.Load.Size(); i++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -76,6 +76,7 @@ struct FIWADInfo
|
||||||
FString Name; // Title banner text for this IWAD
|
FString Name; // Title banner text for this IWAD
|
||||||
FString Autoname; // Name of autoload ini section for this IWAD
|
FString Autoname; // Name of autoload ini section for this IWAD
|
||||||
FString IWadname; // Default name this game would use - this is for IWAD detection in GAMEINFO.
|
FString IWadname; // Default name this game would use - this is for IWAD detection in GAMEINFO.
|
||||||
|
FString SupportWAD; // Optional support WAD, load if present (initially implemented for id24)
|
||||||
int prio = 0; // selection priority for given IWAD name.
|
int prio = 0; // selection priority for given IWAD name.
|
||||||
FString Configname; // Name of config section for this IWAD
|
FString Configname; // Name of config section for this IWAD
|
||||||
FString Required; // Requires another IWAD
|
FString Required; // Requires another IWAD
|
||||||
|
@ -132,7 +133,9 @@ class FIWadManager
|
||||||
void CollectSearchPaths();
|
void CollectSearchPaths();
|
||||||
void AddIWADCandidates(const char *dir);
|
void AddIWADCandidates(const char *dir);
|
||||||
void ValidateIWADs();
|
void ValidateIWADs();
|
||||||
|
FString IWADPathFileSearch(const FString &file);
|
||||||
public:
|
public:
|
||||||
|
|
||||||
FIWadManager(const char *fn, const char *fnopt);
|
FIWadManager(const char *fn, const char *fnopt);
|
||||||
const FIWADInfo *FindIWAD(std::vector<std::string>& wadfiles, const char *iwad, const char *basewad, const char *optionalwad);
|
const FIWADInfo *FindIWAD(std::vector<std::string>& wadfiles, const char *iwad, const char *basewad, const char *optionalwad);
|
||||||
const FString *GetAutoname(unsigned int num) const
|
const FString *GetAutoname(unsigned int num) const
|
||||||
|
|
|
@ -334,6 +334,7 @@ IWad
|
||||||
"DMENUPIC", "M_ACPT", "M_CAN", "M_EXITO", "M_CHG"
|
"DMENUPIC", "M_ACPT", "M_CAN", "M_EXITO", "M_CHG"
|
||||||
BannerColors = "54 54 54", "a8 a8 a8"
|
BannerColors = "54 54 54", "a8 a8 a8"
|
||||||
IgnoreTitlePatches = 1
|
IgnoreTitlePatches = 1
|
||||||
|
SupportWAD = "id24res.wad"
|
||||||
}
|
}
|
||||||
|
|
||||||
IWad
|
IWad
|
||||||
|
@ -352,6 +353,7 @@ IWad
|
||||||
Load = "extras.wad"
|
Load = "extras.wad"
|
||||||
BannerColors = "00 7c 00", "a8 a8 a8"
|
BannerColors = "00 7c 00", "a8 a8 a8"
|
||||||
IgnoreTitlePatches = 1
|
IgnoreTitlePatches = 1
|
||||||
|
SupportWAD = "id24res.wad"
|
||||||
}
|
}
|
||||||
|
|
||||||
IWad
|
IWad
|
||||||
|
@ -370,6 +372,7 @@ IWad
|
||||||
Load = "extras.wad", "soundtrack"
|
Load = "extras.wad", "soundtrack"
|
||||||
BannerColors = "00 7c 00", "a8 a8 a8"
|
BannerColors = "00 7c 00", "a8 a8 a8"
|
||||||
IgnoreTitlePatches = 1
|
IgnoreTitlePatches = 1
|
||||||
|
SupportWAD = "id24res.wad"
|
||||||
}
|
}
|
||||||
|
|
||||||
IWad
|
IWad
|
||||||
|
@ -384,6 +387,7 @@ IWad
|
||||||
MustContain = "SMOOSHED", "ANIMDEFS", "LANGUAGE", "MAPINFO", "ENDOOM", "M_DOOM", "TITLEPIC", "TEXTURES"
|
MustContain = "SMOOSHED", "ANIMDEFS", "LANGUAGE", "MAPINFO", "ENDOOM", "M_DOOM", "TITLEPIC", "TEXTURES"
|
||||||
BannerColors = "a8 00 00", "a8 a8 a8"
|
BannerColors = "a8 00 00", "a8 a8 a8"
|
||||||
IgnoreTitlePatches = 1
|
IgnoreTitlePatches = 1
|
||||||
|
SupportWAD = "id24res.wad"
|
||||||
}
|
}
|
||||||
|
|
||||||
IWad
|
IWad
|
||||||
|
@ -400,6 +404,7 @@ IWad
|
||||||
"DPHOOF","BFGGA0","HEADA1","CYBRA1","SPIDA1D1", "E4M2", "E1M10", "SEWERS"
|
"DPHOOF","BFGGA0","HEADA1","CYBRA1","SPIDA1D1", "E4M2", "E1M10", "SEWERS"
|
||||||
BannerColors = "18 18 18", "a8 a8 a8"
|
BannerColors = "18 18 18", "a8 a8 a8"
|
||||||
IgnoreTitlePatches = 1
|
IgnoreTitlePatches = 1
|
||||||
|
SupportWAD = "id24res.wad"
|
||||||
}
|
}
|
||||||
|
|
||||||
IWad
|
IWad
|
||||||
|
@ -416,6 +421,7 @@ IWad
|
||||||
"DPHOOF","BFGGA0","HEADA1","CYBRA1","SPIDA1D1", "E4M2"
|
"DPHOOF","BFGGA0","HEADA1","CYBRA1","SPIDA1D1", "E4M2"
|
||||||
BannerColors = "54 54 54", "a8 a8 a8"
|
BannerColors = "54 54 54", "a8 a8 a8"
|
||||||
IgnoreTitlePatches = 1
|
IgnoreTitlePatches = 1
|
||||||
|
SupportWAD = "id24res.wad"
|
||||||
}
|
}
|
||||||
|
|
||||||
IWad
|
IWad
|
||||||
|
@ -432,6 +438,7 @@ IWad
|
||||||
"DPHOOF","BFGGA0","HEADA1","CYBRA1","SPIDA1D1"
|
"DPHOOF","BFGGA0","HEADA1","CYBRA1","SPIDA1D1"
|
||||||
BannerColors = "54 54 54", "a8 a8 a8"
|
BannerColors = "54 54 54", "a8 a8 a8"
|
||||||
IgnoreTitlePatches = 1
|
IgnoreTitlePatches = 1
|
||||||
|
SupportWAD = "id24res.wad"
|
||||||
}
|
}
|
||||||
|
|
||||||
IWad
|
IWad
|
||||||
|
@ -445,6 +452,7 @@ IWad
|
||||||
MustContain = "E1M1"
|
MustContain = "E1M1"
|
||||||
BannerColors = "54 54 54", "a8 a8 a8"
|
BannerColors = "54 54 54", "a8 a8 a8"
|
||||||
IgnoreTitlePatches = 1
|
IgnoreTitlePatches = 1
|
||||||
|
SupportWAD = "id24res.wad"
|
||||||
}
|
}
|
||||||
|
|
||||||
IWad
|
IWad
|
||||||
|
@ -459,6 +467,7 @@ IWad
|
||||||
MustContain = "MAP01", "REDTNT2", "DMAPINFO"
|
MustContain = "MAP01", "REDTNT2", "DMAPINFO"
|
||||||
BannerColors = "00 7c 00", "a8 a8 a8"
|
BannerColors = "00 7c 00", "a8 a8 a8"
|
||||||
IgnoreTitlePatches = 1
|
IgnoreTitlePatches = 1
|
||||||
|
SupportWAD = "id24res.wad"
|
||||||
}
|
}
|
||||||
|
|
||||||
IWad
|
IWad
|
||||||
|
@ -474,6 +483,7 @@ IWad
|
||||||
BannerColors = "a8 00 00", "a8 a8 a8"
|
BannerColors = "a8 00 00", "a8 a8 a8"
|
||||||
Load = "extras.wad"
|
Load = "extras.wad"
|
||||||
IgnoreTitlePatches = 1
|
IgnoreTitlePatches = 1
|
||||||
|
SupportWAD = "id24res.wad"
|
||||||
}
|
}
|
||||||
|
|
||||||
IWad
|
IWad
|
||||||
|
@ -488,6 +498,7 @@ IWad
|
||||||
MustContain = "MAP01", "REDTNT2"
|
MustContain = "MAP01", "REDTNT2"
|
||||||
BannerColors = "a8 00 00", "a8 a8 a8"
|
BannerColors = "a8 00 00", "a8 a8 a8"
|
||||||
IgnoreTitlePatches = 1
|
IgnoreTitlePatches = 1
|
||||||
|
SupportWAD = "id24res.wad"
|
||||||
}
|
}
|
||||||
|
|
||||||
IWad
|
IWad
|
||||||
|
@ -502,6 +513,7 @@ IWad
|
||||||
MustContain = "MAP01", "CAMO1", "DMAPINFO"
|
MustContain = "MAP01", "CAMO1", "DMAPINFO"
|
||||||
BannerColors = "00 7c 00", "a8 a8 a8"
|
BannerColors = "00 7c 00", "a8 a8 a8"
|
||||||
IgnoreTitlePatches = 1
|
IgnoreTitlePatches = 1
|
||||||
|
SupportWAD = "id24res.wad"
|
||||||
}
|
}
|
||||||
|
|
||||||
IWad
|
IWad
|
||||||
|
@ -517,6 +529,7 @@ IWad
|
||||||
BannerColors = "a8 00 00", "a8 a8 a8"
|
BannerColors = "a8 00 00", "a8 a8 a8"
|
||||||
Load = "extras.wad"
|
Load = "extras.wad"
|
||||||
IgnoreTitlePatches = 1
|
IgnoreTitlePatches = 1
|
||||||
|
SupportWAD = "id24res.wad"
|
||||||
}
|
}
|
||||||
|
|
||||||
IWad
|
IWad
|
||||||
|
@ -531,6 +544,7 @@ IWad
|
||||||
MustContain = "MAP01", "CAMO1"
|
MustContain = "MAP01", "CAMO1"
|
||||||
BannerColors = "a8 00 00", "a8 a8 a8"
|
BannerColors = "a8 00 00", "a8 a8 a8"
|
||||||
IgnoreTitlePatches = 1
|
IgnoreTitlePatches = 1
|
||||||
|
SupportWAD = "id24res.wad"
|
||||||
}
|
}
|
||||||
|
|
||||||
IWad
|
IWad
|
||||||
|
@ -546,6 +560,7 @@ IWad
|
||||||
BannerColors = "a8 00 00", "a8 a8 a8"
|
BannerColors = "a8 00 00", "a8 a8 a8"
|
||||||
Load = "nerve.wad"
|
Load = "nerve.wad"
|
||||||
IgnoreTitlePatches = 1
|
IgnoreTitlePatches = 1
|
||||||
|
SupportWAD = "id24res.wad"
|
||||||
}
|
}
|
||||||
|
|
||||||
IWad
|
IWad
|
||||||
|
@ -561,6 +576,7 @@ IWad
|
||||||
BannerColors = "00 7c 00", "a8 a8 a8"
|
BannerColors = "00 7c 00", "a8 a8 a8"
|
||||||
IgnoreTitlePatches = 1
|
IgnoreTitlePatches = 1
|
||||||
Load = "extras.wad"
|
Load = "extras.wad"
|
||||||
|
SupportWAD = "id24res.wad"
|
||||||
}
|
}
|
||||||
|
|
||||||
IWad
|
IWad
|
||||||
|
@ -576,6 +592,7 @@ IWad
|
||||||
BannerColors = "00 7c 00", "a8 a8 a8"
|
BannerColors = "00 7c 00", "a8 a8 a8"
|
||||||
IgnoreTitlePatches = 1
|
IgnoreTitlePatches = 1
|
||||||
Load = "nerveunity.wad", "extras.wad", "soundtrack"
|
Load = "nerveunity.wad", "extras.wad", "soundtrack"
|
||||||
|
SupportWAD = "id24res.wad"
|
||||||
}
|
}
|
||||||
|
|
||||||
IWad
|
IWad
|
||||||
|
@ -592,6 +609,7 @@ IWad
|
||||||
IgnoreTitlePatches = 1
|
IgnoreTitlePatches = 1
|
||||||
Load = "nerve.wad"
|
Load = "nerve.wad"
|
||||||
DeleteLumps = "M_EPI1", "M_EPI2", "M_EPISOD"
|
DeleteLumps = "M_EPI1", "M_EPI2", "M_EPISOD"
|
||||||
|
SupportWAD = "id24res.wad"
|
||||||
}
|
}
|
||||||
|
|
||||||
IWad
|
IWad
|
||||||
|
@ -605,6 +623,7 @@ IWad
|
||||||
Compatibility = "Shorttex", "nosectionmerge"
|
Compatibility = "Shorttex", "nosectionmerge"
|
||||||
MustContain = "MAP01", "WIOBJ"
|
MustContain = "MAP01", "WIOBJ"
|
||||||
BannerColors = "ff ff ff", "a8 00 00"
|
BannerColors = "ff ff ff", "a8 00 00"
|
||||||
|
SupportWAD = "id24res.wad"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Doom 2 must be last to be checked because MAP01 is its only requirement
|
// Doom 2 must be last to be checked because MAP01 is its only requirement
|
||||||
|
@ -620,6 +639,7 @@ IWad
|
||||||
MustContain = "MAP01"
|
MustContain = "MAP01"
|
||||||
BannerColors = "a8 00 00", "a8 a8 a8"
|
BannerColors = "a8 00 00", "a8 a8 a8"
|
||||||
IgnoreTitlePatches = 1
|
IgnoreTitlePatches = 1
|
||||||
|
SupportWAD = "id24res.wad"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue