Example #1
0
        private void ReadFaces()
        {
            BSP.BaseStream.Seek(header.Directory[13].Offset, SeekOrigin.Begin);
            // A face is 104 bytes of data, so the count is lenght of the lump / 104.
            int faceCount = header.Directory[13].Length / 104;

            faceLump = new FaceLump(faceCount);
            for (int i = 0; i < faceCount; i++)
            {
                // This is pretty f*****g intense.
                faceLump.faces[i] = new Face(BSP.ReadInt32(), BSP.ReadInt32(), BSP.ReadInt32(), BSP.ReadInt32(),
                                             BSP.ReadInt32(), BSP.ReadInt32(), BSP.ReadInt32(), BSP.ReadInt32(), new[]
                {
                    BSP.ReadInt32(),
                    BSP.ReadInt32()
                }, new[]
                {
                    BSP.ReadInt32(),
                    BSP.ReadInt32()
                }, new Vector3(BSP.ReadSingle(), BSP.ReadSingle(), BSP.ReadSingle()), new[]
                {
                    new Vector3(BSP.ReadSingle(), BSP.ReadSingle(), BSP.ReadSingle()),
                    new Vector3(BSP.ReadSingle(), BSP.ReadSingle(), BSP.ReadSingle())
                }, new Vector3(BSP.ReadSingle(), BSP.ReadSingle(), BSP.ReadSingle()), new[]
                {
                    BSP.ReadInt32(),
                    BSP.ReadInt32()
                });
            }
        }
Example #2
0
 private void ReadFaces()
 {
     BSP.BaseStream.Seek(header.Directory [13].Offset, SeekOrigin.Begin);
     // A face is 104 bytes of data, so the count is lenght of the lump / 104.
     int faceCount = header.Directory [13].Length / 104;
     faceLump = new FaceLump(faceCount);
     for (int i = 0; i < faceCount; i++)
     {
         // This is pretty f*****g intense.
         faceLump.Faces [i] = new Face(BSP.ReadInt32(), BSP.ReadInt32(), BSP.ReadInt32(), BSP.ReadInt32(), BSP.ReadInt32(), BSP.ReadInt32(), BSP.ReadInt32(), BSP.ReadInt32(), new int[]
         {
             BSP.ReadInt32(),
             BSP.ReadInt32()
         }, new int[]
         {
             BSP.ReadInt32(),
             BSP.ReadInt32()
         }, new Vector3(BSP.ReadSingle(), BSP.ReadSingle(), BSP.ReadSingle()), new Vector3[]
         {
             new Vector3(BSP.ReadSingle(), BSP.ReadSingle(), BSP.ReadSingle()),
             new Vector3(BSP.ReadSingle(), BSP.ReadSingle(), BSP.ReadSingle())
         }, new Vector3(BSP.ReadSingle(), BSP.ReadSingle(), BSP.ReadSingle()), new int[]
         {
             BSP.ReadInt32(),
             BSP.ReadInt32()
         });
     }
 }