Ejemplo n.º 1
0
        /// <summary>
        /// Writes lump info
        /// </summary>
        /// <param name="lumpId">Id of lump to override</param>
        public void WriteBspLumpInfo(int lumpId, BspLumpInfo info)
        {
            ThrowExceptionIfDisposed();

            //Set offset
            writer.BaseStream.Position = BspOffsets.CalculateLumpOffset(lumpId);
            //Write lump data
            WriteBspLumpInfo(info);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Reads lump info from file
        /// </summary>
        /// <param name="lumpId">Lump id</param>
        public BspLumpInfo ReadLumpInfo(int lumpId)
        {
            ThrowExceptionIfDisposed();

            if (cachedInfo != null)
            {
                return(cachedInfo.Lumps[lumpId]);
            }
            else
            {
                reader.BaseStream.Position = BspOffsets.CalculateLumpOffset(lumpId);
                return(ReadLump());
            }
        }