MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / initPakFile

Method initPakFile

radiantcore/vfs/Doom3FileSystem.cpp:367–396  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

365}
366
367void Doom3FileSystem::initPakFile(const std::string& filename)
368{
369 std::string fileExt = string::to_lower_copy(os::getExtension(filename));
370
371 if (_allowedExtensions.find(fileExt) != _allowedExtensions.end())
372 {
373 // Matched extension for archive (e.g. "pk3", "pk4")
374 ArchiveDescriptor entry;
375
376 entry.name = filename;
377 entry.archive = std::make_shared<archive::ZipArchive>(filename);
378 entry.is_pakfile = true;
379 _archives.push_back(entry);
380
381 rMessage() << "[vfs] pak file: " << filename << std::endl;
382 }
383 else if (_allowedExtensionsDir.find(fileExt) != _allowedExtensionsDir.end())
384 {
385 // Matched extension for archive dir (e.g. "pk3dir", "pk4dir")
386 ArchiveDescriptor entry;
387
388 std::string path = os::standardPathWithSlash(filename);
389 entry.name = path;
390 entry.archive = std::make_shared<DirectoryArchive>(path);
391 entry.is_pakfile = false;
392 _archives.push_back(entry);
393
394 rMessage() << "[vfs] pak dir: " << path << std::endl;
395 }
396}
397
398sigc::signal<void>& Doom3FileSystem::signal_Initialised()
399{

Callers

nothing calls this directly

Calls 7

to_lower_copyFunction · 0.85
getExtensionFunction · 0.85
rMessageFunction · 0.85
standardPathWithSlashFunction · 0.50
findMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected