mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
dont reinsert into image cache. we want it to error there
This commit is contained in:
parent
d25a301cee
commit
37cad651f0
@ -542,13 +542,10 @@ namespace NewHorizons.Builder.Props
|
|||||||
|
|
||||||
if (cacheExists)
|
if (cacheExists)
|
||||||
{
|
{
|
||||||
// This code will execute in order to create the cache
|
|
||||||
// Loaders go sequentually - Load the inverted textures to the cache so that ImageUtilities will reuse them later
|
|
||||||
if (useInvertedCache)
|
if (useInvertedCache)
|
||||||
{
|
{
|
||||||
invertedImageLoader.Start(true);
|
invertedImageLoader.Start(true);
|
||||||
}
|
}
|
||||||
// Atlas texture next so that the normal iamgeLoader knows not to regenerate them unless they were missing
|
|
||||||
if (useAtlasCache)
|
if (useAtlasCache)
|
||||||
{
|
{
|
||||||
atlasImageLoader.Start(false);
|
atlasImageLoader.Start(false);
|
||||||
|
|||||||
@ -13,7 +13,7 @@ namespace NewHorizons.Utility.Files
|
|||||||
// key is path + applied effects
|
// key is path + applied effects
|
||||||
private static readonly Dictionary<string, Texture> _textureCache = new();
|
private static readonly Dictionary<string, Texture> _textureCache = new();
|
||||||
public static bool CheckCachedTexture(string key, out Texture existingTexture) => _textureCache.TryGetValue(key, out existingTexture);
|
public static bool CheckCachedTexture(string key, out Texture existingTexture) => _textureCache.TryGetValue(key, out existingTexture);
|
||||||
public static void TrackCachedTexture(string key, Texture texture) => _textureCache[key] = texture;
|
public static void TrackCachedTexture(string key, Texture texture) => _textureCache.Add(key, texture); // dont reinsert cuz that causes memory leak!
|
||||||
|
|
||||||
public static string GetKey(string path) =>
|
public static string GetKey(string path) =>
|
||||||
path.Substring(Main.Instance.ModHelper.OwmlConfig.ModsPath.Length + 1).Replace('\\', '/');
|
path.Substring(Main.Instance.ModHelper.OwmlConfig.ModsPath.Length + 1).Replace('\\', '/');
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user