Esempio n. 1
0
 /// <summary>
 /// Write the header of this chunk.
 /// Always call the base method first.
 /// </summary>
 protected override void WriteHeader(ResWriter writer)
 {
     base.WriteHeader(writer);
     writer.WriteByte(id);
     writer.WriteByte(0);              // res0
     writer.WriteUInt16(0);            // res1
     writer.WriteInt32(entries.Count); // entryCount
 }
Esempio n. 2
0
 /// <summary>
 /// Encode a length in charsize=1 mode
 /// </summary>
 private static void EncodeLength8(ResWriter writer, int length)
 {
     if (length > 0x7F)
     {
         // use 2 bytes
         writer.WriteByte(0x80 | ((length >> 8) & 0x7F));
     }
     writer.WriteByte(length & 0x7F);
 }
Esempio n. 3
0
            /// <summary>
            /// Write the header of this chunk.
            /// Always call the base method first.
            /// </summary>
            protected override void WriteHeader(ResWriter writer)
            {
                var startPosition = writer.Position;

                base.WriteHeader(writer);
                writer.WriteByte(parent.Id);
                writer.WriteByte(0);                       // res0
                writer.WriteUInt16(0);                     // res1
                writer.WriteInt32(parent.EntryCount);      // entryCount
                var entriesStartMark = writer.MarkInt32(); // entriesStart

                configuration.Write(writer);

                // Patch entriesStart
                entriesStartMark.Value = (writer.Position - startPosition) + (parent.EntryCount * 4);
            }
Esempio n. 4
0
        /// <summary>
        /// Write this chunk.
        /// </summary>
        public void Write(ResWriter writer)
        {
            var size = 8;

            writer.WriteUInt16(size);
            writer.Fill(1); // res0
            writer.WriteByte((int)type);
            writer.WriteInt32(data);
        }