Remove our own impl of ReadOnlyList and update usages

This commit is contained in:
teinarss
2021-03-16 20:08:18 +01:00
committed by reaperrr
parent e12ff2c59d
commit 8b0a3ea680
17 changed files with 20 additions and 114 deletions

View File

@@ -21,14 +21,12 @@ namespace OpenRA.Graphics
public int Height { get; private set; }
readonly Dictionary<string, ImmutablePalette> palettes = new Dictionary<string, ImmutablePalette>();
readonly Dictionary<string, MutablePalette> modifiablePalettes = new Dictionary<string, MutablePalette>();
readonly IReadOnlyDictionary<string, MutablePalette> readOnlyModifiablePalettes;
readonly Dictionary<string, int> indices = new Dictionary<string, int>();
byte[] buffer = new byte[0];
public HardwarePalette()
{
Texture = Game.Renderer.Context.CreateTexture();
readOnlyModifiablePalettes = modifiablePalettes;
}
public bool Contains(string name)
@@ -109,7 +107,7 @@ namespace OpenRA.Graphics
public void ApplyModifiers(IEnumerable<IPaletteModifier> paletteMods)
{
foreach (var mod in paletteMods)
mod.AdjustPalette(readOnlyModifiablePalettes);
mod.AdjustPalette(modifiablePalettes);
// Update our texture with the changes.
CopyModifiablePalettesToBuffer();