make DOLFileIndex support both compressed and uncompressed files simultaneously

This commit is contained in:
Martin Michelsen
2023-08-26 21:00:01 -07:00
parent 1d0c0088d6
commit d93866146a
5 changed files with 23 additions and 50 deletions
+2 -2
View File
@@ -74,15 +74,15 @@ struct DOLFileIndex {
uint32_t menu_item_id;
std::string name;
std::string data;
bool is_compressed;
};
bool files_compressed;
std::vector<std::shared_ptr<DOLFile>> item_id_to_file;
std::unordered_map<std::string, std::shared_ptr<DOLFile>> name_to_file;
std::shared_ptr<const Menu> menu;
DOLFileIndex() = default;
DOLFileIndex(const std::string& directory, bool compress);
explicit DOLFileIndex(const std::string& directory);
inline bool empty() const {
return this->name_to_file.empty() && this->item_id_to_file.empty();