untested texture atlas pipeline system complete.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
using Microsoft.Xna.Framework.Content.Pipeline;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using RecrownedAthenaeum.DataTypes;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
@@ -11,15 +11,16 @@ using System.Xml.Serialization;
|
||||
|
||||
namespace RecrownedAthenaeum.Pipeline.TextureAtlas
|
||||
{
|
||||
internal class TextureAtlasImporter : ContentImporter<TextureAtlasFile>
|
||||
[ContentImporter(".atlas", DisplayName = "Texture Atlas Importer")]
|
||||
internal class TextureAtlasImporter : ContentImporter<TextureAtlasData>
|
||||
{
|
||||
public override TextureAtlasFile Import(string filename, ContentImporterContext context)
|
||||
public override TextureAtlasData Import(string filename, ContentImporterContext context)
|
||||
{
|
||||
StreamReader stream = new StreamReader(filename);
|
||||
XmlSerializer serializer = new XmlSerializer(typeof(TextureAtlasFile));
|
||||
TextureAtlasFile atlas = (TextureAtlasFile)serializer.Deserialize(stream);
|
||||
context.AddDependency(atlas.textureName);
|
||||
stream.Dispose();
|
||||
TextureAtlasData atlas;
|
||||
using (StreamReader stream = new StreamReader(filename))
|
||||
{
|
||||
atlas = JsonConvert.DeserializeObject<TextureAtlasData>(stream.ReadToEnd());
|
||||
}
|
||||
return atlas;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user