non-working palette fail
This commit is contained in:
@@ -77,11 +77,20 @@ namespace OpenRA.Graphics
|
||||
|
||||
public void Update(IEnumerable<IPaletteModifier> paletteMods)
|
||||
{
|
||||
var b = new Bitmap(Bitmap);
|
||||
foreach (var mod in paletteMods)
|
||||
mod.AdjustPalette(b);
|
||||
|
||||
Texture.SetData(b);
|
||||
//var b = new Bitmap(Bitmap);
|
||||
//foreach (var mod in paletteMods)
|
||||
// mod.AdjustPalette(b);
|
||||
|
||||
var data = new uint[256,MaxPalettes];
|
||||
foreach (var pal in palettes)
|
||||
{
|
||||
var j = indices[pal.Key];
|
||||
var c = pal.Value.Values;
|
||||
for (var i = 0; i < 256; i++)
|
||||
data[i,j] = c[i];
|
||||
}
|
||||
|
||||
Texture.SetData(data);
|
||||
Game.Renderer.PaletteTexture = Texture;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace OpenRA.Widgets
|
||||
string cachedVideo;
|
||||
float invLength;
|
||||
float2 videoOrigin, videoSize;
|
||||
int[,] overlay;
|
||||
uint[,] overlay;
|
||||
bool stopped;
|
||||
bool paused;
|
||||
|
||||
@@ -56,8 +56,8 @@ namespace OpenRA.Widgets
|
||||
if (!DrawOverlay)
|
||||
return;
|
||||
|
||||
overlay = new int[2*textureSize, 2*textureSize];
|
||||
var black = Color.Black.ToArgb();
|
||||
overlay = new uint[2*textureSize, 2*textureSize];
|
||||
uint black = (uint)255 << 24;
|
||||
for (var y = 0; y < video.Height; y++)
|
||||
for (var x = 0; x < video.Width; x++)
|
||||
overlay[2*y,x] = black;
|
||||
|
||||
Reference in New Issue
Block a user