2018-12-05 01:19:31 +00:00
|
|
|
|
using Microsoft.Xna.Framework.Content.Pipeline;
|
|
|
|
|
using Microsoft.Xna.Framework.Graphics;
|
|
|
|
|
using RecrownedAthenaeum.DataTypes;
|
|
|
|
|
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
|
|
|
|
|
{
|
2018-12-05 06:03:00 +00:00
|
|
|
|
internal class TextureAtlasImporter : ContentImporter<TextureAtlasFile>
|
2018-12-05 01:19:31 +00:00
|
|
|
|
{
|
2018-12-05 06:03:00 +00:00
|
|
|
|
public override TextureAtlasFile Import(string filename, ContentImporterContext context)
|
2018-12-05 01:19:31 +00:00
|
|
|
|
{
|
|
|
|
|
StreamReader stream = new StreamReader(filename);
|
2018-12-05 06:03:00 +00:00
|
|
|
|
XmlSerializer serializer = new XmlSerializer(typeof(TextureAtlasFile));
|
|
|
|
|
TextureAtlasFile atlas = (TextureAtlasFile)serializer.Deserialize(stream);
|
2018-12-05 01:19:31 +00:00
|
|
|
|
context.AddDependency(atlas.textureName);
|
|
|
|
|
stream.Dispose();
|
|
|
|
|
return atlas;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|