recrownedgtk/RecrownedAthenaeum.Pipeline/TextureAtlas/TextureAtlasProcessor.cs

18 lines
542 B
C#

using Microsoft.Xna.Framework.Content.Pipeline;
using Newtonsoft.Json;
using System.Text;
namespace RecrownedAthenaeum.Pipeline.TextureAtlas
{
[ContentProcessor(DisplayName = "Texture Atlas Processor")]
class TextureAtlasProcessor : ContentProcessor<TextureAtlasData, byte[]>
{
public override byte[] Process(TextureAtlasData input, ContentProcessorContext context)
{
string serialized = JsonConvert.SerializeObject(input);
return Encoding.UTF8.GetBytes(serialized);
}
}
}