| 95 | } |
| 96 | #else |
| 97 | std::optional<MpqArchive> LoadMPQ(const std::vector<std::string> &paths, string_view mpqName) |
| 98 | { |
| 99 | std::optional<MpqArchive> archive; |
| 100 | std::string mpqAbsPath; |
| 101 | std::int32_t error = 0; |
| 102 | for (const auto &path : paths) { |
| 103 | mpqAbsPath = path + mpqName.data(); |
| 104 | if ((archive = MpqArchive::Open(mpqAbsPath.c_str(), error))) { |
| 105 | LogVerbose(" Found: {} in {}", mpqName, path); |
| 106 | return archive; |
| 107 | } |
| 108 | if (error != 0) { |
| 109 | LogError("Error {}: {}", MpqArchive::ErrorMessage(error), mpqAbsPath); |
| 110 | } |
| 111 | } |
| 112 | if (error == 0) { |
| 113 | LogVerbose("Missing: {}", mpqName); |
| 114 | } |
| 115 | |
| 116 | return std::nullopt; |
| 117 | } |
| 118 | #endif |
| 119 | |
| 120 | std::vector<std::string> GetMPQSearchPaths() |
no test coverage detected