Exemplo n.º 1
0
 public void UnSerialize()
 {
     try
     {
         using (IOReader reader = new IOReader(m_input, Endian.Big))
         {
             this.m_dwVersion = reader.ReadUInt();
             this.m_dwDirectoryEntries = reader.ReadUInt();
             this.m_dwPreloadEntries = reader.ReadUInt();
             this.m_dwAlignment = reader.ReadUInt();
             this.m_lPreloadDirectory = new List<PreloadEntry>((int)this.m_dwPreloadEntries);
             PreloadEntry entry;
             for (int i = 0; i < this.m_dwPreloadEntries;i++ )
             {
                 entry = new PreloadEntry();
                 entry.PreloadIndex = i;
                 entry.Length = reader.ReadInt();
                 entry.Offset = reader.ReadInt();
                 this.m_lPreloadDirectory.Add(entry);
             }
             int j = 0;
             for (int i = 0; i < this.m_dwDirectoryEntries; i++)
             {
                 ushort iPre = reader.ReadUShort();
                 if (iPre == 0xFFFF)
                     continue;
                 PreloadDirectory[j].ZipIndex = i;
                 j++;
             }
             this.m_dwEntriesStart = (int)reader.BaseStream.Position;
         }
     }
     catch { }
 }
Exemplo n.º 2
0
 public void UnSerialize(IOReader reader)
 {
     this.Width = reader.ReadUShort();
     this.Height = reader.ReadUShort();
     this.Flags = (VTFFlags)reader.ReadInt();
     this.NumFrames = reader.ReadUShort();
     this.StartFrame = reader.ReadUShort();
     this.Reflectivity.UnSerialize(reader);
     this.BumpScale = reader.ReadFloat();
     this.ImageFormat = (VTFImageFormat)reader.ReadInt();
     this.NumMipLevels = reader.ReadByte();
     this.LowResImgFmt = (VTFImageFormat)reader.ReadInt();
     this.LowResImgWidth = reader.ReadByte();
     this.LowResImgHeight = reader.ReadByte();
 }
Exemplo n.º 3
0
 public void UnSerialize(IOReader reader)
 {
     // Make sure we are reading big endian
     reader.ByteOrder = Endian.Big;
     this.Flags = (VTFFlags)reader.ReadInt();
     this.Width = reader.ReadUShort();
     this.Height = reader.ReadUShort();
     this.Depth = reader.ReadUShort();
     this.NumFrames = reader.ReadUShort();
     this.PreloadSize = reader.ReadUShort();
     this.MipSkipCount = reader.ReadByte();
     this.NumResources = reader.ReadByte();
     this.Reflectivity.UnSerialize(reader);
     this.BumpScale = reader.ReadFloat();
     this.ImageFormat = (VTFImageFormat)reader.ReadInt();
     this.LowResImgSmple = reader.ReadBytes(4);
     this.CompressedSize = reader.ReadUInt();
 }
Exemplo n.º 4
0
 public void UnSerialize(IOReader reader)
 {
     this.eType = reader.ReadInt();
     this.flags = (ResourceEntryTypeFlag)eType;
     this.ID = ASCIIEncoding.ASCII.GetBytes(eType.UnMakeID());
     this.resData =reader.ReadUInt();
 }