Support arbitrary per-player palettes. Will crash if I missed any cases that don't explicitly set the Renderable palette.

This commit is contained in:
Paul Chote
2011-05-03 22:21:31 +12:00
parent b937489f2d
commit 8f962853f9
12 changed files with 36 additions and 32 deletions

View File

@@ -207,7 +207,7 @@ namespace OpenRA.Mods.RA
var targetCell = unit.Location + xy - sourceLocation;
foreach (var r in unit.Render())
r.Sprite.DrawAt(r.Pos - Traits.Util.CenterOfCell(unit.Location) + Traits.Util.CenterOfCell(targetCell),
wr.GetPaletteIndex(r.Palette ?? unit.Owner.Palette),
wr.GetPaletteIndex(r.Palette),
r.Scale*r.Sprite.size);
}