From 7116eb0437c30ec6c32f8a85ec3f8dd7d1f0bd63 Mon Sep 17 00:00:00 2001 From: Harrison Deng Date: Sun, 13 Jan 2019 17:09:27 -0600 Subject: [PATCH] more descriptive display name + set default processors. --- .../NinePatch/NinePatchImporter.cs | 2 +- .../NinePatch/NinePatchProcessor.cs | 2 +- .../TextureAtlas/TextureAtlasImporter.cs | 8 ++------ .../TextureAtlas/TextureAtlasProcessor.cs | 3 +-- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/RecrownedAthenaeum.Pipeline/NinePatch/NinePatchImporter.cs b/RecrownedAthenaeum.Pipeline/NinePatch/NinePatchImporter.cs index d0f4250..bb353c5 100644 --- a/RecrownedAthenaeum.Pipeline/NinePatch/NinePatchImporter.cs +++ b/RecrownedAthenaeum.Pipeline/NinePatch/NinePatchImporter.cs @@ -4,7 +4,7 @@ using System.IO; namespace RecrownedAthenaeum.Pipeline.NinePatch { - [ContentImporter(".9p", DisplayName = "Nine Patch Importer")] + [ContentImporter(".9p", DisplayName = "Nine Patch Importer", DefaultProcessor = "NinePatchProcessor")] internal class NinePatchImporter : ContentImporter { public override NinePatchData Import(string filename, ContentImporterContext context) diff --git a/RecrownedAthenaeum.Pipeline/NinePatch/NinePatchProcessor.cs b/RecrownedAthenaeum.Pipeline/NinePatch/NinePatchProcessor.cs index d45368c..9ce9466 100644 --- a/RecrownedAthenaeum.Pipeline/NinePatch/NinePatchProcessor.cs +++ b/RecrownedAthenaeum.Pipeline/NinePatch/NinePatchProcessor.cs @@ -4,7 +4,7 @@ using System.Text; namespace RecrownedAthenaeum.Pipeline.NinePatch { - [ContentImporter(DisplayName = "Nine Patch Importer")] + [ContentImporter(DisplayName = "Nine Patch Importer - RecrownedAthenaeum")] class NinePatchProcessor : ContentProcessor { public override byte[] Process(NinePatchData input, ContentProcessorContext context) diff --git a/RecrownedAthenaeum.Pipeline/TextureAtlas/TextureAtlasImporter.cs b/RecrownedAthenaeum.Pipeline/TextureAtlas/TextureAtlasImporter.cs index 17f0d13..d224fdd 100644 --- a/RecrownedAthenaeum.Pipeline/TextureAtlas/TextureAtlasImporter.cs +++ b/RecrownedAthenaeum.Pipeline/TextureAtlas/TextureAtlasImporter.cs @@ -4,16 +4,12 @@ using System.IO; namespace RecrownedAthenaeum.Pipeline.TextureAtlas { - [ContentImporter(".tatlas", DisplayName = "Texture Atlas Importer")] + [ContentImporter(".tatlas", DisplayName = "Texture Atlas Importer", DefaultProcessor = "TextureAtlasProcessor")] internal class TextureAtlasImporter : ContentImporter { public override TextureAtlasData Import(string filename, ContentImporterContext context) { - TextureAtlasData atlas; - using (StreamReader stream = new StreamReader(filename)) - { - atlas = JsonConvert.DeserializeObject(stream.ReadToEnd()); - } + TextureAtlasData atlas = JsonConvert.DeserializeObject(File.ReadAllText(filename)); context.AddDependency(atlas.textureName); return atlas; } diff --git a/RecrownedAthenaeum.Pipeline/TextureAtlas/TextureAtlasProcessor.cs b/RecrownedAthenaeum.Pipeline/TextureAtlas/TextureAtlasProcessor.cs index d18c370..df515af 100644 --- a/RecrownedAthenaeum.Pipeline/TextureAtlas/TextureAtlasProcessor.cs +++ b/RecrownedAthenaeum.Pipeline/TextureAtlas/TextureAtlasProcessor.cs @@ -4,10 +4,9 @@ using System.Text; namespace RecrownedAthenaeum.Pipeline.TextureAtlas { - [ContentProcessor(DisplayName = "Texture Atlas Processor")] + [ContentProcessor(DisplayName = "Texture Atlas Processor - RecrownedAthenaeum")] class TextureAtlasProcessor : ContentProcessor { - public override byte[] Process(TextureAtlasData input, ContentProcessorContext context) { string serialized = JsonConvert.SerializeObject(input);