diff --git a/OpenRA.FileFormats/Graphics/VqaReader.cs b/OpenRA.FileFormats/Graphics/VqaReader.cs index 330c322088..285905a63b 100644 --- a/OpenRA.FileFormats/Graphics/VqaReader.cs +++ b/OpenRA.FileFormats/Graphics/VqaReader.cs @@ -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; diff --git a/OpenRA.FileFormats/Palette.cs b/OpenRA.FileFormats/Palette.cs index e312545db2..76d5155e9b 100644 --- a/OpenRA.FileFormats/Palette.cs +++ b/OpenRA.FileFormats/Palette.cs @@ -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); } } diff --git a/OpenRA.Game/Graphics/HardwarePalette.cs b/OpenRA.Game/Graphics/HardwarePalette.cs index 969894149f..0051b7e3ef 100644 --- a/OpenRA.Game/Graphics/HardwarePalette.cs +++ b/OpenRA.Game/Graphics/HardwarePalette.cs @@ -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); diff --git a/OpenRA.Gl/Texture.cs b/OpenRA.Gl/Texture.cs index fa1a187af7..b040d67dd8 100644 --- a/OpenRA.Gl/Texture.cs +++ b/OpenRA.Gl/Texture.cs @@ -39,7 +39,7 @@ namespace OpenRA.GlRenderer unsafe { - fixed (uint* ptr = colors) + fixed (uint* ptr = &colors[0,0]) { IntPtr intPtr = new IntPtr((void *) ptr); @@ -71,7 +71,7 @@ namespace OpenRA.GlRenderer new Rectangle(0, 0, bitmap.Width, bitmap.Height), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb); - + Gl.glTexParameteri(Gl.GL_TEXTURE_2D, Gl.GL_TEXTURE_BASE_LEVEL, 0); GraphicsDevice.CheckGlError(); Gl.glTexParameteri(Gl.GL_TEXTURE_2D, Gl.GL_TEXTURE_MAX_LEVEL, 0);