Use Texture2D in TextureLoader cache

This commit is contained in:
Jarrod Doyle 2024-09-07 13:42:16 +01:00
parent 691220b5c8
commit 886b840d6c
Signed by: Jayrude
GPG Key ID: 38B57B16E7C0ADF7
1 changed files with 3 additions and 4 deletions

View File

@ -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<ImageTexture> _textureCache = new();
private readonly List<Texture2D> _textureCache = new();
private readonly Dictionary<int, int> _idMap = new();
private readonly Dictionary<int, string> _idPathMap = new();
private readonly Dictionary<string, int> _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))
{