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:
2019-01-21 19:56:51 -06:00
parent fbf6c5d1aa
commit ea6b3cf9e3
18 changed files with 145 additions and 111 deletions

View File

@@ -1,21 +1,22 @@
using Microsoft.Xna.Framework.Content.Pipeline;
using Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler;
using Newtonsoft.Json;
using RecrownedAthenaeum.Data;
namespace RecrownedAthenaeum.Pipeline.TextureAtlas
{
[ContentTypeWriter]
class TextureAtlasWriter : ContentTypeWriter<TextureAtlasData>
class TextureAtlasWriter : ContentTypeWriter<TextureAtlasProcessor.Package>
{
public override string GetRuntimeReader(TargetPlatform targetPlatform)
{
return "RecrownedAthenaeum.ContentReaders.TextureAtlasDataReader, RecrownedAthenaeum";
}
protected override void Write(ContentWriter output, TextureAtlasData value)
protected override void Write(ContentWriter output, TextureAtlasProcessor.Package value)
{
output.Write(JsonConvert.SerializeObject(value));
output.Write(value.textureBytes.Length);
output.Write(value.textureBytes);
output.Write(value.textureAtlasDataBytes.Length);
output.Write(value.textureAtlasDataBytes);
}
}
}