private static void WriteMdbPacket(this BinaryWriter writer, MdbPacket_COLN packet) { writer.Write(packet.Name); writer.Write(packet.Mat); writer.Write(packet.NumVerts); writer.Write(packet.NumFaces); foreach (var i in packet.Verts) { writer.Write(i); } foreach (var i in packet.Faces) { writer.Write(i); } }
private static MdbPacket_COLN ReadMdbPacket_COLN(this BinaryReader reader, UInt32 size) { var ret = new MdbPacket_COLN(); ret.Name = reader.ReadName32(); ret.Mat = reader.ReadMaterial(); ret.NumVerts = reader.ReadUInt32(); ret.NumFaces = reader.ReadUInt32(); ret.Verts = new CVert[ret.NumVerts]; ret.Faces = new Tri[ret.NumFaces]; for (int i = 0; i < ret.NumVerts; ++i) { ret.Verts[i] = reader.ReadCVert(); } for (int i = 0; i < ret.NumFaces; ++i) { ret.Faces[i] = reader.ReadTri(); } return(ret); }