diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2022-03-15 05:57:15 +0000 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2022-03-15 05:57:15 +0000 |
commit | 50e69bde548c5a1af3385f0eff6aa14c088c21c5 (patch) | |
tree | 24a050f6d31b43b7196f0ea8b6283e2d76bc561a /NorthstarDedicatedTest/filesystem.cpp | |
parent | 96aa95aede1fb1f3fde3d2c08728c37520bea4c2 (diff) | |
download | NorthstarLauncher-50e69bde548c5a1af3385f0eff6aa14c088c21c5.tar.gz NorthstarLauncher-50e69bde548c5a1af3385f0eff6aa14c088c21c5.zip |
add mod binks, mod rpak loading, and support for non-preload vpks/rpaks
Diffstat (limited to 'NorthstarDedicatedTest/filesystem.cpp')
-rw-r--r-- | NorthstarDedicatedTest/filesystem.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/NorthstarDedicatedTest/filesystem.cpp b/NorthstarDedicatedTest/filesystem.cpp index 0fa14132..702141bb 100644 --- a/NorthstarDedicatedTest/filesystem.cpp +++ b/NorthstarDedicatedTest/filesystem.cpp @@ -174,11 +174,22 @@ VPKData* MountVPKHook(IFileSystem* fileSystem, const char* vpkPath) if (!mod.Enabled) continue; - for (std::string& vpkPath : mod.Vpks) + for (ModVPKEntry& vpkEntry : mod.Vpks) { - // note: could potentially not mount these if they're already mounted? - spdlog::info("MountVPK {}", vpkPath); - spdlog::info((void*)mountVPK(fileSystem, vpkPath.c_str())); + // if we're autoloading, just load no matter what + if (!vpkEntry.m_bAutoLoad) + { + // resolve vpk name and try to load one with the same name + // todo: we should be unloading these on map unload manually + std::string mapName(fs::path(vpkPath).filename().string()); + std::string modMapName(fs::path(vpkEntry.m_sVpkPath.c_str()).filename().string()); + if (mapName.compare(modMapName)) + continue; + } + + VPKData* loaded = mountVPK(fileSystem, vpkEntry.m_sVpkPath.c_str()); + if (!ret) // this is primarily for map vpks and stuff, so the map's vpk is what gets returned from here + ret = loaded; } } |