fixes #2885 forgot to enable the cursor palette before drawing

split HardwarePalette.Update into two functions, closes #2847
This commit is contained in:
Matthias Mailänder
2013-04-04 18:41:36 +02:00
parent 6c6f5601d8
commit acc8cd1e5e
6 changed files with 35 additions and 30 deletions

View File

@@ -45,10 +45,9 @@ namespace OpenRA.Graphics
palettes = new Cache<string, PaletteReference>(CreatePaletteReference);
foreach (var pal in world.traitDict.ActorsWithTraitMultiple<IPalette>(world))
pal.Trait.InitPalette( this );
pal.Trait.InitPalette(this);
// Generate initial palette texture
palette.Update(new IPaletteModifier[] {});
palette.Initialize();
terrainRenderer = new TerrainRenderer(world, this);
shroudRenderer = new ShroudRenderer(world);
@@ -209,7 +208,8 @@ namespace OpenRA.Graphics
public void RefreshPalette()
{
palette.Update( world.WorldActor.TraitsImplementing<IPaletteModifier>() );
palette.ApplyModifiers(world.WorldActor.TraitsImplementing<IPaletteModifier>());
Game.Renderer.SetPalette(palette);
}
// Conversion between world and screen coordinates