public void write(Writer writer) { writer.Write(visible); writer.writeRSDKString(name); writer.Write((byte)type); writer.Write(drawOrder); writer.Write(width); writer.Write(height); writer.Write(parallaxFactor); writer.Write(scrollSpeed); writer.Write((ushort)scrollInfo.Count); foreach (ScrollInfo info in scrollInfo) { info.write(writer); } writer.writeCompressed(lineScroll); using (MemoryStream cmem = new MemoryStream()) { using (Writer cwriter = new Writer(cmem)) { for (int y = 0; y < height; ++y) { for (int x = 0; x < width; ++x) { cwriter.Write(layout[y][x]); } } cwriter.Close(); writer.writeCompressed(cmem.ToArray()); } } }
public void write(Writer writer) { writer.Write(signature); using (var stream = new MemoryStream()) { using (var cwriter = new Writer(stream)) { for (int i = 0; i < TILES_COUNT; ++i) { collisionMasks[0][i].write(cwriter); } for (int i = 0; i < TILES_COUNT; ++i) { collisionMasks[1][i].write(cwriter); } } writer.writeCompressed(stream.ToArray()); } writer.Close(); }