@@ -45,8 +45,8 @@ bool ResourceManager::DidLoadSuccessfully() {
45
45
return mArchiveManager != nullptr && mArchiveManager ->IsArchiveLoaded ();
46
46
}
47
47
48
- std::shared_ptr<File> ResourceManager::LoadFileProcess (const std::string& filePath) {
49
- auto file = mArchiveManager ->LoadFile (filePath);
48
+ std::shared_ptr<File> ResourceManager::LoadFileProcess (const std::string& filePath, std::shared_ptr<ResourceInitData> initData ) {
49
+ auto file = mArchiveManager ->LoadFile (filePath, initData );
50
50
if (file != nullptr ) {
51
51
SPDLOG_TRACE (" Loaded File {} on ResourceManager" , file->InitData ->Path );
52
52
} else {
@@ -55,18 +55,18 @@ std::shared_ptr<File> ResourceManager::LoadFileProcess(const std::string& filePa
55
55
return file;
56
56
}
57
57
58
- std::shared_ptr<IResource> ResourceManager::LoadResourceProcess (const std::string& filePath, bool loadExact) {
58
+ std::shared_ptr<IResource> ResourceManager::LoadResourceProcess (const std::string& filePath, bool loadExact, std::shared_ptr<ResourceInitData> initData ) {
59
59
// Check for and remove the OTR signature
60
60
if (OtrSignatureCheck (filePath.c_str ())) {
61
61
const auto newFilePath = filePath.substr (7 );
62
- return LoadResourceProcess (newFilePath);
62
+ return LoadResourceProcess (newFilePath, false , initData );
63
63
}
64
64
65
65
// Attempt to load the alternate version of the asset, if we fail then we continue trying to load the standard
66
66
// asset.
67
67
if (!loadExact && CVarGetInteger (" gAltAssets" , 0 ) && !filePath.starts_with (IResource::gAltAssetPrefix )) {
68
68
const auto altPath = IResource::gAltAssetPrefix + filePath;
69
- auto altResource = LoadResourceProcess (altPath, loadExact);
69
+ auto altResource = LoadResourceProcess (altPath, loadExact, initData );
70
70
71
71
if (altResource != nullptr ) {
72
72
return altResource;
@@ -99,7 +99,7 @@ std::shared_ptr<IResource> ResourceManager::LoadResourceProcess(const std::strin
99
99
}
100
100
101
101
// Get the file from the OTR
102
- auto file = LoadFileProcess (filePath);
102
+ auto file = LoadFileProcess (filePath, initData );
103
103
if (file == nullptr ) {
104
104
SPDLOG_TRACE (" Failed to load resource file at path {}" , filePath);
105
105
}
@@ -136,20 +136,20 @@ std::shared_ptr<IResource> ResourceManager::LoadResourceProcess(const std::strin
136
136
return resource;
137
137
}
138
138
139
- std::shared_future<std::shared_ptr<File>> ResourceManager::LoadFileAsync (const std::string& filePath, bool priority) {
140
- if (priority) {
141
- return mThreadPool ->submit_front (&ResourceManager::LoadFileProcess, this , filePath).share ();
142
- } else {
143
- return mThreadPool ->submit_back (&ResourceManager::LoadFileProcess, this , filePath).share ();
144
- }
145
- }
139
+ // std::shared_future<std::shared_ptr<File>> ResourceManager::LoadFileAsync(const std::string& filePath, bool priority) {
140
+ // if (priority) {
141
+ // return mThreadPool->submit_front(&ResourceManager::LoadFileProcess, this, filePath).share();
142
+ // } else {
143
+ // return mThreadPool->submit_back(&ResourceManager::LoadFileProcess, this, filePath).share();
144
+ // }
145
+ // }
146
146
147
- std::shared_ptr<File> ResourceManager::LoadFile (const std::string& filePath) {
148
- return LoadFileAsync (filePath, true ).get ();
149
- }
147
+ // std::shared_ptr<File> ResourceManager::LoadFile(const std::string& filePath) {
148
+ // return LoadFileAsync(filePath, true).get();
149
+ // }
150
150
151
151
std::shared_future<std::shared_ptr<IResource>> ResourceManager::LoadResourceAsync (const std::string& filePath,
152
- bool loadExact, bool priority) {
152
+ bool loadExact, bool priority, std::shared_ptr<ResourceInitData> initData ) {
153
153
// Check for and remove the OTR signature
154
154
if (OtrSignatureCheck (filePath.c_str ())) {
155
155
auto newFilePath = filePath.substr (7 );
@@ -167,13 +167,13 @@ std::shared_future<std::shared_ptr<IResource>> ResourceManager::LoadResourceAsyn
167
167
const auto newFilePath = std::string (filePath);
168
168
169
169
if (priority) {
170
- return mThreadPool ->submit_front (&ResourceManager::LoadResourceProcess, this , newFilePath, loadExact);
170
+ return mThreadPool ->submit_front (&ResourceManager::LoadResourceProcess, this , newFilePath, loadExact, initData );
171
171
} else {
172
- return mThreadPool ->submit_back (&ResourceManager::LoadResourceProcess, this , newFilePath, loadExact);
172
+ return mThreadPool ->submit_back (&ResourceManager::LoadResourceProcess, this , newFilePath, loadExact, initData );
173
173
}
174
174
}
175
175
176
- std::shared_ptr<IResource> ResourceManager::LoadResource (const std::string& filePath, bool loadExact) {
176
+ std::shared_ptr<IResource> ResourceManager::LoadResource (const std::string& filePath, bool loadExact, std::shared_ptr<ResourceInitData> initData ) {
177
177
auto resource = LoadResourceAsync (filePath, loadExact, true ).get ();
178
178
if (resource == nullptr ) {
179
179
SPDLOG_ERROR (" Failed to load resource file at path {}" , filePath);
0 commit comments