public Sheet(SheetT type, Stream stream) { using (var bitmap = BitmapFactory.DecodeStream(stream, null, new BitmapFactory.Options { InScaled = false, InDither = false, InJustDecodeBounds = false, InPurgeable = true, InInputShareable = true, })) { var width = bitmap.Width; var height = bitmap.Height; Size = new Size(width, height); data = new byte[4 * Size.Width * Size.Height]; //int[] pixels = new int[width * height]; //if((width != bitmap.Width ) || (height != bitmap.Height)) //{ //} //else //{ // bitmap.GetPixels(pixels, 0, width, 0, 0, width, height); //} //Util.FastCopyIntoChannel(new Sprite(this, bitmap.Bounds(), TextureChannel.Red), pixels.ToBytes()); Util.FastCopyIntoSprite(new Sprite(this, bitmap.Bounds(), TextureChannel.Red), bitmap); bitmap.Recycle(); } Type = type; ReleaseBuffer(); }
public SheetBuilder(SheetT t, Func <Sheet> allocateSheet) { channel = TextureChannel.Red; Type = t; current = allocateSheet(); sheets.Add(current); this.allocateSheet = allocateSheet; }
public SheetBuilder(SheetT t, int sheetSize) : this(t, () => AllocateSheet(t, sheetSize)) { }
public SheetBuilder(SheetT t) : this(t, WarGame.Settings.Graphics.SheetSize) { }
public static Sheet AllocateSheet(SheetT type, int sheetSize) { return(new Sheet(type, new Size(sheetSize, sheetSize))); }
public Sheet(SheetT type, ITexture texture) { Type = type; this.texture = texture; Size = texture.Size; }
public Sheet(SheetT type, Size size) { Type = type; Size = size; }