aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/rpakfilesystem.h
diff options
context:
space:
mode:
authorJack <66967891+ASpoonPlaysGames@users.noreply.github.com>2022-06-23 17:34:33 +0100
committerGitHub <noreply@github.com>2022-06-23 17:34:33 +0100
commitbb7a4c00dea90e6d578d07618ae86a172aec58f2 (patch)
treeb60d0678106083fa47da3d514621a45d6363fec4 /NorthstarDedicatedTest/rpakfilesystem.h
parentd9328a186e686e15f11e947ef9fa76d113d79db5 (diff)
downloadNorthstarLauncher-bb7a4c00dea90e6d578d07618ae86a172aec58f2.tar.gz
NorthstarLauncher-bb7a4c00dea90e6d578d07618ae86a172aec58f2.zip
fixed custom rpaks being loaded more than once (#202)
* fixed custom rpaks being loaded more than once * formatting * better things, although LoadPakSyncHook is annoying * formatting * removing unnecessary comments and stuff (whoops) * Moving to use PakLoadManager * formatting
Diffstat (limited to 'NorthstarDedicatedTest/rpakfilesystem.h')
-rw-r--r--NorthstarDedicatedTest/rpakfilesystem.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/NorthstarDedicatedTest/rpakfilesystem.h b/NorthstarDedicatedTest/rpakfilesystem.h
index 3c104822..12ef983e 100644
--- a/NorthstarDedicatedTest/rpakfilesystem.h
+++ b/NorthstarDedicatedTest/rpakfilesystem.h
@@ -9,8 +9,16 @@ class PakLoadManager
void LoadPakAsync(const char* path, bool bMarkForUnload);
void UnloadPaks();
+ bool IsPakLoaded(int32_t pakHandle);
+ bool IsPakLoaded(size_t hash);
+ void AddLoadedPak(int32_t pakHandle, size_t hash);
+ void RemoveLoadedPak(int32_t pakHandle);
+
private:
std::vector<int> m_pakHandlesToUnload;
+ // these size_t s are the asset path hashed with STR_HASH
+ std::unordered_map<int32_t, size_t> loadedPaks {};
+ std::unordered_map<size_t, int32_t> loadedPaksInv {};
};
extern PakLoadManager* g_PakLoadManager; \ No newline at end of file