public byte[] GetTileSetData(TileSetDataType tsetType) { var dataOffset = (int)tsetType * 0x4000; var data = new byte[0x4000]; using (MemoryStream ms = new MemoryStream(tilesetData)) { ms.Position = dataOffset; ms.Read(data, 0, 0x4000); } return(data); }
public void SetTileSetData(TileSetDataType tsetType, byte[] data) { var dataOffset = (int)tsetType * 0x4000; using (MemoryStream ms = new MemoryStream(tilesetData)) { using (BinaryWriter bw = new BinaryWriter(ms)) { ms.Seek(dataOffset, SeekOrigin.Begin); bw.Write(data); } } }
public long GetCompressedTileSetData(ref byte[] data, TileSetDataType tsetType) { var uncompData = GetTileSetData(tsetType); return(DataHelper.CompressData(ref data, uncompData)); }