コード例 #1
0
 internal void SaveDirectory(WzBinaryWriter writer)
 {
     offset = (uint)writer.BaseStream.Position;
     int entryCount = subDirs.Count + images.Count;
     if (entryCount == 0)
     {
         BlockSize = 0;
         return;
     }
     writer.WriteCompressedInt(entryCount);
     foreach (WzImage img in images)
     {
         writer.WriteWzObjectValue(img.name, 4);
         writer.WriteCompressedInt(img.BlockSize);
         writer.WriteCompressedInt(img.Checksum);
         writer.WriteOffset(img.Offset);
     }
     foreach (WzDirectory dir in subDirs)
     {
         writer.WriteWzObjectValue(dir.name, 3);
         writer.WriteCompressedInt(dir.BlockSize);
         writer.WriteCompressedInt(dir.Checksum);
         writer.WriteOffset(dir.Offset);
     }
     foreach (WzDirectory dir in subDirs)
         if (dir.BlockSize > 0)
             dir.SaveDirectory(writer);
         else
             writer.Write((byte)0);
 }
コード例 #2
0
        internal void SaveDirectory(WzBinaryWriter writer)
        {
            Offset = (uint)writer.BaseStream.Position;
            var entryCount = WzDirectories.Count + WzImages.Count;

            if (entryCount == 0)
            {
                BlockSize = 0;
                return;
            }

            writer.WriteCompressedInt(entryCount);
            foreach (var img in WzImages)
            {
                writer.WriteWzObjectValue(img.Name, 4);
                writer.WriteCompressedInt(img.BlockSize);
                writer.WriteCompressedInt(img.Checksum);
                writer.WriteOffset(img.Offset);
            }

            foreach (var dir in WzDirectories)
            {
                writer.WriteWzObjectValue(dir.Name, 3);
                writer.WriteCompressedInt(dir.BlockSize);
                writer.WriteCompressedInt(dir.Checksum);
                writer.WriteOffset(dir.Offset);
            }

            foreach (var dir in WzDirectories)
            {
                if (dir.BlockSize > 0)
                {
                    dir.SaveDirectory(writer);
                }
                else
                {
                    writer.Write((byte)0);
                }
            }
        }
コード例 #3
0
        internal void SaveDirectory(WzBinaryWriter pWriter)
        {
            mOffset = (uint)pWriter.BaseStream.Position;
            int entryCount = mSubDirs.Count + mImages.Count;

            if (entryCount == 0)
            {
                BlockSize = 0;
                return;
            }
            pWriter.WriteCompressedInt(entryCount);
            foreach (WzImage img in mImages)
            {
                pWriter.WriteWzObjectValue(img.mName, 4);
                pWriter.WriteCompressedInt(img.BlockSize);
                pWriter.WriteCompressedInt(img.Checksum);
                pWriter.WriteOffset(img.Offset);
            }
            foreach (WzDirectory dir in mSubDirs)
            {
                pWriter.WriteWzObjectValue(dir.mName, 3);
                pWriter.WriteCompressedInt(dir.BlockSize);
                pWriter.WriteCompressedInt(dir.Checksum);
                pWriter.WriteOffset(dir.Offset);
            }
            foreach (WzDirectory dir in mSubDirs)
            {
                if (dir.BlockSize > 0)
                {
                    dir.SaveDirectory(pWriter);
                }
                else
                {
                    pWriter.Write((byte)0);
                }
            }
        }