git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1195 993157c7-ee19-0410-b2c4-bb4e9862e678

This commit is contained in:
chrisf
2007-07-13 11:12:16 +00:00
parent 9ffe1d2845
commit d4a7e5fb9e
10 changed files with 102 additions and 100 deletions

View File

@@ -76,15 +76,15 @@ namespace OpenRa.Game
indices.Add((ushort)(offset + 2));
}
public static void CopyIntoChannel(Bitmap bitmap, TextureChannel channel, byte[] src, SheetRectangle<Sheet> s)
public static void CopyIntoChannel(SheetRectangle<Sheet> dest, byte[] src)
{
for( int i = 0; i < s.size.Width; i++ )
for (int j = 0; j < s.size.Height; j++)
for (int i = 0; i < dest.size.Width; i++)
for (int j = 0; j < dest.size.Height; j++)
{
Point p = new Point(s.origin.X + i, s.origin.Y + j);
byte b = src[i + s.size.Width * j];
Color original = bitmap.GetPixel(p.X, p.Y);
bitmap.SetPixel(p.X, p.Y, ReplaceChannel(original, channel, b));
Point p = new Point(dest.origin.X + i, dest.origin.Y + j);
byte b = src[i + dest.size.Width * j];
Color original = dest.sheet.bitmap.GetPixel(p.X, p.Y);
dest.sheet.bitmap.SetPixel(p.X, p.Y, ReplaceChannel(original, dest.channel, b));
}
}