2018-12-05 01:19:31 +00:00
|
|
|
|
using Microsoft.Xna.Framework.Content.Pipeline;
|
2018-12-05 08:28:09 +00:00
|
|
|
|
using Newtonsoft.Json;
|
2018-12-05 01:19:31 +00:00
|
|
|
|
using System.IO;
|
|
|
|
|
|
|
|
|
|
namespace RecrownedAthenaeum.Pipeline.TextureAtlas
|
|
|
|
|
{
|
2019-01-13 23:09:27 +00:00
|
|
|
|
[ContentImporter(".tatlas", DisplayName = "Texture Atlas Importer", DefaultProcessor = "TextureAtlasProcessor")]
|
2018-12-05 08:28:09 +00:00
|
|
|
|
internal class TextureAtlasImporter : ContentImporter<TextureAtlasData>
|
2018-12-05 01:19:31 +00:00
|
|
|
|
{
|
2018-12-05 08:28:09 +00:00
|
|
|
|
public override TextureAtlasData Import(string filename, ContentImporterContext context)
|
2018-12-05 01:19:31 +00:00
|
|
|
|
{
|
2019-01-13 23:09:27 +00:00
|
|
|
|
TextureAtlasData atlas = JsonConvert.DeserializeObject<TextureAtlasData>(File.ReadAllText(filename));
|
2018-12-05 21:18:22 +00:00
|
|
|
|
context.AddDependency(atlas.textureName);
|
2018-12-05 01:19:31 +00:00
|
|
|
|
return atlas;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|