untangling WorldRenderer from World

This commit is contained in:
Bob
2010-10-12 01:11:56 +13:00
parent 1c1483377c
commit 597dba8584
17 changed files with 162 additions and 124 deletions

View File

@@ -63,7 +63,6 @@ namespace OpenRA
PlayerRef = pr;
RegisterPlayerColor(world, Palette);
PlayerActor = world.CreateActor("Player", new TypeDictionary{ new OwnerInit( this ) });
}
@@ -85,18 +84,9 @@ namespace OpenRA
ClientIndex = client.Index;
PlayerRef = pr;
RegisterPlayerColor(world, Palette);
PlayerActor = world.CreateActor("Player", new TypeDictionary{ new OwnerInit( this ) });
}
public void RegisterPlayerColor(World world, string palette)
{
var info = Rules.Info["world"].Traits.Get<PlayerColorPaletteInfo>();
var newpal = new Palette(world.WorldRenderer.GetPalette(info.BasePalette),
new PlayerColorRemap(Color, Color2, info.PaletteFormat));
world.WorldRenderer.AddPalette(palette, newpal);
}
public void GiveAdvice(string advice)
{
Sound.PlayToPlayer(this, advice);