removed compression step, added ninepatch stuff to pipeline.

This commit is contained in:
2018-12-23 11:04:11 -06:00
parent a97cfa0309
commit 5f525fbb9f
9 changed files with 102 additions and 32 deletions

View File

@@ -1,13 +1,6 @@
using Microsoft.Xna.Framework.Content.Pipeline;
using Microsoft.Xna.Framework.Graphics;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;
namespace RecrownedAthenaeum.Pipeline.TextureAtlas
{

View File

@@ -18,17 +18,7 @@ namespace RecrownedAthenaeum.Pipeline.TextureAtlas
public override byte[] Process(TextureAtlasData input, ContentProcessorContext context)
{
string serialized = JsonConvert.SerializeObject(input);
byte[] bytes = Encoding.UTF8.GetBytes(serialized);
using (MemoryStream outStream = new MemoryStream())
{
using (GZipStream gZipStream = new GZipStream(outStream, CompressionLevel.Optimal))
{
gZipStream.Write(bytes, 0, bytes.Length);
byte[] compressed = outStream.ToArray();
return compressed;
}
}
return Encoding.UTF8.GetBytes(serialized);
}
}
}