29 lines
919 B
C#
29 lines
919 B
C#
using Microsoft.Xna.Framework.Content.Pipeline;
|
|
using Microsoft.Xna.Framework.Graphics;
|
|
using Newtonsoft.Json;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Xml.Serialization;
|
|
|
|
namespace RecrownedAthenaeum.Pipeline.TextureAtlas
|
|
{
|
|
[ContentImporter(".tatlas", DisplayName = "Texture Atlas Importer")]
|
|
internal class TextureAtlasImporter : ContentImporter<TextureAtlasData>
|
|
{
|
|
public override TextureAtlasData Import(string filename, ContentImporterContext context)
|
|
{
|
|
TextureAtlasData atlas;
|
|
using (StreamReader stream = new StreamReader(filename))
|
|
{
|
|
atlas = JsonConvert.DeserializeObject<TextureAtlasData>(stream.ReadToEnd());
|
|
}
|
|
context.AddDependency(atlas.textureName);
|
|
return atlas;
|
|
}
|
|
}
|
|
}
|