예제 #1
0
 private static void WriteMdbPacket(this BinaryWriter writer, MdbPacket_RIGD 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);
     }
 }
예제 #2
0
        private static MdbPacket_RIGD ReadMdbPacket_RIGD(this BinaryReader reader, UInt32 size)
        {
            var ret = new MdbPacket_RIGD();

            ret.Name     = reader.ReadName32();
            ret.Mat      = reader.ReadMaterial();
            ret.NumVerts = reader.ReadUInt32();
            ret.NumFaces = reader.ReadUInt32();
            ret.Verts    = new RVert[ret.NumVerts];
            ret.Faces    = new Tri[ret.NumFaces];
            for (int i = 0; i < ret.NumVerts; ++i)
            {
                ret.Verts[i] = reader.ReadRVert();
            }
            for (int i = 0; i < ret.NumFaces; ++i)
            {
                ret.Faces[i] = reader.ReadTri();
            }

            return(ret);
        }