Esempio n. 1
0
        /// <summary>
        ///		Utility function read the header.
        /// </summary>
        public void Initialize()
        {
            BinaryReader reader = new BinaryReader(chunk);

            header         = new InternalBspHeader();
            header.magic   = System.Text.Encoding.ASCII.GetChars(reader.ReadBytes(4));
            header.version = reader.ReadInt32();
            header.lumps   = new InternalBspLump[(int)Quake3LumpType.NumLumps];

            for (int i = 0; i < (int)Quake3LumpType.NumLumps; i++)
            {
                header.lumps[i]        = new InternalBspLump();
                header.lumps[i].offset = reader.ReadInt32();
                header.lumps[i].size   = reader.ReadInt32();
            }

            ReadEntities(header.lumps[(int)Quake3LumpType.Entities], reader);
            ReadElements(header.lumps[(int)Quake3LumpType.Elements], reader);
            ReadFaces(header.lumps[(int)Quake3LumpType.Faces], reader);
            ReadLeafFaces(header.lumps[(int)Quake3LumpType.LeafFaces], reader);
            ReadLeaves(header.lumps[(int)Quake3LumpType.Leaves], reader);
            ReadModels(header.lumps[(int)Quake3LumpType.Models], reader);
            ReadNodes(header.lumps[(int)Quake3LumpType.Nodes], reader);
            ReadPlanes(header.lumps[(int)Quake3LumpType.Planes], reader);
            ReadShaders(header.lumps[(int)Quake3LumpType.Shaders], reader);
            ReadVisData(header.lumps[(int)Quake3LumpType.Visibility], reader);
            ReadVertices(header.lumps[(int)Quake3LumpType.Vertices], reader);
            ReadLeafBrushes(header.lumps[(int)Quake3LumpType.LeafBrushes], reader);
            ReadBrushes(header.lumps[(int)Quake3LumpType.Brushes], reader);
            ReadBrushSides(header.lumps[(int)Quake3LumpType.BrushSides], reader);
        }
Esempio n. 2
0
        public void Initialize(bool headerOnly)
        {
            var reader = new BinaryReader(this.chunk);

            this.header         = new InternalBspHeader();
            this.header.magic   = System.Text.Encoding.UTF8.GetChars(reader.ReadBytes(4));
            this.header.version = reader.ReadInt32();
            this.header.lumps   = new InternalBspLump[(int)Quake3LumpType.NumLumps];

            for (int i = 0; i < (int)Quake3LumpType.NumLumps; i++)
            {
                this.header.lumps[i]        = new InternalBspLump();
                this.header.lumps[i].offset = reader.ReadInt32();
                this.header.lumps[i].size   = reader.ReadInt32();
            }

            InitializeCounts(reader);
            if (headerOnly)
            {
            }
            else
            {
                InitializeData(reader);
            }
        }
Esempio n. 3
0
		public void Initialize( bool headerOnly )
		{
			var reader = new BinaryReader( this.chunk );

			this.header = new InternalBspHeader();
			this.header.magic = System.Text.Encoding.UTF8.GetChars( reader.ReadBytes( 4 ) );
			this.header.version = reader.ReadInt32();
			this.header.lumps = new InternalBspLump[(int)Quake3LumpType.NumLumps];

			for ( int i = 0; i < (int)Quake3LumpType.NumLumps; i++ )
			{
				this.header.lumps[ i ] = new InternalBspLump();
				this.header.lumps[ i ].offset = reader.ReadInt32();
				this.header.lumps[ i ].size = reader.ReadInt32();
			}

			InitializeCounts( reader );
			if ( headerOnly )
			{
			}
			else
			{
				InitializeData( reader );
			}
		}
        /// <summary>
        ///		Utility function read the header.
        /// </summary>
        public void Initialize()
        {
            BinaryReader reader = new BinaryReader(chunk);

            header = new InternalBspHeader();
            header.magic = System.Text.Encoding.ASCII.GetChars(reader.ReadBytes(4));
            header.version = reader.ReadInt32();
            header.lumps = new InternalBspLump[(int) Quake3LumpType.NumLumps];

            for(int i = 0; i < (int) Quake3LumpType.NumLumps; i++)
            {
                header.lumps[i] = new InternalBspLump();
                header.lumps[i].offset = reader.ReadInt32();
                header.lumps[i].size = reader.ReadInt32();
            }

            ReadEntities(header.lumps[(int) Quake3LumpType.Entities], reader);
            ReadElements(header.lumps[(int) Quake3LumpType.Elements], reader);
            ReadFaces(header.lumps[(int) Quake3LumpType.Faces], reader);
            ReadLeafFaces(header.lumps[(int) Quake3LumpType.LeafFaces], reader);
            ReadLeaves(header.lumps[(int) Quake3LumpType.Leaves], reader);
            ReadModels(header.lumps[(int) Quake3LumpType.Models], reader);
            ReadNodes(header.lumps[(int) Quake3LumpType.Nodes], reader);
            ReadPlanes(header.lumps[(int) Quake3LumpType.Planes], reader);
            ReadShaders(header.lumps[(int) Quake3LumpType.Shaders], reader);
            ReadVisData(header.lumps[(int) Quake3LumpType.Visibility], reader);
            ReadVertices(header.lumps[(int) Quake3LumpType.Vertices], reader);
            ReadLeafBrushes(header.lumps[(int) Quake3LumpType.LeafBrushes], reader);
            ReadBrushes(header.lumps[(int) Quake3LumpType.Brushes], reader);
            ReadBrushSides(header.lumps[(int) Quake3LumpType.BrushSides], reader);
        }