diff --git a/.gitignore b/.gitignore
index 89cc35d7..893d7e93 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,4 +7,5 @@ obj
*.cachefile
/packages/**
/package
-/UpgradeLog.htm
\ No newline at end of file
+/UpgradeLog.htm
+log.txt
diff --git a/ANX.Framework.Content.Pipeline.Assimp/ANX.Framework.Content.Pipeline.Assimp.csproj b/ANX.Framework.Content.Pipeline.Assimp/ANX.Framework.Content.Pipeline.Assimp.csproj
index 5dcc476d..c15ae8a9 100644
--- a/ANX.Framework.Content.Pipeline.Assimp/ANX.Framework.Content.Pipeline.Assimp.csproj
+++ b/ANX.Framework.Content.Pipeline.Assimp/ANX.Framework.Content.Pipeline.Assimp.csproj
@@ -38,6 +38,7 @@
+
@@ -58,6 +59,14 @@
ANX.Framework
+
+
+ Assimp32.dll
+
+
+ Assimp64.dll
+
+
diff --git a/ANX.Framework.Content.Pipeline.Assimp/Importer/AssimpImporter.cs b/ANX.Framework.Content.Pipeline.Assimp/Importer/AssimpImporter.cs
index debaeeb2..256e5279 100644
--- a/ANX.Framework.Content.Pipeline.Assimp/Importer/AssimpImporter.cs
+++ b/ANX.Framework.Content.Pipeline.Assimp/Importer/AssimpImporter.cs
@@ -46,7 +46,7 @@ namespace ANX.Framework.Content.Pipeline
this.identity = new ContentIdentity(filename, this.GetType().Name);
- //AssimpDeploy.DeployLibraries();
+ AssimpDeploy.DeployLibraries();
Assimp.AssimpContext assimpContext = new AssimpContext();
diff --git a/ANX.Framework.Content.Pipeline.Assimp/Importer/AssimpImporterAttribute.cs b/ANX.Framework.Content.Pipeline.Assimp/Importer/AssimpImporterAttribute.cs
index be7400b6..e26a523d 100644
--- a/ANX.Framework.Content.Pipeline.Assimp/Importer/AssimpImporterAttribute.cs
+++ b/ANX.Framework.Content.Pipeline.Assimp/Importer/AssimpImporterAttribute.cs
@@ -12,7 +12,7 @@ namespace ANX.Framework.Content.Pipeline
{
try
{
- //AssimpDeploy.DeployLibraries();
+ AssimpDeploy.DeployLibraries();
Assimp.AssimpContext context = new Assimp.AssimpContext();
diff --git a/ANX.Framework.Content.Pipeline/Graphics/DxtBitmapContent.cs b/ANX.Framework.Content.Pipeline/Graphics/DxtBitmapContent.cs
index b3a996be..3e5d6b8f 100644
--- a/ANX.Framework.Content.Pipeline/Graphics/DxtBitmapContent.cs
+++ b/ANX.Framework.Content.Pipeline/Graphics/DxtBitmapContent.cs
@@ -32,8 +32,8 @@ namespace ANX.Framework.Content.Pipeline.Graphics
//Data in a DXT texture is compressed in blocks of 4x4 pixels, the block size is the resolution for this blocks.
//The block size is also the reason why width and height must be a multiple of four.
width = (width + 3) / 4;
- height = (height + 3) / 4;
- _pixelData = new byte[width * height * blockSize];
+ height = (height + 3) / 4;
+ _pixelData = new byte[width * height * blockSize];
}
public override byte[] GetPixelData()
diff --git a/ANX.Framework.Content.Pipeline/Importer/EffectImporter.cs b/ANX.Framework.Content.Pipeline/Importer/EffectImporter.cs
index 407f24cf..ea9ca749 100644
--- a/ANX.Framework.Content.Pipeline/Importer/EffectImporter.cs
+++ b/ANX.Framework.Content.Pipeline/Importer/EffectImporter.cs
@@ -11,7 +11,7 @@ using ANX.Framework.NonXNA;
namespace ANX.Framework.Content.Pipeline
{
- [ContentImporter(new string[] { ".fx", ".fxg", ".hlsl", ".glsl" })]
+ [ContentImporter(new string[] { ".fx", ".fxg", ".hlsl", ".glsl" }, Category = "Effect Files")]
public class EffectImporter : ContentImporter
{
public override EffectContent Import(string filename, ContentImporterContext context)
diff --git a/ANX.Framework.Content.Pipeline/Importer/FontDescriptionImporter.cs b/ANX.Framework.Content.Pipeline/Importer/FontDescriptionImporter.cs
index 090ad9c5..65fab2d5 100644
--- a/ANX.Framework.Content.Pipeline/Importer/FontDescriptionImporter.cs
+++ b/ANX.Framework.Content.Pipeline/Importer/FontDescriptionImporter.cs
@@ -23,7 +23,7 @@ namespace ANX.Framework.Content.Pipeline.Importer
[PercentageComplete(90)]
[Developer("SilentWarrior/Eagle Eye Studios, KorsarNek")]
[TestState(TestStateAttribute.TestState.InProgress)] //Works but there should be a check whether the characters are supported
- [ContentImporter("Spritefont", ".spritefont", DefaultProcessor = "FontDescriptionProcessor", DisplayName = "FontDescription Importer - ANX Framework")]
+ [ContentImporter("Spritefont", ".spritefont", DefaultProcessor = "FontDescriptionProcessor", DisplayName = "FontDescription Importer - ANX Framework", Category = "Font Files")]
public class FontDescriptionImporter : ContentImporter
{
///
diff --git a/ANX.Framework.Content.Pipeline/Importer/TextureImporter.cs b/ANX.Framework.Content.Pipeline/Importer/TextureImporter.cs
index 38e63b2e..bc3a6305 100644
--- a/ANX.Framework.Content.Pipeline/Importer/TextureImporter.cs
+++ b/ANX.Framework.Content.Pipeline/Importer/TextureImporter.cs
@@ -7,6 +7,8 @@ using ANX.Framework.Content.Pipeline.Graphics;
using ANX.Framework.Content;
using System.IO;
using System.Drawing;
+using ANX.Framework.Content.Pipeline.Helpers;
+using System.Runtime.InteropServices;
#endregion
@@ -16,16 +18,30 @@ using System.Drawing;
namespace ANX.Framework.Content.Pipeline.Importer
{
- [ContentImporter(new string[] { ".bmp", ".jpg", ".jpeg", ".png", ".wdp", ".gif", ".tif" }, DefaultProcessor = "SpriteTextureProcessor")]
+ [ContentImporter(new string[] { ".bmp", ".jpg", ".jpeg", ".png", ".wdp", ".gif", ".tif", ".tga", ".dds" }, DefaultProcessor = "TextureProcessor", Category = "Texture Files", DisplayName = "TextureImporter - ANX Framework")]
public class TextureImporter : ContentImporter
{
public override TextureContent Import(string filename, ContentImporterContext context)
{
string fileExtension = Path.GetExtension(filename).ToLowerInvariant();
- Image image = Bitmap.FromFile(filename);
+ BitmapContent bitmapContent;
+ if (fileExtension == ".tga" || fileExtension == ".dds")
+ bitmapContent = LoadByRendersystem(filename);
+ else
+ bitmapContent = LoadByGdi(filename);
+
+ TextureContent textureContent = new Texture2DContent();
+ textureContent.Faces[0] = new MipmapChain(bitmapContent);
+
+ return textureContent;
+ }
+
+ private BitmapContent LoadByGdi(string fileName)
+ {
+ Image image = Bitmap.FromFile(fileName);
Bitmap bitmap = new Bitmap(image);
- PixelBitmapContent bitmapContent = new PixelBitmapContent(image.Width, image.Height);
+ var bitmapContent = new PixelBitmapContent(image.Width, image.Height);
System.Drawing.Color sourceColor;
ANX.Framework.Color destColor = new Color();
@@ -44,10 +60,31 @@ namespace ANX.Framework.Content.Pipeline.Importer
}
}
- TextureContent textureContent = new Texture2DContent();
- textureContent.Faces[0] = new MipmapChain(bitmapContent);
+ return bitmapContent;
+ }
- return textureContent;
+ private BitmapContent LoadByRendersystem(string fileName)
+ {
+ using (FileStream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read))
+ {
+ var texture = ANX.Framework.Graphics.Texture2D.FromStream(GraphicsHelper.ReferenceDevice, stream);
+
+ Type vectorType;
+ if (VectorConverter.TryGetVectorType(texture.Format, out vectorType))
+ {
+ var content = (BitmapContent)Activator.CreateInstance(typeof(PixelBitmapContent<>).MakeGenericType(vectorType), texture.Width, texture.Height);
+
+ byte[] data = new byte[texture.Width * texture.Height * Marshal.SizeOf(vectorType)];
+ texture.GetData(data);
+ content.SetPixelData(data);
+
+ return content;
+ }
+ else
+ {
+ throw new InvalidContentException("Unable to convert file format.");
+ }
+ }
}
}
}
diff --git a/ANX.Framework.Content.Pipeline/Importer/WavImporter.cs b/ANX.Framework.Content.Pipeline/Importer/WavImporter.cs
index 61ba905d..85886e28 100644
--- a/ANX.Framework.Content.Pipeline/Importer/WavImporter.cs
+++ b/ANX.Framework.Content.Pipeline/Importer/WavImporter.cs
@@ -9,7 +9,7 @@ using WaveUtils;
namespace ANX.Framework.Content.Pipeline.Importer
{
- [ContentImporter(new string[] { ".wav" }, DefaultProcessor = "SoundEffectProcessor")]
+ [ContentImporter(new string[] { ".wav" }, DefaultProcessor = "SoundEffectProcessor", Category="Sound Files")]
public class WavImporter : ContentImporter
{
public override AudioContent Import(string filename, ContentImporterContext context)
diff --git a/ANX.Framework.Content.Pipeline/Importer/XmlImporter.cs b/ANX.Framework.Content.Pipeline/Importer/XmlImporter.cs
index 166493eb..76117486 100644
--- a/ANX.Framework.Content.Pipeline/Importer/XmlImporter.cs
+++ b/ANX.Framework.Content.Pipeline/Importer/XmlImporter.cs
@@ -10,6 +10,7 @@ using System.Xml.Linq;
using ANX.Framework.NonXNA.Development;
using ANX.Framework.NonXNA.Reflection;
using ANX.Framework.Content.Pipeline.Serialization.Intermediate;
+using System.ComponentModel;
#endregion
// This file is part of the ANX.Framework created by the
@@ -18,13 +19,12 @@ using ANX.Framework.Content.Pipeline.Serialization.Intermediate;
namespace ANX.Framework.Content.Pipeline.Importer
{
- [ContentImporter(new[] { ".xml" })]
+ [ContentImporter(new[] { ".xml" }, Category="XML Files")]
[Developer("KorsarNek")]
[PercentageComplete(100)]
[TestState(TestStateAttribute.TestState.InProgress)]
public class XmlImporter : ContentImporter