public void Serialize(string path) { Core.BinaryFileWriter writer = new Core.BinaryFileWriter(path, false); writer.Write(c_SerializeIdentifier); writer.Write((int)0); // version m_Palettes.Serialize(writer); m_TileGfx.Serialize(writer); m_TileSets.Serialize(writer); m_Chunks.Serialize(writer); m_Maps.Serialize(writer); m_Sprites.Serialize(writer); writer.Close(); }
public void Export(string directory) { Core.BinaryFileWriter writer; writer = new Core.BinaryFileWriter(directory + "palettes.dat", false); m_Palettes.Export(writer); writer.Close(); writer = new Core.BinaryFileWriter(directory + "tilegfx.dat", false); m_TileGfx.Export(writer); writer.Close(); writer = new Core.BinaryFileWriter(directory + "tilesets.dat", false); m_TileSets.Export(writer); writer.Close(); writer = new Core.BinaryFileWriter(directory + "chunks.dat", false); m_Chunks.Export(writer); writer.Close(); Core.BinaryFileWriter headers = new Core.BinaryFileWriter(directory + "map_hdrs.dat", false); Core.BinaryFileWriter pointers = new Core.BinaryFileWriter(directory + "map_ptrs.dat", false); Core.BinaryFileWriter data = new Core.BinaryFileWriter(directory + "map_data.dat", false); m_Maps.Export(headers, pointers, data); headers.Close(); pointers.Close(); data.Close(); headers = new Core.BinaryFileWriter(directory + "spr_hdrs.asm", false); data = new Core.BinaryFileWriter(directory + "spr_data.dat", false); m_Sprites.Export(0xA000, 0x1000, 32, headers, data); // constants relate to data placement within banks. see Banks.txt headers.Close(); data.Close(); System.Windows.Forms.MessageBox.Show("Export to " + directory); }