public byte[] GetData(GXVertexBuffer Buffer) { MemoryStream o = new MemoryStream(); HSDWriter Writer = new HSDWriter(o); foreach (object ob in Collection) { if (ob is GXVector2) { WriteData(Writer, ((GXVector2)ob).X, Buffer.CompType, Buffer.Scale); WriteData(Writer, ((GXVector2)ob).Y, Buffer.CompType, Buffer.Scale); } if (ob is GXVector3) { WriteData(Writer, ((GXVector3)ob).X, Buffer.CompType, Buffer.Scale); WriteData(Writer, ((GXVector3)ob).Y, Buffer.CompType, Buffer.Scale); WriteData(Writer, ((GXVector3)ob).Z, Buffer.CompType, Buffer.Scale); } } Writer.Align(0x20); byte[] data = o.ToArray(); Writer.Close(); o.Close(); Writer.Dispose(); return(data); }
public byte[] ToBuffer(HSD_AttributeGroup Group) { MemoryStream o = new MemoryStream(); HSDWriter Writer = new HSDWriter(o); foreach (GXPrimitiveGroup g in Primitives) { g.Write(Writer, Group); } Writer.Write((byte)0); Writer.Align(0x20); Writer.Close(); byte[] bytes = o.ToArray(); o.Close(); return(bytes); }