Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lib/gfx/texture_replacement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ std::string format_replacement_filename(const RuntimeTextureKey& key) {
return fmt::format("tex1_{}x{}_{:016x}_{}.dds", key.width, key.height, key.textureHash, key.format);
}

std::optional<RuntimeTextureKey> parse_replacement_filename(std::string_view filename) noexcept {
std::optional<std::pair<RuntimeTextureKey, bool>> parse_replacement_filename(std::string_view filename) noexcept {
const size_t dot = filename.rfind('.');
if (dot == std::string_view::npos) {
return std::nullopt;
Expand Down Expand Up @@ -370,14 +370,15 @@ std::optional<RuntimeTextureKey> parse_replacement_filename(std::string_view fil
}
}

return RuntimeTextureKey{
RuntimeTextureKey key{
.textureHash = textureHash,
.tlutHash = tlutHash,
.width = dimensions->first,
.height = dimensions->second,
.hasTlut = hasTlut,
.format = *format,
};
return {{key, hasMips}};
}

static std::optional<ConvertedTexture> load_texture_file(const std::filesystem::path& path) {
Expand Down Expand Up @@ -540,7 +541,7 @@ void build_index() noexcept {
continue;
}

s_replacementIndex.try_emplace(*parsed, path);
s_replacementIndex.try_emplace(parsed->first, path, parsed->second);
}

Log.info("Indexed {} texture replacements", s_replacementIndex.size());
Expand Down
Loading