Example #1
0
        public override void WriteValue(MapleLib.WzLib.Util.WzBinaryWriter writer)
        {
            writer.WriteStringValue("Canvas", 0x73, 0x1B);
            writer.Write((byte)0);
            if (properties.Count > 0) // subproperty in the canvas
            {
                writer.Write((byte)1);
                WzImageProperty.WritePropertyList(writer, properties);
            }
            else
            {
                writer.Write((byte)0);
            }

            // Image info
            writer.WriteCompressedInt(PngProperty.Width);
            writer.WriteCompressedInt(PngProperty.Height);
            writer.WriteCompressedInt(PngProperty.Format);
            writer.Write((byte)PngProperty.Format2);
            writer.Write((Int32)0);

            // Write image
            byte[] bytes = PngProperty.GetCompressedBytes(false);
            writer.Write(bytes.Length + 1);
            writer.Write((byte)0); // header? see WzImageProperty.ParseExtendedProp "0x00"
            writer.Write(bytes);
        }
Example #2
0
		public override void WriteValue(WzBinaryWriter writer)
		{
			writer.WriteStringValue("Sound_DX8", 0x73, 0x1B);
			writer.Write((byte)0);
			writer.WriteCompressedInt(SoundData.Length);
			writer.WriteCompressedInt(0);
			writer.Write(SoundData);
		}
Example #3
0
		public override void WriteValue(WzBinaryWriter writer)
		{
            this.header = CreateHeader(this.frequency);
            byte[] data = GetBytes(false);
			writer.WriteStringValue("Sound_DX8", 0x73, 0x1B);
			writer.Write((byte)0);
			writer.WriteCompressedInt(data.Length);
			writer.WriteCompressedInt(len_ms);
            writer.Write(header);
			writer.Write(data);
		}
Example #4
0
 public override void WriteValue(MapleLib.WzLib.Util.WzBinaryWriter writer)
 {
     writer.WriteStringValue("Shape2D#Convex2D", 0x73, 0x1B);
     writer.WriteCompressedInt(ExtendedProperties.Length);
     for (int i = 0; i < ExtendedProperties.Length; i++)
     {
         ExtendedProperties[i].ExtendedProperty.WriteValue(writer);
     }
 }
Example #5
0
		internal static void WritePropertyList(WzBinaryWriter writer, IWzImageProperty[] properties)
		{
			writer.Write((ushort)0);
			writer.WriteCompressedInt(properties.Length);
			for (int i = 0; i < properties.Length; i++)
			{
				writer.WriteStringValue(properties[i].Name, 0x00, 0x01);
				properties[i].WriteValue(writer);
			}
		}
Example #6
0
 public override void WriteValue(MapleLib.WzLib.Util.WzBinaryWriter writer)
 {
     writer.WriteStringValue("Canvas", 0x73, 0x1B);
     writer.Write((byte)0);
     if (properties.Count > 0)
     {
         writer.Write((byte)1);
         IWzImageProperty.WritePropertyList(writer, properties.ToArray());
     }
     else
     {
         writer.Write((byte)0);
     }
     writer.WriteCompressedInt(PngProperty.Width);
     writer.WriteCompressedInt(PngProperty.Height);
     writer.WriteCompressedInt(PngProperty.format);
     writer.Write((byte)PngProperty.format2);
     writer.Write(0);
     writer.Write(PngProperty.CompressedBytes.Length + 1);
     writer.Write((byte)0);
     writer.Write(PngProperty.CompressedBytes);
 }
Example #7
0
 public override void WriteValue(MapleLib.WzLib.Util.WzBinaryWriter writer)
 {
     writer.WriteStringValue("Canvas", 0x73, 0x1B);
     writer.Write((byte)0);
     if (properties.Count > 0)
     {
         writer.Write((byte)1);
         WzImageProperty.WritePropertyList(writer, properties);
     }
     else
     {
         writer.Write((byte)0);
     }
     writer.WriteCompressedInt(PngProperty.Width);
     writer.WriteCompressedInt(PngProperty.Height);
     writer.WriteCompressedInt(PngProperty.nPixFormat);
     writer.Write((byte)PngProperty.nMagLevel);
     writer.Write((Int32)0);
     byte[] bytes = PngProperty.GetCompressedBytes(false);
     writer.Write(bytes.Length + 1);
     writer.Write((byte)0);
     writer.Write(bytes);
 }
Example #8
0
        public override void WriteValue(MapleLib.WzLib.Util.WzBinaryWriter writer)
        {
            List <IExtended> extendedProps = new List <IExtended>(properties.Count);

            foreach (IWzImageProperty prop in properties)
            {
                if (prop is IExtended)
                {
                    extendedProps.Add((IExtended)prop);
                }
            }
            writer.WriteStringValue("Shape2D#Convex2D", 0x73, 0x1B);
            writer.WriteCompressedInt(extendedProps.Count);
            for (int i = 0; i < extendedProps.Count; i++)
            {
                properties[i].WriteValue(writer);
            }
        }
Example #9
0
 public override void WriteValue(MapleLib.WzLib.Util.WzBinaryWriter writer)
 {
     writer.Write((byte)3);
     writer.WriteCompressedInt(Value);
 }
Example #10
0
 public override void WriteValue(MapleLib.WzLib.Util.WzBinaryWriter writer)
 {
     writer.WriteStringValue("Shape2D#Vector2D", 0x73, 0x1B);
     writer.WriteCompressedInt(X.Value);
     writer.WriteCompressedInt(Y.Value);
 }
 internal static void WritePropertyList(WzBinaryWriter writer, List<IWzImageProperty> properties)
 {
     writer.Write((ushort)0);
     writer.WriteCompressedInt(properties.Count);
     for (int i = 0; i < properties.Count; i++)
     {
         writer.WriteStringValue(properties[i].Name, 0x00, 0x01);
         if (properties[i] is IExtended)
             WriteExtendedValue(writer, (IExtended)properties[i]);
         else
             properties[i].WriteValue(writer);
     }
 }
Example #12
0
 public override void WriteValue(MapleLib.WzLib.Util.WzBinaryWriter writer)
 {
     writer.Write((byte)0x1);
     writer.WriteCompressedInt(encryptedBytes.Length);
     writer.Write(encryptedBytes);
 }
Example #13
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);
 }