Exemplo n.º 1
0
 public override void CacheData(CompilerTag tag)
 {
     Tagnames.Add(tag.Filename);
 }
Exemplo n.º 2
0
 public override void CacheData(CompilerTag tag)
 {
     tag.ID = Entries.Count;
     Entries.Add(new Entry()
     {
         Type = tag.Type,
         Index = new TagIndex(Entries.Count),
         Length = (int)tag.TagStream.Length
     });
 }
Exemplo n.º 3
0
 public void CacheData(CompilerTag tag, StringsCache cache)
 {
     int index = Values.Count;
     CacheData(tag);
     int count = Values.Count;
     for (int i = index; i < count; i++)
     {
         string str = tag.Strings[Values[i].StringId];
         Values[i].StringId = new StringId((short)cache.Values.IndexOf(str), (sbyte)Encoding.UTF8.GetByteCount(str));
     }
 }
Exemplo n.º 4
0
 public override void CacheData(CompilerTag tag)
 {
     BinaryReader binReader = new BinaryReader(tag.TagStream);
     BinaryWriter binWriter = new BinaryWriter(tag.TagStream);
     tag.TagStream.Position = 0;
     int count = binReader.ReadInt32();
     int address = binReader.ReadInt32();
     int strLength = binReader.ReadInt32();
     int strAddress = binReader.ReadInt32();
     tag.TagStream.Position = strAddress;
     byte[] unicodeBytes = binReader.ReadBytes(strLength);
     int index = Values.Count;
     for (int i = 0; i < count; i++)
     {
         tag.TagStream.Position = address + (i * 40);
         int stringid = binReader.ReadInt32();
         int offset = binReader.ReadInt32();
         List<byte> strBytes = new List<byte>();
         byte c;
         while (true)
         {
             c = unicodeBytes[offset];
             if (c == byte.MinValue) break;
             strBytes.Add(c);
             offset++;
         }
         Values.Add(new Entry() { StringId = stringid, UnicodeString = Encoding.UTF8.GetString(strBytes.ToArray()) });
     }
     tag.TagStream.SetLength(52);
     tag.TagStream.Position = 0;
     binWriter.Write(new byte[16]);
     binWriter.Write((short)index);
     binWriter.Write((short)count);
     binWriter.Write(new byte[32]);
     tag.Type = "unic";
 }
Exemplo n.º 5
0
 public abstract void CacheData(CompilerTag tag);
Exemplo n.º 6
0
 public override void CacheData(CompilerTag tag)
 {
     foreach (string value in tag.Strings)
     {
         if (!Values.Contains(value))
         {
             Values.Add(value);
         }
     }
 }
Exemplo n.º 7
0
 public override void CacheData(CompilerTag tag)
 {
     if (tag.ResourceStream.Length == 0) return;
     Entry entry = new Entry() { Offset = (int)Stream.Position, Length = (int)tag.ResourceStream.Length };
     for (int i = 0; i < tag.RawOffsets.Length; i++)
         tag.RawOffsets[i] += entry.Offset;
     Tags.Add(entry);
     TagIDs.Add(tag.ID);
     BinaryWriter bw = new BinaryWriter(Stream);
     bw.Write(tag.ResourceStream.ToArray());
     bw.Flush();
 }
Exemplo n.º 8
0
 public override void CacheData(CompilerTag tag)
 {
     BinaryWriter bw = new BinaryWriter(Stream);
     bw.Write(Padding.GetBytes(Stream.Position));
     Entry entry = new Entry()
     {
         Offset = (int)Stream.Position,
         Length = (int)tag.TagStream.Length,
         PointerOffsets = tag.PointerOffsets,
         RawOffsets = tag.RawOffsets,
         StringIDOffsets = tag.StringIdOffsets,
         TagIDOffsets = tag.TagReferenceOffsets
     };
     tag.TagStream.WriteTo(Stream);
     bw.Flush();
     Entries.Add(entry);
     TagIndexers.Add(tag.ID);
 }
Exemplo n.º 9
0
 public override void CacheData(CompilerTag tag)
 {
     Tags.Add(tag);
 }