@@ -40,40 +40,31 @@ bool ArchiveManager::IsArchiveLoaded() {
40
40
return !mArchives .empty ();
41
41
}
42
42
43
- std::shared_ptr<File> ArchiveManager::LoadFile (const std::string& filePath, std::shared_ptr<ResourceInitData> initData ) {
43
+ std::shared_ptr<File> ArchiveManager::LoadFile (const std::string& filePath) {
44
44
if (filePath == " " ) {
45
45
return nullptr ;
46
46
}
47
47
48
- const auto archive = mFileToArchive [CRC64 (filePath.c_str ())];
49
- if (archive == nullptr ) {
50
- return nullptr ;
51
- }
52
-
53
- return archive->LoadFile (filePath, initData);
48
+ return LoadFile (CRC64 (filePath.c_str ()), initData);
54
49
}
55
50
56
- std::shared_ptr<File> ArchiveManager::LoadFile (uint64_t hash, std::shared_ptr<ResourceInitData> initData ) {
51
+ std::shared_ptr<File> ArchiveManager::LoadFile (uint64_t hash) {
57
52
const auto archive = mFileToArchive [hash];
58
53
if (archive == nullptr ) {
59
54
return nullptr ;
60
55
}
61
56
62
- return archive->LoadFile (hash, initData);
57
+ auto file = archive->LoadFile (hash, initData);
58
+ file->Parent = archive;
59
+ return file;
63
60
}
64
61
65
- // TODO remove
66
62
std::shared_ptr<File> ArchiveManager::LoadFileRaw (const std::string& filePath) {
67
63
if (filePath == " " ) {
68
64
return nullptr ;
69
65
}
70
66
71
- const auto archive = mFileToArchive [CRC64 (filePath.c_str ())];
72
- if (archive == nullptr ) {
73
- return nullptr ;
74
- }
75
-
76
- return archive->LoadFileRaw (filePath);
67
+ return LoadFileRaw (CRC64 (filePath.c_str ()));
77
68
}
78
69
79
70
std::shared_ptr<File> ArchiveManager::LoadFileRaw (uint64_t hash) {
@@ -82,9 +73,10 @@ std::shared_ptr<File> ArchiveManager::LoadFileRaw(uint64_t hash) {
82
73
return nullptr ;
83
74
}
84
75
85
- return archive->LoadFileRaw (hash);
76
+ auto file = archive->LoadFileRaw (hash);
77
+ file->Parent = archive;
78
+ return file;
86
79
}
87
- // ENDTODO
88
80
89
81
bool ArchiveManager::HasFile (const std::string& filePath) {
90
82
return HasFile (CRC64 (filePath.c_str ()));
0 commit comments