recrownedathenaeum/RecrownedAthenaeum.Pipeline/TextureAtlas/TextureAtlasProcessor.cs

25 lines
853 B
C#
Raw Normal View History

using Microsoft.Xna.Framework.Content.Pipeline;
using Newtonsoft.Json;
using System.Text;
namespace RecrownedAthenaeum.Pipeline.TextureAtlas
{
[ContentProcessor(DisplayName = "Texture Atlas - RecrownedAthenaeum")]
class TextureAtlasProcessor : ContentProcessor<TextureAtlasImporter.Package, TextureAtlasProcessor.Package>
{
public override Package Process(TextureAtlasImporter.Package input, ContentProcessorContext context)
{
Package package;
package.textureBytes = input.textureBytes;
package.textureAtlasDataBytes = Encoding.ASCII.GetBytes(JsonConvert.SerializeObject(input.textureAtlasData));
return package;
}
internal struct Package
{
public byte[] textureBytes;
public byte[] textureAtlasDataBytes;
}
}
}