| 365 | } |
| 366 | |
| 367 | void 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 | |
| 398 | sigc::signal<void>& Doom3FileSystem::signal_Initialised() |
| 399 | { |
nothing calls this directly
no test coverage detected