Added setup system. Changed reader and writer for texture atlas and nine patch to have image and serialized data be in same file. Some refactors occurred as well.
This commit is contained in:
@@ -1,15 +1,25 @@
|
||||
using Microsoft.Xna.Framework.Content.Pipeline;
|
||||
using Newtonsoft.Json;
|
||||
using RecrownedAthenaeum.Data;
|
||||
using System.IO;
|
||||
using TImport = System.String;
|
||||
|
||||
namespace RecrownedAthenaeum.Pipeline.TextureAtlas
|
||||
{
|
||||
[ContentImporter(".tatlas", DisplayName = "Texture Atlas Importer", DefaultProcessor = "TextureAtlasProcessor")]
|
||||
internal class TextureAtlasImporter : ContentImporter<TImport>
|
||||
internal class TextureAtlasImporter : ContentImporter<TextureAtlasImporter.Package>
|
||||
{
|
||||
public override TImport Import(string filename, ContentImporterContext context)
|
||||
public override Package Import(string filename, ContentImporterContext context)
|
||||
{
|
||||
return File.ReadAllText(filename);
|
||||
Package package;
|
||||
package.textureAtlasData = JsonConvert.DeserializeObject<TextureAtlasData>(File.ReadAllText(filename));
|
||||
package.textureBytes = File.ReadAllBytes(package.textureAtlasData.textureName);
|
||||
return package;
|
||||
}
|
||||
|
||||
internal struct Package
|
||||
{
|
||||
internal TextureAtlasData textureAtlasData;
|
||||
internal byte[] textureBytes;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user