MCPcopy Create free account
hub / github.com/ZDoom/gzdoom / AddAutoloadFiles

Function AddAutoloadFiles

src/d_main.cpp:2023–2090  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2021//==========================================================================
2022
2023static void AddAutoloadFiles(const char *autoname, std::vector<std::string>& allwads)
2024{
2025 LumpFilterIWAD.Format("%s.", autoname); // The '.' is appened to simplify parsing the string
2026
2027 // [SP] Dialog reaction - load lights.pk3 and brightmaps.pk3 based on user choices
2028 if (!(gameinfo.flags & GI_SHAREWARE) && !(Args->CheckParm("-noextras")))
2029 {
2030 if ((GameStartupInfo.LoadLights == 1 || (GameStartupInfo.LoadLights != 0 && autoloadlights)) && !(Args->CheckParm("-nolights")))
2031 {
2032 const char *lightswad = BaseFileSearch ("lights.pk3", NULL, true, GameConfig);
2033 if (lightswad)
2034 D_AddFile (allwads, lightswad, true, -1, GameConfig);
2035 }
2036 if ((GameStartupInfo.LoadBrightmaps == 1 || (GameStartupInfo.LoadBrightmaps != 0 && autoloadbrightmaps)) && !(Args->CheckParm("-nobrightmaps")))
2037 {
2038 const char *bmwad = BaseFileSearch ("brightmaps.pk3", NULL, true, GameConfig);
2039 if (bmwad)
2040 D_AddFile (allwads, bmwad, true, -1, GameConfig);
2041 }
2042 if ((GameStartupInfo.LoadWidescreen == 1 || (GameStartupInfo.LoadWidescreen != 0 && autoloadwidescreen)) && !(Args->CheckParm("-nowidescreen")))
2043 {
2044 const char *wswad = BaseFileSearch ("game_widescreen_gfx.pk3", NULL, true, GameConfig);
2045 if (wswad)
2046 D_AddFile (allwads, wswad, true, -1, GameConfig);
2047 }
2048 }
2049
2050 if (!(gameinfo.flags & GI_SHAREWARE) && !Args->CheckParm("-noautoload") && !disableautoload)
2051 {
2052 FString file;
2053
2054 // [RH] zvox.wad - A wad I had intended to be automatically generated
2055 // from Q2's pak0.pak so the female and cyborg player could have
2056 // voices. I never got around to writing the utility to do it, though.
2057 // And I probably never will now. But I know at least one person uses
2058 // it for something else, so this gets to stay here.
2059 const char *wad = BaseFileSearch ("zvox.wad", NULL, false, GameConfig);
2060 if (wad)
2061 D_AddFile (allwads, wad, true, -1, GameConfig);
2062
2063 // [RH] Add any .wad files in the skins directory
2064#ifdef __unix__
2065 file = SHARE_DIR;
2066#else
2067 file = progdir;
2068#endif
2069 file += "skins";
2070 D_AddDirectory (allwads, file.GetChars(), "*.wad", GameConfig);
2071
2072#ifdef __unix__
2073 file = NicePath("$HOME/" GAME_DIR "/skins");
2074 D_AddDirectory (allwads, file.GetChars(), "*.wad", GameConfig);
2075#endif
2076
2077 // Add common (global) wads
2078 D_AddConfigFiles(allwads, "Global.Autoload", "*.wad", GameConfig);
2079
2080 ptrdiff_t len;

Callers 1

D_InitGameFunction · 0.85

Calls 10

BaseFileSearchFunction · 0.85
D_AddFileFunction · 0.85
D_AddDirectoryFunction · 0.85
NicePathFunction · 0.85
D_AddConfigFilesFunction · 0.85
CheckParmMethod · 0.80
FormatMethod · 0.45
GetCharsMethod · 0.45
IndexOfMethod · 0.45
LeftMethod · 0.45

Tested by

no test coverage detected