private void ReadFile() { bsp = new BSPParser(mapFile); string entities = bsp.GetEntities(); Debug.Log("Map Entities: " + entities); vertices = bsp.GetVertices(); //vertices = bsp.lumpData[3]; //planes = bsp.GetPlanes(); edges = bsp.GetEdges(); //origFaces = bsp.GetOriginalFaces(); faces = bsp.GetFaces(); surfedges = bsp.GetSurfedges(); //brushes = bsp.GetBrushes(); //brushSides = bsp.GetBrushSides(); dispInfo = bsp.GetDispInfo(); dispVerts = bsp.GetDispVerts(); texInfo = bsp.GetTextureInfo(); texData = bsp.GetTextureData(); texStringTable = bsp.GetTextureStringTable(); textureStringData = bsp.GetTextureStringData(); staticProps = bsp.GetStaticProps(); mapFile.Close(); }
private void ReadMap() { System.IO.FileStream mapFile = null; try { mapFile = new System.IO.FileStream(mapLocation + mapName + ".bsp", System.IO.FileMode.Open); } catch (Exception e) { Console.WriteLine(e.Message); } if (mapFile != null) { #region Read map BSPParser bsp = new BSPParser(mapFile); string entities = bsp.GetEntities(); //Console.WriteLine("Map Entities: " + entities); vertices = bsp.GetVertices(); edges = bsp.GetEdges(); faces = bsp.GetFaces(); surfedges = bsp.GetSurfedges(); texInfo = bsp.GetTextureInfo(); texData = bsp.GetTextureData(); texStringTable = bsp.GetTextureStringTable(); textureStringData = bsp.GetTextureStringData(); mapFile.Close(); #endregion } }