moved Game.palette into WorldRenderer

This commit is contained in:
Bob
2010-01-21 12:31:44 +13:00
parent d07b782044
commit d7be2b0dd3
4 changed files with 19 additions and 17 deletions

View File

@@ -1,5 +1,7 @@
using System.Collections.Generic;
using System.Drawing;
using OpenRa.FileFormats;
using OpenRa.Traits;
namespace OpenRa.Graphics
{
@@ -38,5 +40,15 @@ namespace OpenRa.Graphics
return allocated++;
}
public void Update(IEnumerable<IPaletteModifier> paletteMods)
{
var b = new Bitmap(Bitmap);
foreach (var mod in paletteMods)
mod.AdjustPalette(b);
Texture.SetData(b);
Game.renderer.PaletteTexture = Texture;
}
}
}