MCPcopy Create free account
hub / github.com/ZDoom/Raze / GetGameFronUserFiles

Function GetGameFronUserFiles

source/core/initfs.cpp:214–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

212//==========================================================================
213
214std::vector<std::string> GetGameFronUserFiles()
215{
216 std::vector<std::string> Files;
217
218 if (userConfig.AddFilesPre) for (auto& file : *userConfig.AddFilesPre)
219 {
220 D_AddFile(Files, file.GetChars(), true, -1, GameConfig);
221 }
222 if (userConfig.AddFiles)
223 {
224 for (auto& file : *userConfig.AddFiles)
225 {
226 D_AddFile(Files, file.GetChars(), true, -1, GameConfig);
227 }
228
229 // Finally, if the last entry in the chain is a directory, it's being considered the mod directory, and all GRPs inside need to be loaded, too.
230 if (userConfig.AddFiles->NumArgs() > 0)
231 {
232 auto fn = (*userConfig.AddFiles)[userConfig.AddFiles->NumArgs() - 1];
233 bool isdir = false;
234 if (DirEntryExists(fn.GetChars(), &isdir) && isdir)
235 {
236 // Insert the GRPs before this entry itself.
237 std::string lastfn = std::move(Files.back());
238 Files.pop_back();
239 for (auto ext : validexts)
240 {
241 D_AddDirectory(Files, fn.GetChars(), ext, GameConfig);
242 }
243 Files.push_back(std::move(lastfn));
244 }
245 }
246 }
247 return CheckGameInfo(Files);
248}
249
250//==========================================================================
251//

Callers 1

SetupGameFunction · 0.85

Calls 9

D_AddFileFunction · 0.85
DirEntryExistsFunction · 0.85
moveFunction · 0.85
D_AddDirectoryFunction · 0.85
CheckGameInfoFunction · 0.85
NumArgsMethod · 0.80
GetCharsMethod · 0.45
pop_backMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected