Remove WorldRenderer.GetPaletteIndex.

This commit is contained in:
Paul Chote
2013-02-25 18:10:07 +13:00
parent 9bc743068a
commit e9665cf9f3
4 changed files with 5 additions and 6 deletions

View File

@@ -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)

View File

@@ -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<Renderable>

View File

@@ -33,7 +33,7 @@ namespace OpenRA.Traits
{
hasSetupPalettes = true;
foreach (var rt in world.WorldActor.TraitsImplementing<ResourceType>())
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);
}
}

View File

@@ -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;