Inheritance: INavigable
Exemplo n.º 1
0
        private void ReadRst(BinaryReaderEx reader)
        {
            long rstStart = reader.BaseStream.Position;

            rstChunk        = new RstChunk();
            rstChunk.Parent = this;
            int magic = reader.ReadInt32();

            if (magic != 0x54535240)
            {
                throw new InvalidOperationException("Expecting @RST (0x54535240), Found " + magic.ToString("X"));
            }

            rstChunk.ChunkBlocks     = reader.ReadInt16();
            rstChunk.NumResources    = reader.ReadInt16();
            rstChunk.ResourceOffsets = new List <int>();
            for (var i = 0; i < rstChunk.NumResources; i++)
            {
                rstChunk.ResourceOffsets.Add(reader.ReadInt32());
            }

            this.Children.Add(rstChunk);

            int  rstLen    = rstChunk.ChunkBlocks * 8;
            long rstOffset = rstStart + rstLen;

            ReadResources(reader, rstOffset);
        }
Exemplo n.º 2
0
        private void ReadRst(BinaryReaderEx reader)
        {
            long rstStart = reader.BaseStream.Position;

            rstChunk = new RstChunk();
            rstChunk.Parent = this;
            int magic = reader.ReadInt32();
            if (magic != 0x54535240) { throw new InvalidOperationException("Expecting @RST (0x54535240), Found " + magic.ToString("X")); }

            rstChunk.ChunkBlocks = reader.ReadInt16();
            rstChunk.NumResources = reader.ReadInt16();
            rstChunk.ResourceOffsets = new List<int>();
            for (var i = 0; i < rstChunk.NumResources; i++)
            {
                rstChunk.ResourceOffsets.Add(reader.ReadInt32());
            }

            this.Children.Add(rstChunk);

            int rstLen = rstChunk.ChunkBlocks * 8;
            long rstOffset = rstStart + rstLen;

            ReadResources(reader, rstOffset);
        }