Konstantin Koch 8287c54432 Included the Visual Studio extension and made the necessary changes to make it run.
Replaced the old VS templates with ones that offer more flexiblity.
Started replacing the Content Project for the samples with our custom project type.
Inlcuded a basic not yet working AssimpImporter.
2015-04-08 14:50:03 +02:00

38 lines
1.4 KiB
C#

using ANX.Framework.Content.Pipeline.Graphics;
using ANX.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
namespace ANX.Framework.Content.Pipeline.Serialization.Compiler.GraphicTypeWriters
{
[ContentTypeWriter]
internal class AssimpMaterialWriter : ContentTypeWriter<AssimpMaterialContent>
{
protected override void Write(ContentWriter output, AssimpMaterialContent value)
{
if (output == null)
throw new ArgumentNullException("output");
if (value == null)
throw new ArgumentNullException("value");
//Writes as a BasicEffect.
output.WriteExternalReference(value.Texture);
output.Write(value.DiffuseColor.GetValueOrDefault(Vector3.One));
output.Write(value.EmissiveColor.GetValueOrDefault(Vector3.Zero));
output.Write(value.SpecularColor.GetValueOrDefault(Vector3.One));
output.Write(value.SpecularPower.GetValueOrDefault(16f));
output.Write(value.Alpha.GetValueOrDefault(1f));
output.Write(value.VertexColorEnabled.GetValueOrDefault(false));
}
public override string GetRuntimeReader(TargetPlatform targetPlatform)
{
return typeof(BasicEffectReader).AssemblyQualifiedName;
}
}
}