コード例 #1
0
        /// <summary>
        /// Loads an entry from a file stream.
        /// </summary>
        /// <param name="file">The file stream to load from.</param>
        /// <param name="parent">The part 6 obj this entry belongs to.</param>
        /// <param name="relOffset">The relative offset into part 5 where the entry begins.</param>
        public NefsHeaderPt6Entry(FileStream file, NefsHeaderPt6 parent, UInt32 relOffset)
        {
            _parent    = parent;
            _relOffset = relOffset;

            /* Read data from file as defined by [FileData] fields. */
            FileData.ReadData(file, _parent.Offset + relOffset, this);
        }
コード例 #2
0
        internal NefsHeader(FileStream file, NefsArchive archive, NefsProgressInfo p)
        {
            _archive = archive;

            p.BeginTask(0.15f, "Reading header intro...");
            _intro = new NefsHeaderIntro(file, p);
            p.EndTask();

            p.BeginTask(0.15f, "Reading header part 1...");
            _part1 = new NefsHeaderPt1(file, _intro.Part1Offset, _intro.Part1Size, p);
            p.EndTask();

            p.BeginTask(0.15f, "Reading header part 2...");
            _part2 = new NefsHeaderPt2(file, _intro.Part2Offset, _intro.Part2Size, p);
            p.EndTask();

            p.BeginTask(0.10f, "Reading header part 3...");
            _part3 = new NefsHeaderPt3(file, _intro.Part3Offset, _intro.Part3Size, p);
            p.EndTask();

            p.BeginTask(0.15f, "Reading header part 4...");
            _part4 = new NefsHeaderPt4(file, _intro.Part4Offset, _intro.Part4Size, p);
            p.EndTask();

            p.BeginTask(0.10f, "Reading header part 5...");
            _part5 = new NefsHeaderPt5(file, _intro.Part5Offset, _intro.Part5Size, p);
            p.EndTask();

            p.BeginTask(0.10f, "Reading header part 6...");
            _part6 = new NefsHeaderPt6(file, _intro.Part6Offset, _intro.Part6Size, p);
            p.EndTask();

            p.BeginTask(0.10f, "Reading header part 7...");
            // Theres a section of data after header part 6 and the first section of compressed data.
            // I'm not sure what it is. Just copying for now.
            var firstItemOffset = _part1.FirstItemDataOffset;

            if (firstItemOffset > 0 && firstItemOffset > _intro.DataOffset)
            {
                _part7 = new NefsHeaderPt7(file, _intro.DataOffset, (uint)firstItemOffset - _intro.DataOffset);
            }
            p.EndTask();
        }