Exemplo n.º 1
0
        private static Texture2D GetTexture(uint textureID, Surface surface = null, Dictionary <int, uint> customPaletteColors = null, bool useCache = true)
        {
            //Console.WriteLine($"-> GetTexture({textureID:X8})");

            if (useCache && Textures.TryGetValue(textureID, out var cached))
            {
                return(cached);
            }

            var texture = LoadTexture(textureID, false, surface, customPaletteColors);

            if (useCache)
            {
                Textures.Add(textureID, texture);
            }
            else
            {
                Uncached.Add(texture);
            }

            return(texture);
        }
Exemplo n.º 2
0
        private static Texture2D GetTexture(uint textureID, Surface surface = null, PaletteChanges paletteChanges = null, bool useCache = true)
        {
            //Console.WriteLine($"-> GetTexture({textureID:X8})");

            var texturePalette = new TexturePalette(textureID, paletteChanges);

            if (useCache && Textures.TryGetValue(texturePalette, out var cached))
            {
                return(cached);
            }

            var texture = LoadTexture(textureID, false, surface, paletteChanges);

            if (useCache)
            {
                Textures.Add(texturePalette, texture);
            }
            else
            {
                Uncached.Add(texture);
            }

            return(texture);
        }