18 lines
663 B
C#
18 lines
663 B
C#
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));
|
|
context.AddDependency(atlas.textureName);
|
|
return atlas;
|
|
}
|
|
}
|
|
}
|