diff --git a/OpenRA.Game/Graphics/SpriteRenderer.cs b/OpenRA.Game/Graphics/SpriteRenderer.cs index 957eb6f701..b1bba04e3a 100644 --- a/OpenRA.Game/Graphics/SpriteRenderer.cs +++ b/OpenRA.Game/Graphics/SpriteRenderer.cs @@ -49,12 +49,12 @@ namespace OpenRA.Graphics public void DrawSprite(Sprite s, float2 location, WorldRenderer wr, string palette) { - DrawSprite(s, location, wr.GetPaletteIndex(palette), s.size); + DrawSprite(s, location, wr.Palette(palette).Index, s.size); } public void DrawSprite(Sprite s, float2 location, WorldRenderer wr, string palette, float2 size) { - DrawSprite(s, location, wr.GetPaletteIndex(palette), size); + DrawSprite(s, location, wr.Palette(palette).Index, size); } public void DrawSprite(Sprite s, float2 location, int paletteIndex, float2 size) diff --git a/OpenRA.Game/Graphics/WorldRenderer.cs b/OpenRA.Game/Graphics/WorldRenderer.cs index 5ad228d7ed..442b0001f6 100644 --- a/OpenRA.Game/Graphics/WorldRenderer.cs +++ b/OpenRA.Game/Graphics/WorldRenderer.cs @@ -56,7 +56,6 @@ namespace OpenRA.Graphics } public PaletteReference Palette(string name) { return palettes[name]; } - public int GetPaletteIndex(string name) { return palette.GetPaletteIndex(name); } public void AddPalette(string name, Palette pal, bool allowModifiers) { palette.AddPalette(name, pal, allowModifiers); } class SpriteComparer : IComparer diff --git a/OpenRA.Game/Traits/World/ResourceLayer.cs b/OpenRA.Game/Traits/World/ResourceLayer.cs index 5c1c35ffcf..a9ab4f2bea 100644 --- a/OpenRA.Game/Traits/World/ResourceLayer.cs +++ b/OpenRA.Game/Traits/World/ResourceLayer.cs @@ -33,7 +33,7 @@ namespace OpenRA.Traits { hasSetupPalettes = true; foreach (var rt in world.WorldActor.TraitsImplementing()) - rt.info.PaletteIndex = wr.GetPaletteIndex(rt.info.Palette); + rt.info.PaletteRef = wr.Palette(rt.info.Palette); } var clip = Game.viewport.WorldBounds(world); @@ -47,7 +47,7 @@ namespace OpenRA.Traits if (c.image != null) c.image[c.density].DrawAt( new CPos(x, y).ToPPos().ToFloat2(), - c.type.info.PaletteIndex); + c.type.info.PaletteRef.Index); } } diff --git a/OpenRA.Game/Traits/World/ResourceType.cs b/OpenRA.Game/Traits/World/ResourceType.cs index c181fdcbcf..62167b1eda 100644 --- a/OpenRA.Game/Traits/World/ResourceType.cs +++ b/OpenRA.Game/Traits/World/ResourceType.cs @@ -26,7 +26,7 @@ namespace OpenRA.Traits public readonly bool AllowUnderActors = false; public Sprite[][] Sprites; - public int PaletteIndex; + public PaletteReference PaletteRef; public PipType PipColor = PipType.Yellow;