internal void Write(Writer writer) { writer.Write(IgnoredByte); writer.WriteRSDKString(Name); writer.Write(UnknownByte1); writer.Write(UnknownByte2); writer.Write(Width); writer.Write(Height); writer.Write(UnknownWord1); writer.Write(UnknownWord2); writer.Write((ushort)ScrollingInfo.Count); foreach (ScrollInfo info in ScrollingInfo) { info.Write(writer); } writer.WriteCompressed(ScrollIndexes); using (MemoryStream cmem = new MemoryStream()) using (Writer cwriter = new Writer(cmem)) { for (int i = 0; i < Height; ++i) { for (int j = 0; j < Width; ++j) { cwriter.Write(Tiles[i][j]); } } cwriter.Close(); writer.WriteCompressed(cmem.ToArray()); } }
// Write Compressed public void Write(Writer writer) { writer.Write(MAGIC); using (var stream = new MemoryStream()) { using (var writerUncompressed = new BinaryWriter(stream)) { for (int i = 0; i < TILES_COUNT; ++i) { CollisionPath1[i].WriteUnc(writerUncompressed); } for (int i = 0; i < TILES_COUNT; ++i) { CollisionPath2[i].WriteUnc(writerUncompressed); } } writer.WriteCompressed(stream.ToArray()); } writer.Close(); }