Пример #1
0
 private static void WriteMdbPacket(this BinaryWriter writer, MdbPacket_WALK packet)
 {
     writer.Write(packet.Name);
     writer.Write(packet.uiFlags);
     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);
     }
 }
Пример #2
0
        private static MdbPacket_WALK ReadMdbPacket_WALK(this BinaryReader reader, UInt32 size)
        {
            var ret = new MdbPacket_WALK();

            ret.Name     = reader.ReadName32();
            ret.uiFlags  = reader.ReadUInt32();
            ret.NumVerts = reader.ReadUInt32();
            ret.NumFaces = reader.ReadUInt16();
            ret.Verts    = new Point3[ret.NumVerts];
            ret.Faces    = new WTri[ret.NumFaces];
            for (int i = 0; i < ret.NumVerts; ++i)
            {
                ret.Verts[i] = reader.ReadPoint3();
            }
            for (int i = 0; i < ret.NumFaces; ++i)
            {
                ret.Faces[i] = reader.ReadWTri();
            }

            return(ret);
        }