Exemplo n.º 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);
 }