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

@@ -98,7 +98,7 @@ namespace OpenRA.Traits
public static Renderable Centered(Actor self, Sprite s, float2 location)
{
var pal = self.Owner == null ? "player0" : self.Owner.Palette;
var pal = "player{0}".F(self.Owner == null ? 0 : self.Owner.Index);
var loc = location - 0.5f * s.size;
return new Renderable(s, loc.Round(), pal, (int)self.CenterLocation.Y);