more or less fail

This commit is contained in:
Paul Chote
2010-08-14 21:36:13 +12:00
parent dda6556e17
commit 0f6564f31a
4 changed files with 6 additions and 7 deletions

View File

@@ -245,7 +245,7 @@ namespace OpenRA.FileFormats
byte r = (byte)(reader.ReadByte() << 2);
byte g = (byte)(reader.ReadByte() << 2);
byte b = (byte)(reader.ReadByte() << 2);
palette[i] = (uint)(255 << 24 | (r << 16) | (g << 8) | b);
palette[i] = (uint)((255 << 24) | (r << 16) | (g << 8) | b);
}
break;

View File

@@ -39,8 +39,7 @@ namespace OpenRA.FileFormats
byte r = (byte)(reader.ReadByte() << 2);
byte g = (byte)(reader.ReadByte() << 2);
byte b = (byte)(reader.ReadByte() << 2);
colors[i] = (uint)Color.FromArgb(r,g,b).ToArgb();//(uint)(((byte)255 << 0) | (r << 16));// | (g << 8) | b);
colors[i] = (uint)((255 << 24) | (r << 16) | (g << 8) | b);
}
}

View File

@@ -81,13 +81,13 @@ namespace OpenRA.Graphics
//foreach (var mod in paletteMods)
// mod.AdjustPalette(b);
var data = new uint[256,MaxPalettes];
var data = new uint[MaxPalettes,256];
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];
data[j,i] = c[i];
}
Texture.SetData(data);

View File

@@ -39,7 +39,7 @@ namespace OpenRA.GlRenderer
unsafe
{
fixed (uint* ptr = colors)
fixed (uint* ptr = &colors[0,0])
{
IntPtr intPtr = new IntPtr((void *) ptr);