2018-12-23 17:04:11 +00:00
|
|
|
|
using Microsoft.Xna.Framework.Content.Pipeline;
|
|
|
|
|
using Newtonsoft.Json;
|
2019-01-20 07:07:52 +00:00
|
|
|
|
using RecrownedAthenaeum.Data;
|
2019-01-22 01:56:51 +00:00
|
|
|
|
using System.Text;
|
2018-12-23 17:04:11 +00:00
|
|
|
|
|
|
|
|
|
namespace RecrownedAthenaeum.Pipeline.NinePatch
|
|
|
|
|
{
|
2019-01-14 04:05:34 +00:00
|
|
|
|
[ContentImporter(DisplayName = "Nine Patch - RecrownedAthenaeum")]
|
2019-01-22 01:56:51 +00:00
|
|
|
|
class NinePatchProcessor : ContentProcessor<NinePatchImporter.Package, NinePatchProcessor.Package>
|
2018-12-23 17:04:11 +00:00
|
|
|
|
{
|
2019-01-22 01:56:51 +00:00
|
|
|
|
public override Package Process(NinePatchImporter.Package input, ContentProcessorContext context)
|
2018-12-23 17:04:11 +00:00
|
|
|
|
{
|
2019-01-22 01:56:51 +00:00
|
|
|
|
Package package;
|
|
|
|
|
package.ninePatchDataBytes = Encoding.ASCII.GetBytes(JsonConvert.SerializeObject(input.ninePatchData));
|
|
|
|
|
package.textureBytes = input.textureBytes;
|
|
|
|
|
return package;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal struct Package
|
|
|
|
|
{
|
|
|
|
|
internal byte[] ninePatchDataBytes;
|
|
|
|
|
internal byte[] textureBytes;
|
2018-12-23 17:04:11 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|