diff --git a/radiant/test/data/vfs_root/materials/example.mtr b/radiant/test/data/vfs_root/materials/example.mtr new file mode 100644 index 0000000000..12c49eb81f --- /dev/null +++ b/radiant/test/data/vfs_root/materials/example.mtr @@ -0,0 +1,5 @@ +textures/orbweaver/drain_grille +{ + diffusemap textures/darkmod/metal/flat/heavy_rust_pocked01 + bumpmap textures/orbweaver/draingrille_n.tga +} diff --git a/radiant/test/vfsTest.cpp b/radiant/test/vfsTest.cpp index eb19507205..77a776c3b1 100644 --- a/radiant/test/vfsTest.cpp +++ b/radiant/test/vfsTest.cpp @@ -20,6 +20,8 @@ BOOST_AUTO_TEST_CASE(constructFileSystemModule) BOOST_AUTO_TEST_CASE(readFilesFromVFS) { + GlobalOutputStream().setStream(std::cout); + vfs::VirtualFileSystem::ExtensionSet exts; exts.insert("pk4"); @@ -31,5 +33,6 @@ BOOST_AUTO_TEST_CASE(readFilesFromVFS) // Check presence of some files BOOST_TEST(fs.getFileCount("nothere") == 0); + BOOST_TEST(fs.getFileCount("materials/example.mtr") == 1); } diff --git a/radiant/vfs/DirectoryArchive.cpp b/radiant/vfs/DirectoryArchive.cpp index 70a2db531a..187089d711 100644 --- a/radiant/vfs/DirectoryArchive.cpp +++ b/radiant/vfs/DirectoryArchive.cpp @@ -47,9 +47,9 @@ ArchiveTextFilePtr DirectoryArchive::openTextFile(const std::string& name) bool DirectoryArchive::containsFile(const std::string& name) { - UnixPath path(_root); - path.push_filename(name); - return os::fileIsReadable(path); + UnixPath path(_root); + std::string filePath = std::string(path) + name; + return os::fileIsReadable(filePath); } void DirectoryArchive::traverse(Visitor& visitor, const std::string& root) diff --git a/radiant/vfs/Doom3FileSystem.cpp b/radiant/vfs/Doom3FileSystem.cpp index 014a45dfa8..0edd19a7ce 100644 --- a/radiant/vfs/Doom3FileSystem.cpp +++ b/radiant/vfs/Doom3FileSystem.cpp @@ -351,7 +351,7 @@ void Doom3FileSystem::removeObserver(Observer& observer) int Doom3FileSystem::getFileCount(const std::string& filename) { int count = 0; - std::string fixedFilename(os::standardPathWithSlash(filename)); + std::string fixedFilename(os::standardPath(filename)); for (const ArchiveDescriptor& descriptor : _archives) {