From 886b840d6cb97459a337dfba259054112c74e70b Mon Sep 17 00:00:00 2001 From: Jarrod Doyle Date: Sat, 7 Sep 2024 13:42:16 +0100 Subject: [PATCH] Use Texture2D in TextureLoader cache --- project/code/TMV/TextureLoader.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/project/code/TMV/TextureLoader.cs b/project/code/TMV/TextureLoader.cs index 57cf727..42bd9da 100644 --- a/project/code/TMV/TextureLoader.cs +++ b/project/code/TMV/TextureLoader.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using System.IO; using System.Linq; using Godot; using KeepersCompound.LGS; @@ -9,7 +8,7 @@ namespace KeepersCompound.TMV; public partial class TextureLoader { private readonly string _fmName; - private readonly List _textureCache = new(); + private readonly List _textureCache = new(); private readonly Dictionary _idMap = new(); private readonly Dictionary _idPathMap = new(); private readonly Dictionary _pathMap = new(); @@ -73,7 +72,7 @@ public partial class TextureLoader } // TODO: We should report load failures - public ImageTexture Get(int id) + public Texture2D Get(int id) { if (_idMap.TryGetValue(id, out int value)) { @@ -89,7 +88,7 @@ public partial class TextureLoader } // TODO: Load by path :) - public ImageTexture Get(string path) + public Texture2D Get(string path) { if (!_pathMap.ContainsKey(path)) {