summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/HiresTextures.cpp
diff options
context:
space:
mode:
authoriwubcode <iwubcode@users.noreply.github.com>2023-08-11 00:36:41 -0500
committeriwubcode <iwubcode@users.noreply.github.com>2023-08-11 00:36:41 -0500
commit246b7c5bdb7e87704ab13448f1579f3f95d92444 (patch)
tree2748fcd3b8a1e9fc5b14e93c090550815a73fa4b /Source/Core/VideoCommon/HiresTextures.cpp
parent5512d19d4b66af1f7738cf5df9744e01364ffb11 (diff)
VideoCommon: fix regression with texture load order where the custom texture code was always updating the asset map for each texture with each entry, making it so the last value actually would be loaded instead of the first
Diffstat (limited to 'Source/Core/VideoCommon/HiresTextures.cpp')
-rw-r--r--Source/Core/VideoCommon/HiresTextures.cpp27
1 files changed, 15 insertions, 12 deletions
diff --git a/Source/Core/VideoCommon/HiresTextures.cpp b/Source/Core/VideoCommon/HiresTextures.cpp
index c70e5523f8..f9f3134e35 100644
--- a/Source/Core/VideoCommon/HiresTextures.cpp
+++ b/Source/Core/VideoCommon/HiresTextures.cpp
@@ -120,24 +120,27 @@ void HiresTexture::Update()
if (has_arbitrary_mipmaps)
filename.erase(arb_index, 4);
- // Since this is just a texture (single file) the mapper doesn't really matter
- // just provide a string
- s_file_library->SetAssetIDMapData(filename,
- std::map<std::string, std::filesystem::path>{{"", path}});
-
- if (g_ActiveConfig.bCacheHiresTextures)
- {
- auto hires_texture = std::make_shared<HiresTexture>(
- has_arbitrary_mipmaps,
- system.GetCustomAssetLoader().LoadGameTexture(filename, s_file_library));
- s_hires_texture_cache.try_emplace(filename, std::move(hires_texture));
- }
const auto [it, inserted] =
s_hires_texture_id_to_arbmipmap.try_emplace(filename, has_arbitrary_mipmaps);
if (!inserted)
{
failed_insert = true;
}
+ else
+ {
+ // Since this is just a texture (single file) the mapper doesn't really matter
+ // just provide a string
+ s_file_library->SetAssetIDMapData(
+ filename, std::map<std::string, std::filesystem::path>{{"", path}});
+
+ if (g_ActiveConfig.bCacheHiresTextures)
+ {
+ auto hires_texture = std::make_shared<HiresTexture>(
+ has_arbitrary_mipmaps,
+ system.GetCustomAssetLoader().LoadGameTexture(filename, s_file_library));
+ s_hires_texture_cache.try_emplace(filename, std::move(hires_texture));
+ }
+ }
}
}