public bool UnSerialize(IOReader reader)
        {
            try
            {
                if (reader.ReadUInt() != m_dwSignature)
                    return false;
                this.m_wDiskNumber = reader.ReadUShort();
                this.m_wDiskNumberCDir = reader.ReadUShort();
                this.m_wNumCDirEntries = reader.ReadUShort();
                this.m_wTotalCDirEntries = reader.ReadUShort();
                this.m_dwSizeOfCDir = reader.ReadUInt();
                this.m_dwStartOfCDir = reader.ReadUInt();
                this.m_wCommentLen = reader.ReadUShort();
                this.m_Comment = Encoding.ASCII.GetString(reader.ReadBytes(this.m_wCommentLen));
                return true;

            }
            catch { return false; }
        }
 public bool UnSerialize(IOReader reader)
 {
     try
     {
         if (reader.ReadUInt() != m_dwSignature)
             return false;
         this.m_wVersionMadeBy = reader.ReadUShort();
         this.m_wVersionMadeBy = reader.ReadUShort();
         this.m_wGeneralBitFlag = reader.ReadUShort();
         this.m_wCompressionMethod = reader.ReadUShort();
         this.m_wLastModTime = reader.ReadUShort();
         this.m_wLastModDate = reader.ReadUShort();
         this.m_dwCRC32 = reader.ReadUInt();
         this.m_dwCompressedSize = reader.ReadUInt();
         this.m_dwUnCompressedSize = reader.ReadUInt();
         this.m_wFilenameLen = reader.ReadUShort();
         this.m_wExtraFieldLen = reader.ReadUShort();
         this.m_wCommentLen = reader.ReadUShort();
         this.m_wDiskNumber = reader.ReadUShort();
         this.m_wInternalArrtib = reader.ReadUShort();
         this.m_wExternalArrtib = reader.ReadUInt();
         this.m_dwOffsetLocalFile = reader.ReadUInt();
         this.m_sFileName = ASCIIEncoding.ASCII.GetString(reader.ReadBytes(this.m_wFilenameLen));
         return true;
     }
     catch { return false; }
 }
Exemplo n.º 3
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.º 4
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.º 5
0
 public void UnSerialize(IOReader reader)
 {
     base.UnSerialize(reader);
     this.Depth = reader.ReadUShort();
 }
Exemplo n.º 6
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();
 }