Removed pipeline stuff that was used with Monogame.

This commit is contained in:
Harrison Deng 2020-02-16 21:45:17 -05:00
parent dee5f96ea7
commit 9ac8e94530
7 changed files with 0 additions and 151 deletions

View File

@ -1,16 +0,0 @@
using Microsoft.Xna.Framework.Content.Pipeline;
using Newtonsoft.Json;
using RecrownedGTK.Data;
using System.IO;
namespace RecrownedGTK.Pipeline.NinePatch
{
[ContentImporter(".9p", DisplayName = "Nine Patch Importer - RecrownedGTK", DefaultProcessor = "NinePatchProcessor")]
internal class NinePatchImporter : ContentImporter<NinePatchData>
{
public override NinePatchData Import(string filename, ContentImporterContext context)
{
return JsonConvert.DeserializeObject<NinePatchData>(File.ReadAllText(filename));
}
}
}

View File

@ -1,19 +0,0 @@
using Microsoft.Xna.Framework.Content.Pipeline;
using Newtonsoft.Json;
using RecrownedGTK.Data;
using System.IO;
using System.Text;
namespace RecrownedGTK.Pipeline.NinePatch
{
[ContentImporter(DisplayName = "Nine Patch - RecrownedGTK")]
class NinePatchProcessor : ContentProcessor<NinePatchData, NinePatchData>
{
public override NinePatchData Process(NinePatchData input, ContentProcessorContext context)
{
if (Path.GetFileNameWithoutExtension(context.SourceIdentity.SourceFilename) == Path.GetFileNameWithoutExtension(input.textureName)) throw new InvalidContentException("Ninepatch data and texture for the data can't have the same name.");
context.AddDependency(input.textureName);
return input;
}
}
}

View File

@ -1,26 +0,0 @@
using Microsoft.Xna.Framework.Content.Pipeline;
using Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler;
using Newtonsoft.Json;
using RecrownedGTK.Data;
using System.IO;
namespace RecrownedGTK.Pipeline.NinePatch
{
[ContentTypeWriter]
class NinePatchWriter : ContentTypeWriter<NinePatchData>
{
public override string GetRuntimeReader(TargetPlatform targetPlatform)
{
return "RecrownedGTK.ContentReaders.NinePatchDataReader, RecrownedGTK";
}
protected override void Write(ContentWriter output, NinePatchData value)
{
output.Write(Path.GetFileNameWithoutExtension(value.textureName));
output.Write(value.left);
output.Write(value.right);
output.Write(value.bottom);
output.Write(value.top);
}
}
}

View File

@ -1,10 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\RecrownedGTK\RecrownedGTK.csproj" PrivateAssets="All"/>
</ItemGroup>
</Project>

View File

@ -1,18 +0,0 @@
using Microsoft.Xna.Framework.Content.Pipeline;
using Microsoft.Xna.Framework.Content.Pipeline.Graphics;
using Microsoft.Xna.Framework.Content.Pipeline.Processors;
using Newtonsoft.Json;
using RecrownedGTK.Data;
using System.IO;
namespace RecrownedGTK.Pipeline.TextureAtlas
{
[ContentImporter(".tatlas", DisplayName = "Texture Atlas Importer - RecrownedGTK", DefaultProcessor = "TextureAtlasProcessor")]
internal class TextureAtlasImporter : ContentImporter<TextureAtlasData>
{
public override TextureAtlasData Import(string filename, ContentImporterContext context)
{
return JsonConvert.DeserializeObject<TextureAtlasData>(File.ReadAllText(filename));
}
}
}

View File

@ -1,21 +0,0 @@
using Microsoft.Xna.Framework.Content.Pipeline;
using Microsoft.Xna.Framework.Content.Pipeline.Graphics;
using Microsoft.Xna.Framework.Content.Pipeline.Processors;
using Newtonsoft.Json;
using RecrownedGTK.Data;
using System.IO;
using System.Text;
namespace RecrownedGTK.Pipeline.TextureAtlas
{
[ContentProcessor(DisplayName = "Texture Atlas - RecrownedGTK")]
class TextureAtlasProcessor : ContentProcessor<TextureAtlasData, TextureAtlasData>
{
public override TextureAtlasData Process(TextureAtlasData input, ContentProcessorContext context)
{
if (context.SourceIdentity.SourceFilename == input.textureName) throw new InvalidContentException("Texture atlas data and texture file for the atlas can't have the same name.");
context.AddDependency(input.textureName);
return input;
}
}
}

View File

@ -1,41 +0,0 @@
using Microsoft.Xna.Framework.Content.Pipeline;
using Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler;
using Newtonsoft.Json;
using RecrownedGTK.Data;
using System.IO;
namespace RecrownedGTK.Pipeline.TextureAtlas
{
[ContentTypeWriter]
class TextureAtlasWriter : ContentTypeWriter<TextureAtlasData>
{
public override string GetRuntimeReader(TargetPlatform targetPlatform)
{
return "RecrownedGTK.ContentReaders.TextureAtlasDataReader, RecrownedGTK";
}
protected override void Write(ContentWriter output, TextureAtlasData value)
{
output.Write(Path.GetFileNameWithoutExtension(value.textureName));
output.Write(value.regions.Length);
for (int i = 0; i < value.regions.Length; i++)
{
output.Write(value.regions[i].name);
output.Write(value.regions[i].bounds.X);
output.Write(value.regions[i].bounds.Y);
output.Write(value.regions[i].bounds.Width);
output.Write(value.regions[i].bounds.Height);
bool hasNPatch = value.regions[i].ninePatchData != null;
output.Write(hasNPatch);
if (hasNPatch)
{
output.Write(value.regions[i].ninePatchData.left);
output.Write(value.regions[i].ninePatchData.right);
output.Write(value.regions[i].ninePatchData.bottom);
output.Write(value.regions[i].ninePatchData.top);
}
}
}
}
}