| 160 | } |
| 161 | |
| 162 | u8string FindFile(DirBase base, DirId did, u8string_view fileName) const override |
| 163 | { |
| 164 | auto dataPath = GetDirectoryPath(base, did); |
| 165 | |
| 166 | std::string alternativeFilename; |
| 167 | if (_rct2Variant != RCT2Variant::rct2Original && base == DirBase::rct2 && did == DirId::data) |
| 168 | { |
| 169 | // Special case, handle RCT Classic css ogg files |
| 170 | if (String::startsWith(fileName, "css", true) && String::endsWith(fileName, ".dat", true)) |
| 171 | { |
| 172 | alternativeFilename = fileName.substr(0, fileName.size() - 3); |
| 173 | alternativeFilename.append("ogg"); |
| 174 | fileName = alternativeFilename; |
| 175 | } |
| 176 | } |
| 177 | |
| 178 | auto path = Path::ResolveCasing(Path::Combine(dataPath, fileName)); |
| 179 | if (base == DirBase::rct1 && did == DirId::data && !File::Exists(path)) |
| 180 | { |
| 181 | // Special case, handle RCT1 steam layout where some data files are under a CD root |
| 182 | auto basePath = GetDirectoryPath(base); |
| 183 | auto alternativePath = Path::ResolveCasing(Path::Combine(basePath, "RCTdeluxe_install", "Data", fileName)); |
| 184 | if (File::Exists(alternativePath)) |
| 185 | { |
| 186 | path = alternativePath; |
| 187 | } |
| 188 | } |
| 189 | |
| 190 | return path; |
| 191 | } |
| 192 | |
| 193 | void SetBasePath(DirBase base, u8string_view path) override |
| 194 | { |
no test coverage detected