public MDXRenderBatch(byte[] data) { using (MemoryStream ms = new MemoryStream(data)) { using (BinaryReader br = new BinaryReader(ms)) { this.Flags = (EMDXRenderBatchFlags)br.ReadByte(); this.RenderOrder = br.ReadSByte(); this.ShaderID = br.ReadUInt16(); this.SubmeshIndex = br.ReadUInt16(); this.GeosetIndex = br.ReadUInt16(); this.ColorIndex = br.ReadInt16(); this.RenderFlagsIndex = br.ReadUInt16(); this.Layer = br.ReadUInt16(); this.OPCount = br.ReadUInt16(); this.TextureLookupTableIndex = br.ReadUInt16(); this.RenderBatchLookupTableIndex = br.ReadUInt16(); this.TransparencyLookupTableIndex = br.ReadUInt16(); this.UVAnimationLookupTableIndex = br.ReadUInt16(); } } }
/// <summary> /// Deserializes a new <see cref="MDXRenderBatch"/> object from given binary data. /// </summary> /// <param name="data">The binary data containing the batch.</param> public MDXRenderBatch(byte[] data) { using (MemoryStream ms = new MemoryStream(data)) { using (BinaryReader br = new BinaryReader(ms)) { this.Flags = (EMDXRenderBatchFlags)br.ReadByte(); this.PriorityPlane = br.ReadSByte(); this.ShaderID = br.ReadUInt16(); this.SkinSectionIndex = br.ReadUInt16(); this.GeosetIndex = br.ReadUInt16(); this.ColorIndex = br.ReadInt16(); this.MaterialIndex = br.ReadUInt16(); this.MaterialLayer = br.ReadUInt16(); this.TextureCount = br.ReadUInt16(); this.TextureLookupTableIndex = br.ReadUInt16(); this.TextureMappingLookupTableIndex = br.ReadUInt16(); this.TransparencyLookupTableIndex = br.ReadUInt16(); this.TextureTransformLookupTableIndex = br.ReadUInt16(); } } }