Removing remaining SheetType.DualIndexed plumbing.

This commit is contained in:
Paul Chote
2016-04-10 20:05:05 -04:00
parent 3a37551812
commit 5d0990f1c6
2 changed files with 3 additions and 5 deletions

View File

@@ -25,8 +25,7 @@ namespace OpenRA.Graphics
public enum SheetType public enum SheetType
{ {
Indexed = 1, Indexed = 1,
DualIndexed = 2, BGRA = 2,
BGRA = 4,
} }
public sealed class SheetBuilder : IDisposable public sealed class SheetBuilder : IDisposable

View File

@@ -55,13 +55,12 @@ namespace OpenRA.Graphics
vertices[nv + 5] = new Vertex(a, r.Left, r.Top, sl, st, paletteTextureIndex, attribC); vertices[nv + 5] = new Vertex(a, r.Left, r.Top, sl, st, paletteTextureIndex, attribC);
} }
public static void FastCopyIntoChannel(Sprite dest, byte[] src) { FastCopyIntoChannel(dest, 0, src); } public static void FastCopyIntoChannel(Sprite dest, byte[] src)
public static void FastCopyIntoChannel(Sprite dest, int channelOffset, byte[] src)
{ {
var data = dest.Sheet.GetData(); var data = dest.Sheet.GetData();
var srcStride = dest.Bounds.Width; var srcStride = dest.Bounds.Width;
var destStride = dest.Sheet.Size.Width * 4; var destStride = dest.Sheet.Size.Width * 4;
var destOffset = destStride * dest.Bounds.Top + dest.Bounds.Left * 4 + ChannelMasks[(int)dest.Channel + channelOffset]; var destOffset = destStride * dest.Bounds.Top + dest.Bounds.Left * 4 + ChannelMasks[(int)dest.Channel];
var destSkip = destStride - 4 * srcStride; var destSkip = destStride - 4 * srcStride;
var height = dest.Bounds.Height; var height = dest.Bounds.Height;