recrownedgtk/RecrownedAthenaeum.Pipeline/TextureAtlas/TextureAtlasImporter.cs

18 lines
663 B
C#
Raw Normal View History

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