Placed the importers into different categories for the "importing existing files" dialog in Visual Studio.
Fixed a performance problem in the Visual Studio extension where no importer or processor was selected for an asset. Fixed that the asset names for Uri encoded in the build output. Fixed that errors when serializing assets get logged. Sped up ImporterManager.GuessImporterByFileExtension, which caused performance problems if many assemblies are loaded into the current AppDomain. Made the AssimpImporter library deploy the binary files again (hopefully just a temporary solution until we've found a better way.) Provide a extension for TargetPlatform enum for getting the DisplayName of an entry. Changed that ProcessorManager.GetProcessorDisplayName doesn't throw an exception if no processor with the given name exists, which now mimicks the same behavior as in importerManager.GetImporterDisplayName.
This commit is contained in:
parent
8287c54432
commit
17d0771b03
3
.gitignore
vendored
3
.gitignore
vendored
@ -7,4 +7,5 @@ obj
|
||||
*.cachefile
|
||||
/packages/**
|
||||
/package
|
||||
/UpgradeLog.htm
|
||||
/UpgradeLog.htm
|
||||
log.txt
|
||||
|
@ -38,6 +38,7 @@
|
||||
<Reference Include="System.Core" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AssimpDeploy.cs" />
|
||||
<Compile Include="Graphics\AssimpMaterialContent.cs" />
|
||||
<Compile Include="Importer\AssimpExtensions.cs" />
|
||||
<Compile Include="Importer\AssimpImporter.cs" />
|
||||
@ -58,6 +59,14 @@
|
||||
<Name>ANX.Framework</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="..\packages\AssimpNet.3.3.1\lib\Assimp32.dll">
|
||||
<Link>Assimp32.dll</Link>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="..\packages\AssimpNet.3.3.1\lib\Assimp64.dll">
|
||||
<Link>Assimp64.dll</Link>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\packages\AssimpNet.3.3.1\build\AssimpNet.targets" Condition="Exists('..\packages\AssimpNet.3.3.1\build\AssimpNet.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
|
@ -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();
|
||||
|
||||
|
@ -12,7 +12,7 @@ namespace ANX.Framework.Content.Pipeline
|
||||
{
|
||||
try
|
||||
{
|
||||
//AssimpDeploy.DeployLibraries();
|
||||
AssimpDeploy.DeployLibraries();
|
||||
|
||||
Assimp.AssimpContext context = new Assimp.AssimpContext();
|
||||
|
||||
|
@ -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()
|
||||
|
@ -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<EffectContent>
|
||||
{
|
||||
public override EffectContent Import(string filename, ContentImporterContext context)
|
||||
|
@ -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<FontDescription>
|
||||
{
|
||||
/// <summary>
|
||||
|
@ -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<TextureContent>
|
||||
{
|
||||
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<Color> bitmapContent = new PixelBitmapContent<Color>(image.Width, image.Height);
|
||||
var bitmapContent = new PixelBitmapContent<Color>(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<byte>(data);
|
||||
content.SetPixelData(data);
|
||||
|
||||
return content;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new InvalidContentException("Unable to convert file format.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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<AudioContent>
|
||||
{
|
||||
public override AudioContent Import(string filename, ContentImporterContext context)
|
||||
|
@ -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<object>
|
||||
{
|
||||
private XDocument _doc;
|
||||
public override object Import(string filename, ContentImporterContext context)
|
||||
{
|
||||
using (XmlReader xmlReader = XmlReader.Create(filename))
|
||||
|
@ -27,7 +27,7 @@ namespace ANX.Framework.Content.Pipeline.Serialization.Compiler
|
||||
{
|
||||
if (output.TargetPlatform != TargetPlatform.Windows)
|
||||
{
|
||||
throw new InvalidOperationException("currently only HLSL windows effects are supported by EffectWriter");
|
||||
throw new InvalidOperationException("Currently only HLSL effects for windows are supported by EffectWriter.");
|
||||
}
|
||||
|
||||
byte[] effectCode = value.GetEffectCode();
|
||||
|
@ -24,4 +24,28 @@ namespace ANX.Framework.Content.Pipeline
|
||||
WindowsMetro = (byte)'8',
|
||||
|
||||
}
|
||||
|
||||
public static class TargetPlatformExtension
|
||||
{
|
||||
public static string ToDisplayName(this TargetPlatform targetPlatform)
|
||||
{
|
||||
switch (targetPlatform)
|
||||
{
|
||||
case TargetPlatform.IOS:
|
||||
return "iOS";
|
||||
case TargetPlatform.MacOs:
|
||||
return "Mac OS";
|
||||
case TargetPlatform.PsVita:
|
||||
return "PS Vita";
|
||||
case TargetPlatform.WindowsMetro:
|
||||
return "Windows Metro";
|
||||
case TargetPlatform.WindowsPhone:
|
||||
return "Windows Phone";
|
||||
case TargetPlatform.XBox360:
|
||||
return "XBox 360";
|
||||
default:
|
||||
return targetPlatform.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -246,9 +246,16 @@ namespace ANX.Framework.Content.Pipeline.Tasks
|
||||
|
||||
if (compiledItem != null)
|
||||
{
|
||||
SerializeAsset(buildItem, compiledItem, outputFilename.LocalPath);
|
||||
try
|
||||
{
|
||||
SerializeAsset(buildItem, compiledItem, outputFilename.LocalPath);
|
||||
|
||||
compiled = new CompiledBuildItem(compiledItem, buildItem, outputFilename.LocalPath, true);
|
||||
compiled = new CompiledBuildItem(compiledItem, buildItem, outputFilename.LocalPath, true);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
LogException(exc, absoluteFilename);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -323,7 +330,7 @@ namespace ANX.Framework.Content.Pipeline.Tasks
|
||||
}
|
||||
|
||||
IContentImporter importer = this.ImporterManager.GetInstance(importerName);
|
||||
buildLogger.LogMessage("importing {0} with importer {1}", Uri.EscapeUriString(item.SourceFilename.ToString()), importer.GetType());
|
||||
buildLogger.LogMessage("importing {0} with importer {1}", item.SourceFilename.ToString(), importer.GetType());
|
||||
|
||||
object result = importer.Import(absoluteFilename, context);
|
||||
|
||||
|
@ -32,7 +32,7 @@ namespace ANX.Framework.Content.Pipeline.Tasks
|
||||
#if LINUX
|
||||
Console.WriteLine("ImporterManager: Checking " + assembly.FullName);
|
||||
#endif
|
||||
foreach (Type type in ANX.Framework.NonXNA.Reflection.TypeHelper.SafelyExtractTypesFrom(assembly))
|
||||
foreach (Type type in ANX.Framework.NonXNA.Reflection.TypeHelper.SafelyExtractTypesFrom(assembly))
|
||||
{
|
||||
if (type == null)
|
||||
continue;
|
||||
@ -110,23 +110,20 @@ namespace ANX.Framework.Content.Pipeline.Tasks
|
||||
}
|
||||
|
||||
|
||||
public static String GuessImporterByFileExtension(string filename)
|
||||
public String GuessImporterByFileExtension(string filename)
|
||||
{
|
||||
String extension = System.IO.Path.GetExtension(filename);
|
||||
|
||||
foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
|
||||
foreach (var type in this.importerTypes.Values)
|
||||
{
|
||||
foreach (Type type in assembly.GetTypes())
|
||||
ContentImporterAttribute[] value = (ContentImporterAttribute[])type.GetCustomAttributes(typeof(ContentImporterAttribute), true);
|
||||
foreach (ContentImporterAttribute cia in value)
|
||||
{
|
||||
ContentImporterAttribute[] value = (ContentImporterAttribute[])type.GetCustomAttributes(typeof(ContentImporterAttribute), true);
|
||||
foreach (ContentImporterAttribute cia in value)
|
||||
foreach (string fe in cia.FileExtensions)
|
||||
{
|
||||
foreach (string fe in cia.FileExtensions)
|
||||
if (string.Equals(fe, extension, StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
if (string.Equals(fe, extension, StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
return type.Name;
|
||||
}
|
||||
return type.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -78,11 +78,13 @@ namespace ANX.Framework.Content.Pipeline.Tasks
|
||||
|
||||
public string GetProcessorDisplayName(string proccessorName)
|
||||
{
|
||||
var attribute = this.GetInstance(proccessorName).GetType().GetCustomAttributes(typeof(ContentProcessorAttribute), true).Cast<ContentProcessorAttribute>().FirstOrDefault();
|
||||
if (attribute != null && !string.IsNullOrEmpty(attribute.DisplayName))
|
||||
return attribute.DisplayName;
|
||||
else
|
||||
return proccessorName;
|
||||
if (this.processors.ContainsKey(proccessorName))
|
||||
{
|
||||
var attribute = this.GetInstance(proccessorName).GetType().GetCustomAttributes(typeof(ContentProcessorAttribute), true).Cast<ContentProcessorAttribute>().FirstOrDefault();
|
||||
if (attribute != null && !string.IsNullOrEmpty(attribute.DisplayName))
|
||||
return attribute.DisplayName;
|
||||
}
|
||||
return proccessorName;
|
||||
}
|
||||
|
||||
public String GetProcessorForType(Type inputType)
|
||||
|
@ -10,153 +10,153 @@ namespace ANX.Framework.Audio
|
||||
[PercentageComplete(5)]
|
||||
[Developer("AstrorEnales")]
|
||||
[TestState(TestStateAttribute.TestState.Untested)]
|
||||
public sealed class Cue : IDisposable
|
||||
{
|
||||
#region Events
|
||||
public event EventHandler<EventArgs> Disposing;
|
||||
#endregion
|
||||
public sealed class Cue : IDisposable
|
||||
{
|
||||
#region Events
|
||||
public event EventHandler<EventArgs> Disposing;
|
||||
#endregion
|
||||
|
||||
#region Public
|
||||
public bool IsCreated
|
||||
{
|
||||
get
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
#region Public
|
||||
public bool IsCreated
|
||||
{
|
||||
get
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsDisposed
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
public bool IsDisposed
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public bool IsPaused
|
||||
{
|
||||
get
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
public bool IsPaused
|
||||
{
|
||||
get
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsPlaying
|
||||
{
|
||||
get
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
public bool IsPlaying
|
||||
{
|
||||
get
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsPrepared
|
||||
{
|
||||
get
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
public bool IsPrepared
|
||||
{
|
||||
get
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsPreparing
|
||||
{
|
||||
get
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
public bool IsPreparing
|
||||
{
|
||||
get
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsStopped
|
||||
{
|
||||
get
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
public bool IsStopped
|
||||
{
|
||||
get
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsStopping
|
||||
{
|
||||
get
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
public bool IsStopping
|
||||
{
|
||||
get
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
internal Cue()
|
||||
{
|
||||
}
|
||||
#region Constructor
|
||||
internal Cue()
|
||||
{
|
||||
}
|
||||
|
||||
~Cue()
|
||||
{
|
||||
Dispose();
|
||||
}
|
||||
#endregion
|
||||
~Cue()
|
||||
{
|
||||
Dispose();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Apply3D
|
||||
public void Apply3D(AudioListener listener, AudioEmitter emitter)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
#endregion
|
||||
#region Apply3D
|
||||
public void Apply3D(AudioListener listener, AudioEmitter emitter)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region SetVariable
|
||||
public void SetVariable(string name, float value)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
#endregion
|
||||
#region SetVariable
|
||||
public void SetVariable(string name, float value)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region GetVariable
|
||||
public float GetVariable(string name)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
#endregion
|
||||
#region GetVariable
|
||||
public float GetVariable(string name)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Pause
|
||||
public void Pause()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
#endregion
|
||||
#region Pause
|
||||
public void Pause()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Play
|
||||
public void Play()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
#endregion
|
||||
#region Play
|
||||
public void Play()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Resume
|
||||
public void Resume()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
#endregion
|
||||
#region Resume
|
||||
public void Resume()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Stop
|
||||
public void Stop(AudioStopOptions options)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
#endregion
|
||||
#region Stop
|
||||
public void Stop(AudioStopOptions options)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Dispose
|
||||
public void Dispose()
|
||||
{
|
||||
if (IsDisposed == false)
|
||||
{
|
||||
IsDisposed = true;
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
#region Dispose
|
||||
public void Dispose()
|
||||
{
|
||||
if (IsDisposed == false)
|
||||
{
|
||||
IsDisposed = true;
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
@ -8,22 +8,22 @@ namespace ANX.Framework.Graphics.PackedVector
|
||||
[PercentageComplete(100)]
|
||||
[Developer("Glatzemann")]
|
||||
[TestState(TestStateAttribute.TestState.Tested)]
|
||||
public interface IPackedVector
|
||||
{
|
||||
void PackFromVector4(Vector4 vector);
|
||||
public interface IPackedVector
|
||||
{
|
||||
void PackFromVector4(Vector4 vector);
|
||||
|
||||
Vector4 ToVector4();
|
||||
}
|
||||
Vector4 ToVector4();
|
||||
}
|
||||
|
||||
[PercentageComplete(100)]
|
||||
[Developer("Glatzemann")]
|
||||
[TestState(TestStateAttribute.TestState.Tested)]
|
||||
public interface IPackedVector<TPacked> : IPackedVector
|
||||
{
|
||||
TPacked PackedValue
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
}
|
||||
public interface IPackedVector<TPacked> : IPackedVector
|
||||
{
|
||||
TPacked PackedValue
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,192 +17,192 @@ namespace ANX.Framework.Graphics
|
||||
[PercentageComplete(70)]
|
||||
[Developer("Glatzemann")]
|
||||
[TestState(TestStateAttribute.TestState.Untested)]
|
||||
public class Texture2D : Texture, IGraphicsResource
|
||||
{
|
||||
#region Private
|
||||
protected internal int width;
|
||||
protected internal int height;
|
||||
public class Texture2D : Texture, IGraphicsResource
|
||||
{
|
||||
#region Private
|
||||
protected internal int width;
|
||||
protected internal int height;
|
||||
|
||||
internal float OneOverWidth;
|
||||
internal float OneOverHeight;
|
||||
internal float OneOverWidth;
|
||||
internal float OneOverHeight;
|
||||
|
||||
private INativeTexture2D nativeTexture2D;
|
||||
private INativeTexture2D NativeTexture2D
|
||||
{
|
||||
get
|
||||
{
|
||||
if (nativeTexture2D == null)
|
||||
CreateNativeTextureSurface();
|
||||
private INativeTexture2D nativeTexture2D;
|
||||
private INativeTexture2D NativeTexture2D
|
||||
{
|
||||
get
|
||||
{
|
||||
if (nativeTexture2D == null)
|
||||
CreateNativeTextureSurface();
|
||||
|
||||
return nativeTexture2D;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
return nativeTexture2D;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Public
|
||||
public Rectangle Bounds
|
||||
{
|
||||
get
|
||||
{
|
||||
return new Rectangle(0, 0, this.width, this.height);
|
||||
}
|
||||
}
|
||||
#region Public
|
||||
public Rectangle Bounds
|
||||
{
|
||||
get
|
||||
{
|
||||
return new Rectangle(0, 0, this.width, this.height);
|
||||
}
|
||||
}
|
||||
|
||||
public int Width
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.width;
|
||||
}
|
||||
}
|
||||
public int Width
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.width;
|
||||
}
|
||||
}
|
||||
|
||||
public int Height
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.height;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
public int Height
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.height;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Constructor (TODO)
|
||||
internal Texture2D(GraphicsDevice graphicsDevice)
|
||||
: base(graphicsDevice)
|
||||
{
|
||||
}
|
||||
#region Constructor (TODO)
|
||||
internal Texture2D(GraphicsDevice graphicsDevice)
|
||||
: base(graphicsDevice)
|
||||
{
|
||||
}
|
||||
|
||||
public Texture2D(GraphicsDevice graphicsDevice, int width, int height)
|
||||
: base(graphicsDevice)
|
||||
{
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
OneOverWidth = 1f / width;
|
||||
OneOverHeight = 1f / height;
|
||||
public Texture2D(GraphicsDevice graphicsDevice, int width, int height)
|
||||
: base(graphicsDevice)
|
||||
{
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
OneOverWidth = 1f / width;
|
||||
OneOverHeight = 1f / height;
|
||||
|
||||
base.LevelCount = 1;
|
||||
base.Format = SurfaceFormat.Color;
|
||||
base.LevelCount = 1;
|
||||
base.Format = SurfaceFormat.Color;
|
||||
|
||||
CreateNativeTextureSurface();
|
||||
}
|
||||
CreateNativeTextureSurface();
|
||||
}
|
||||
|
||||
public Texture2D(GraphicsDevice graphicsDevice, int width, int height, [MarshalAsAttribute(UnmanagedType.U1)] bool mipMap,
|
||||
SurfaceFormat format)
|
||||
: base(graphicsDevice)
|
||||
{
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
OneOverWidth = 1f / width;
|
||||
OneOverHeight = 1f / height;
|
||||
public Texture2D(GraphicsDevice graphicsDevice, int width, int height, [MarshalAsAttribute(UnmanagedType.U1)] bool mipMap,
|
||||
SurfaceFormat format)
|
||||
: base(graphicsDevice)
|
||||
{
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
OneOverWidth = 1f / width;
|
||||
OneOverHeight = 1f / height;
|
||||
|
||||
// TODO: pass the mipmap parameter to the creation of the texture to let the graphics card generate mipmaps!
|
||||
base.LevelCount = 1;
|
||||
base.Format = format;
|
||||
// TODO: pass the mipmap parameter to the creation of the texture to let the graphics card generate mipmaps!
|
||||
base.LevelCount = 1;
|
||||
base.Format = format;
|
||||
|
||||
CreateNativeTextureSurface();
|
||||
}
|
||||
CreateNativeTextureSurface();
|
||||
}
|
||||
|
||||
internal Texture2D(GraphicsDevice graphicsDevice, int width, int height, int mipCount, SurfaceFormat format)
|
||||
: base(graphicsDevice)
|
||||
{
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
OneOverWidth = 1f / width;
|
||||
OneOverHeight = 1f / height;
|
||||
internal Texture2D(GraphicsDevice graphicsDevice, int width, int height, int mipCount, SurfaceFormat format)
|
||||
: base(graphicsDevice)
|
||||
{
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
OneOverWidth = 1f / width;
|
||||
OneOverHeight = 1f / height;
|
||||
|
||||
base.LevelCount = mipCount;
|
||||
base.Format = format;
|
||||
base.LevelCount = mipCount;
|
||||
base.Format = format;
|
||||
|
||||
CreateNativeTextureSurface();
|
||||
}
|
||||
#endregion
|
||||
CreateNativeTextureSurface();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region FromStream (TODO)
|
||||
public static Texture2D FromStream(GraphicsDevice graphicsDevice, Stream stream)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
#region FromStream (TODO)
|
||||
public static Texture2D FromStream(GraphicsDevice graphicsDevice, Stream stream)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public static Texture2D FromStream(GraphicsDevice graphicsDevice, Stream stream, int width, int height,
|
||||
[MarshalAsAttribute(UnmanagedType.U1)] bool zoom)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
#endregion
|
||||
public static Texture2D FromStream(GraphicsDevice graphicsDevice, Stream stream, int width, int height,
|
||||
[MarshalAsAttribute(UnmanagedType.U1)] bool zoom)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region GetData
|
||||
public void GetData<T>(int level, Nullable<Rectangle> rect, T[] data, int startIndex, int elementCount) where T : struct
|
||||
{
|
||||
NativeTexture2D.GetData(level, rect, data, startIndex, elementCount);
|
||||
}
|
||||
#region GetData
|
||||
public void GetData<T>(int level, Nullable<Rectangle> rect, T[] data, int startIndex, int elementCount) where T : struct
|
||||
{
|
||||
NativeTexture2D.GetData(level, rect, data, startIndex, elementCount);
|
||||
}
|
||||
|
||||
public void GetData<T>(T[] data) where T : struct
|
||||
{
|
||||
NativeTexture.GetData(data);
|
||||
}
|
||||
public void GetData<T>(T[] data) where T : struct
|
||||
{
|
||||
NativeTexture.GetData(data);
|
||||
}
|
||||
|
||||
public void GetData<T>(T[] data, int startIndex, int elementCount) where T : struct
|
||||
{
|
||||
NativeTexture.GetData(data, startIndex, elementCount);
|
||||
}
|
||||
#endregion
|
||||
public void GetData<T>(T[] data, int startIndex, int elementCount) where T : struct
|
||||
{
|
||||
NativeTexture.GetData(data, startIndex, elementCount);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region SetData
|
||||
public void SetData<T>(int level, Nullable<Rectangle> rect, T[] data, int startIndex, int elementCount) where T : struct
|
||||
{
|
||||
NativeTexture2D.SetData(level, rect, data, startIndex, elementCount);
|
||||
}
|
||||
#region SetData
|
||||
public void SetData<T>(int level, Nullable<Rectangle> rect, T[] data, int startIndex, int elementCount) where T : struct
|
||||
{
|
||||
NativeTexture2D.SetData(level, rect, data, startIndex, elementCount);
|
||||
}
|
||||
|
||||
public void SetData<T>(T[] data) where T : struct
|
||||
{
|
||||
NativeTexture.SetData<T>(GraphicsDevice, data);
|
||||
}
|
||||
public void SetData<T>(T[] data) where T : struct
|
||||
{
|
||||
NativeTexture.SetData<T>(GraphicsDevice, data);
|
||||
}
|
||||
|
||||
public void SetData<T>(T[] data, int startIndex, int elementCount) where T : struct
|
||||
{
|
||||
NativeTexture.SetData<T>(GraphicsDevice, data, startIndex, elementCount);
|
||||
}
|
||||
#endregion
|
||||
public void SetData<T>(T[] data, int startIndex, int elementCount) where T : struct
|
||||
{
|
||||
NativeTexture.SetData<T>(GraphicsDevice, data, startIndex, elementCount);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region SaveAsJpeg
|
||||
public void SaveAsJpeg(Stream stream, int width, int height)
|
||||
{
|
||||
NativeTexture2D.SaveAsJpeg(stream, width, height);
|
||||
}
|
||||
#endregion
|
||||
#region SaveAsJpeg
|
||||
public void SaveAsJpeg(Stream stream, int width, int height)
|
||||
{
|
||||
NativeTexture2D.SaveAsJpeg(stream, width, height);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region SaveAsPng
|
||||
public void SaveAsPng(Stream stream, int width, int height)
|
||||
{
|
||||
NativeTexture2D.SaveAsPng(stream, width, height);
|
||||
}
|
||||
#endregion
|
||||
#region SaveAsPng
|
||||
public void SaveAsPng(Stream stream, int width, int height)
|
||||
{
|
||||
NativeTexture2D.SaveAsPng(stream, width, height);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Dispose
|
||||
public override void Dispose()
|
||||
{
|
||||
base.Dispose(true);
|
||||
}
|
||||
#region Dispose
|
||||
public override void Dispose()
|
||||
{
|
||||
base.Dispose(true);
|
||||
}
|
||||
|
||||
protected override void Dispose([MarshalAs(UnmanagedType.U1)] bool disposeManaged)
|
||||
{
|
||||
base.Dispose(disposeManaged);
|
||||
}
|
||||
#endregion
|
||||
protected override void Dispose([MarshalAs(UnmanagedType.U1)] bool disposeManaged)
|
||||
{
|
||||
base.Dispose(disposeManaged);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ReCreateNativeTextureSurface
|
||||
internal override void ReCreateNativeTextureSurface()
|
||||
{
|
||||
CreateNativeTextureSurface();
|
||||
}
|
||||
#endregion
|
||||
#region ReCreateNativeTextureSurface
|
||||
internal override void ReCreateNativeTextureSurface()
|
||||
{
|
||||
CreateNativeTextureSurface();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region CreateNativeTextureSurface
|
||||
private void CreateNativeTextureSurface()
|
||||
{
|
||||
var creator = AddInSystemFactory.Instance.GetDefaultCreator<IRenderSystemCreator>();
|
||||
nativeTexture2D = creator.CreateTexture(GraphicsDevice, Format, width, height, LevelCount);
|
||||
base.nativeTexture = nativeTexture2D;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
#region CreateNativeTextureSurface
|
||||
private void CreateNativeTextureSurface()
|
||||
{
|
||||
var creator = AddInSystemFactory.Instance.GetDefaultCreator<IRenderSystemCreator>();
|
||||
nativeTexture2D = creator.CreateTexture(GraphicsDevice, Format, width, height, LevelCount);
|
||||
base.nativeTexture = nativeTexture2D;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
using System.Reflection;
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
@ -21,6 +22,7 @@ using System.Runtime.InteropServices;
|
||||
|
||||
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
|
||||
[assembly: Guid("67548701-e7e2-4c56-be3f-18c5fdf5c0fb")]
|
||||
[assembly: CLSCompliant(true)]
|
||||
|
||||
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
|
||||
//
|
||||
|
@ -2367,22 +2367,17 @@ Global
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Debug|iOS.Build.0 = Debug|iOS
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Debug|Linux.ActiveCfg = Debug|Linux
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Debug|Linux.Build.0 = Debug|Linux
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Debug|Mac OS.ActiveCfg = Debug|Mac OS
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Debug|Mac OS.Build.0 = Debug|Mac OS
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Debug|Mac OS.ActiveCfg = Debug|MacOs
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Debug|Mixed Platforms.ActiveCfg = Debug|Windows
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Debug|Mixed Platforms.Build.0 = Debug|Windows
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Debug|PS Vita.ActiveCfg = Debug|PS Vita
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Debug|PS Vita.Build.0 = Debug|PS Vita
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Debug|PS Vita.ActiveCfg = Debug|PsVita
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Debug|Windows.ActiveCfg = Debug|Windows
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Debug|Windows.Build.0 = Debug|Windows
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Debug|Windows Metro.ActiveCfg = Debug|Windows Metro
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Debug|Windows Metro.Build.0 = Debug|Windows Metro
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Debug|Windows Phone.ActiveCfg = Debug|Windows Phone
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Debug|Windows Phone.Build.0 = Debug|Windows Phone
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Debug|x64.ActiveCfg = Debug|Xbox 360
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Debug|x86.ActiveCfg = Debug|Xbox 360
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Debug|Xbox 360.ActiveCfg = Debug|Xbox 360
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Debug|Xbox 360.Build.0 = Debug|Xbox 360
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Debug|Windows Metro.ActiveCfg = Debug|WindowsPhone
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Debug|Windows Phone.ActiveCfg = Debug|WindowsPhone
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Debug|x64.ActiveCfg = Debug|XBox360
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Debug|x86.ActiveCfg = Debug|XBox360
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Debug|Xbox 360.ActiveCfg = Debug|XBox360
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Release|Android.ActiveCfg = Release|Android
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Release|Android.Build.0 = Release|Android
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Release|Any CPU.ActiveCfg = Release|Android
|
||||
@ -2391,22 +2386,17 @@ Global
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Release|iOS.Build.0 = Release|iOS
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Release|Linux.ActiveCfg = Release|Linux
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Release|Linux.Build.0 = Release|Linux
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Release|Mac OS.ActiveCfg = Release|Mac OS
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Release|Mac OS.Build.0 = Release|Mac OS
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Release|Mixed Platforms.ActiveCfg = Release|Xbox 360
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Release|Mixed Platforms.Build.0 = Release|Xbox 360
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Release|PS Vita.ActiveCfg = Release|PS Vita
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Release|PS Vita.Build.0 = Release|PS Vita
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Release|Mac OS.ActiveCfg = Release|MacOs
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Release|Mixed Platforms.ActiveCfg = Release|XBox360
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Release|Mixed Platforms.Build.0 = Release|XBox360
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Release|PS Vita.ActiveCfg = Release|PsVita
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Release|Windows.ActiveCfg = Release|Windows
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Release|Windows.Build.0 = Release|Windows
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Release|Windows Metro.ActiveCfg = Release|Windows Metro
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Release|Windows Metro.Build.0 = Release|Windows Metro
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Release|Windows Phone.ActiveCfg = Release|Windows Phone
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Release|Windows Phone.Build.0 = Release|Windows Phone
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Release|x64.ActiveCfg = Release|Xbox 360
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Release|x86.ActiveCfg = Release|Xbox 360
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Release|Xbox 360.ActiveCfg = Release|Xbox 360
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Release|Xbox 360.Build.0 = Release|Xbox 360
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Release|Windows Metro.ActiveCfg = Release|WindowsPhone
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Release|Windows Phone.ActiveCfg = Release|WindowsPhone
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Release|x64.ActiveCfg = Release|XBox360
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Release|x86.ActiveCfg = Release|XBox360
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Release|Xbox 360.ActiveCfg = Release|XBox360
|
||||
{8B0D9390-6F41-4CDB-810B-46A9EE3C3F1B}.Debug|Android.ActiveCfg = Debug|Any CPU
|
||||
{8B0D9390-6F41-4CDB-810B-46A9EE3C3F1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{8B0D9390-6F41-4CDB-810B-46A9EE3C3F1B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
|
@ -1,58 +1,36 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2012
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleContent", "SampleContent\SampleContent.contentproj", "{FA6E229D-4504-47B1-8A23-2D3FCC13F778}"
|
||||
EndProject
|
||||
# Visual Studio 2013
|
||||
VisualStudioVersion = 12.0.31101.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AlphaTestEffectSample", "AlphaTestEffectSample\AlphaTestEffectSample.csproj", "{0005BDAA-F232-45C3-8D37-7E4FF7A1F605}"
|
||||
EndProject
|
||||
Project("{75EFAE60-726E-430F-8661-4CF9ABD1306C}") = "SampleContent", "SampleContent\SampleContent.cproj", "{75EFAE60-726E-430F-8661-4CF9ABD1306C}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|Mixed Platforms = Debug|Mixed Platforms
|
||||
Debug|x86 = Debug|x86
|
||||
DebugWin8|Any CPU = DebugWin8|Any CPU
|
||||
DebugWin8|Mixed Platforms = DebugWin8|Mixed Platforms
|
||||
DebugWin8|x86 = DebugWin8|x86
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|Mixed Platforms = Release|Mixed Platforms
|
||||
Release|x86 = Release|x86
|
||||
ReleaseWin8|Any CPU = ReleaseWin8|Any CPU
|
||||
ReleaseWin8|Mixed Platforms = ReleaseWin8|Mixed Platforms
|
||||
ReleaseWin8|x86 = ReleaseWin8|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{FA6E229D-4504-47B1-8A23-2D3FCC13F778}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{FA6E229D-4504-47B1-8A23-2D3FCC13F778}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{FA6E229D-4504-47B1-8A23-2D3FCC13F778}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{FA6E229D-4504-47B1-8A23-2D3FCC13F778}.DebugWin8|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{FA6E229D-4504-47B1-8A23-2D3FCC13F778}.DebugWin8|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{FA6E229D-4504-47B1-8A23-2D3FCC13F778}.DebugWin8|x86.ActiveCfg = Debug|Any CPU
|
||||
{FA6E229D-4504-47B1-8A23-2D3FCC13F778}.Release|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{FA6E229D-4504-47B1-8A23-2D3FCC13F778}.Release|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{FA6E229D-4504-47B1-8A23-2D3FCC13F778}.Release|x86.ActiveCfg = Debug|Any CPU
|
||||
{FA6E229D-4504-47B1-8A23-2D3FCC13F778}.ReleaseWin8|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{FA6E229D-4504-47B1-8A23-2D3FCC13F778}.ReleaseWin8|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{FA6E229D-4504-47B1-8A23-2D3FCC13F778}.ReleaseWin8|x86.ActiveCfg = Debug|Any CPU
|
||||
{0005BDAA-F232-45C3-8D37-7E4FF7A1F605}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||
{0005BDAA-F232-45C3-8D37-7E4FF7A1F605}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
||||
{0005BDAA-F232-45C3-8D37-7E4FF7A1F605}.Debug|Mixed Platforms.Build.0 = Debug|x86
|
||||
{0005BDAA-F232-45C3-8D37-7E4FF7A1F605}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{0005BDAA-F232-45C3-8D37-7E4FF7A1F605}.Debug|x86.Build.0 = Debug|x86
|
||||
{0005BDAA-F232-45C3-8D37-7E4FF7A1F605}.DebugWin8|Any CPU.ActiveCfg = Debug|x86
|
||||
{0005BDAA-F232-45C3-8D37-7E4FF7A1F605}.DebugWin8|Mixed Platforms.ActiveCfg = Debug|x86
|
||||
{0005BDAA-F232-45C3-8D37-7E4FF7A1F605}.DebugWin8|Mixed Platforms.Build.0 = Debug|x86
|
||||
{0005BDAA-F232-45C3-8D37-7E4FF7A1F605}.DebugWin8|x86.ActiveCfg = Debug|x86
|
||||
{0005BDAA-F232-45C3-8D37-7E4FF7A1F605}.DebugWin8|x86.Build.0 = Debug|x86
|
||||
{0005BDAA-F232-45C3-8D37-7E4FF7A1F605}.Release|Any CPU.ActiveCfg = Release|x86
|
||||
{0005BDAA-F232-45C3-8D37-7E4FF7A1F605}.Release|Mixed Platforms.ActiveCfg = Release|x86
|
||||
{0005BDAA-F232-45C3-8D37-7E4FF7A1F605}.Release|Mixed Platforms.Build.0 = Release|x86
|
||||
{0005BDAA-F232-45C3-8D37-7E4FF7A1F605}.Release|x86.ActiveCfg = Release|x86
|
||||
{0005BDAA-F232-45C3-8D37-7E4FF7A1F605}.Release|x86.Build.0 = Release|x86
|
||||
{0005BDAA-F232-45C3-8D37-7E4FF7A1F605}.ReleaseWin8|Any CPU.ActiveCfg = Release|x86
|
||||
{0005BDAA-F232-45C3-8D37-7E4FF7A1F605}.ReleaseWin8|Mixed Platforms.ActiveCfg = Release|x86
|
||||
{0005BDAA-F232-45C3-8D37-7E4FF7A1F605}.ReleaseWin8|Mixed Platforms.Build.0 = Release|x86
|
||||
{0005BDAA-F232-45C3-8D37-7E4FF7A1F605}.ReleaseWin8|x86.ActiveCfg = Release|x86
|
||||
{0005BDAA-F232-45C3-8D37-7E4FF7A1F605}.ReleaseWin8|x86.Build.0 = Release|x86
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Debug|Any CPU.ActiveCfg = Debug|Windows
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Debug|Mixed Platforms.ActiveCfg = Debug|Windows
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Debug|Mixed Platforms.Build.0 = Debug|Windows
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Debug|x86.ActiveCfg = Debug|Windows
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Release|Any CPU.ActiveCfg = Release|Android
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Release|Mixed Platforms.ActiveCfg = Release|XBox 360
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Release|Mixed Platforms.Build.0 = Release|XBox 360
|
||||
{75EFAE60-726E-430F-8661-4CF9ABD1306C}.Release|x86.ActiveCfg = Release|XBox 360
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
@ -49,40 +49,38 @@
|
||||
<Content Include="GameThumbnail.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\ANX.Framework\ANX.Framework.csproj">
|
||||
<Project>{6899F0C9-70B9-4EB0-9DD3-E598D4BE3E35}</Project>
|
||||
<Name>ANX.Framework</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\InputSystems\ANX.InputDevices.Windows.XInput\ANX.InputDevices.Windows.XInput.csproj">
|
||||
<Project>{60D08399-244F-46A3-91F1-4CFD26D961A3}</Project>
|
||||
<Name>ANX.InputDevices.Windows.XInput</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\InputSystems\ANX.InputSystem.Standard\ANX.InputSystem.Standard.csproj">
|
||||
<Project>{49066074-3B7B-4A55-B122-6BD33AB73558}</Project>
|
||||
<Name>ANX.InputSystem.Standard</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\PlatformSystems\ANX.PlatformSystem.Windows\ANX.PlatformSystem.Windows.csproj">
|
||||
<Project>{068EB2E9-963C-4E1B-8831-E25011F11FFE}</Project>
|
||||
<Name>ANX.PlatformSystem.Windows</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\RenderSystems\ANX.Framework.GL3\ANX.RenderSystem.GL3.csproj">
|
||||
<Project>{EB8258E0-6741-4DB9-B756-1EBDF67B1ED6}</Project>
|
||||
<Name>ANX.RenderSystem.GL3</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\RenderSystems\ANX.RenderSystem.Windows.DX10\ANX.RenderSystem.Windows.DX10.csproj">
|
||||
<Project>{5BE49183-2F6F-4527-AC90-D816911FCF90}</Project>
|
||||
<Name>ANX.RenderSystem.Windows.DX10</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\RenderSystems\ANX.RenderSystem.Windows.DX11\ANX.RenderSystem.Windows.DX11.csproj">
|
||||
<Project>{B30DE9C2-0926-46B6-8351-9AF276C472D5}</Project>
|
||||
<Name>ANX.RenderSystem.Windows.DX11</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\SoundSystems\ANX.SoundSystem.Windows.XAudio\ANX.SoundSystem.Windows.XAudio.csproj">
|
||||
<Project>{6A582788-C4D2-410C-96CD-177F75712D65}</Project>
|
||||
<Name>ANX.SoundSystem.Windows.XAudio</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="ANX.Framework, Version=0.6.0.39776, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\bin\Debug\ANX.Framework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ANX.InputDevices.Windows.XInput, Version=0.6.5.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\bin\Debug\ANX.InputDevices.Windows.XInput.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ANX.InputSystem.Standard, Version=0.5.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\bin\Debug\ANX.InputSystem.Standard.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ANX.PlatformSystem.Windows, Version=0.75.1.30844, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\bin\Debug\ANX.PlatformSystem.Windows.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ANX.RenderSystem.GL3, Version=0.5.16.30887, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\bin\Debug\ANX.RenderSystem.GL3.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ANX.RenderSystem.Windows.DX10, Version=0.7.28.30888, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\bin\Debug\ANX.RenderSystem.Windows.DX10.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ANX.RenderSystem.Windows.DX11, Version=0.7.19.30887, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\bin\Debug\ANX.RenderSystem.Windows.DX11.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ANX.SoundSystem.Windows.XAudio, Version=0.4.2.30844, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\bin\Debug\ANX.SoundSystem.Windows.XAudio.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
|
@ -5,7 +5,7 @@ Framework Inhalts-Pipeline gelesen. Befolgen Sie die Kommentare zur Anpassung de
|
||||
der Schriftart in Ihrem Spiel und zum Ändern der Zeichen, die für das Zeichnen verfügbar
|
||||
sind.
|
||||
-->
|
||||
<XnaContent xmlns:Graphics="Microsoft.Xna.Framework.Content.Pipeline.Graphics">
|
||||
<AnxContent xmlns:Graphics="ANX.Framework.Content.Pipeline.Graphics">
|
||||
<Asset Type="Graphics:FontDescription">
|
||||
|
||||
<!--
|
||||
@ -57,4 +57,4 @@ sind.
|
||||
</CharacterRegion>
|
||||
</CharacterRegions>
|
||||
</Asset>
|
||||
</XnaContent>
|
||||
</AnxContent>
|
||||
|
@ -92,15 +92,15 @@
|
||||
<OutputPath>bin\Xbox 360\Release</OutputPath>
|
||||
<CompressContent>false</CompressContent>
|
||||
</Configuration>
|
||||
<Configuration Name="Debug" Platform="0">
|
||||
<Profile>Reach</Profile>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<CompressContent>false</CompressContent>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
<ProjectReference Include="..\..\ANX.Framework.Content.Pipeline.Assimp\ANX.Framework.Content.Pipeline.Assimp.csproj" Guid="{8b0d9390-6f41-4cdb-810b-46a9ee3c3f1b}" Name="ANX.Framework.Content.Pipeline.Assimp">../../bin/Debug/ANX.Framework.Content.Pipeline.Assimp.dll</ProjectReference>
|
||||
<ProjectReference Include="..\..\ANX.Framework.ContentPipeline\ANX.Framework.ContentPipeline.Extensions.csproj" Guid="{ecbf60cb-1cf0-4f92-8963-e73115b04b43}" Name="ANX.Framework.ContentPipeline.Extensions">../../bin/Debug/ANX.Framework.ContentPipeline.dll</ProjectReference>
|
||||
<AssemblyReference Name="ANX.Framework.Content.Pipeline.Assimp">C:\Users\Konstantin\Documents\Visual Studio 2013\Projects\anx.framework\bin\Debug\ANX.Framework.Content.Pipeline.Assimp.dll</AssemblyReference>
|
||||
<AssemblyReference Name="ANX.Framework.ContentPipeline">C:\Users\Konstantin\Documents\Visual Studio 2013\Projects\anx.framework\bin\Debug\ANX.Framework.ContentPipeline.dll</AssemblyReference>
|
||||
<AssemblyReference Name="ANX.InputSystem.Standard">C:\Users\Konstantin\Documents\Visual Studio 2013\Projects\anx.framework\bin\Debug\ANX.InputSystem.Standard.dll</AssemblyReference>
|
||||
<AssemblyReference Name="ANX.PlatformSystem.Windows">C:\Users\Konstantin\Documents\Visual Studio 2013\Projects\anx.framework\bin\Debug\ANX.PlatformSystem.Windows.dll</AssemblyReference>
|
||||
<AssemblyReference Name="ANX.RenderSystem.Windows.DX10">C:\Users\Konstantin\Documents\Visual Studio 2013\Projects\anx.framework\bin\Debug\ANX.RenderSystem.Windows.DX10.dll</AssemblyReference>
|
||||
<AssemblyReference Name="ANX.RenderSystem.Windows.DX11">C:\Users\Konstantin\Documents\Visual Studio 2013\Projects\anx.framework\bin\Debug\ANX.RenderSystem.Windows.DX11.dll</AssemblyReference>
|
||||
<AssemblyReference Name="AssimpNet">C:\Users\Konstantin\Documents\Visual Studio 2013\Projects\anx.framework\bin\Debug\AssimpNet.dll</AssemblyReference>
|
||||
</References>
|
||||
<BuildItems>
|
||||
<BuildItem AssetName="HardwareInstancing" Importer="EffectImporter" Processor="EffectProcessor">
|
||||
@ -123,19 +123,19 @@
|
||||
<SourceFile>Fonts\Debug.spritefont</SourceFile>
|
||||
<ProcessorParams />
|
||||
</BuildItem>
|
||||
<BuildItem AssetName="ANX_vertex_color" Importer="" Processor="">
|
||||
<BuildItem AssetName="ANX_vertex_color" Importer="AssimpImporter" Processor="ModelProcessor">
|
||||
<SourceFile>Models\ANX_vertex_color.fbx</SourceFile>
|
||||
<ProcessorParams />
|
||||
</BuildItem>
|
||||
<BuildItem AssetName="Cube" Importer="" Processor="">
|
||||
<BuildItem AssetName="Cube" Importer="AssimpImporter" Processor="ModelProcessor">
|
||||
<SourceFile>Models\Cube.fbx</SourceFile>
|
||||
<ProcessorParams />
|
||||
</BuildItem>
|
||||
<BuildItem AssetName="Sphere" Importer="" Processor="">
|
||||
<BuildItem AssetName="Sphere" Importer="AssimpImporter" Processor="ModelProcessor">
|
||||
<SourceFile>Models\Sphere.fbx</SourceFile>
|
||||
<ProcessorParams />
|
||||
</BuildItem>
|
||||
<BuildItem AssetName="SphereAndCube" Importer="" Processor="">
|
||||
<BuildItem AssetName="SphereAndCube" Importer="AssimpImporter" Processor="ModelProcessor">
|
||||
<SourceFile>Models\SphereAndCube.fbx</SourceFile>
|
||||
<ProcessorParams />
|
||||
</BuildItem>
|
||||
@ -143,7 +143,7 @@
|
||||
<SourceFile>Models\TestGrid1024.png</SourceFile>
|
||||
<ProcessorParams />
|
||||
</BuildItem>
|
||||
<BuildItem AssetName="TwoCubes" Importer="" Processor="">
|
||||
<BuildItem AssetName="TwoCubes" Importer="AssimpImporter" Processor="ModelProcessor">
|
||||
<SourceFile>Models\TwoCubes.fbx</SourceFile>
|
||||
<ProcessorParams />
|
||||
</BuildItem>
|
||||
@ -167,7 +167,7 @@
|
||||
<SourceFile>Textures\chest.png</SourceFile>
|
||||
<ProcessorParams />
|
||||
</BuildItem>
|
||||
<BuildItem AssetName="dds-test" Importer="" Processor="">
|
||||
<BuildItem AssetName="dds-test" Importer="TextureImporter" Processor="TextureProcessor">
|
||||
<SourceFile>Textures\dds-test.dds</SourceFile>
|
||||
<ProcessorParams />
|
||||
</BuildItem>
|
||||
|
@ -235,8 +235,7 @@ namespace ContentBuilder
|
||||
|
||||
if (string.IsNullOrWhiteSpace(intermediateDirectory))
|
||||
{
|
||||
intermediateDirectory = new string(config.Name.Select((x) => !Path.GetInvalidPathChars().Contains(x) ? x : '_').ToArray());
|
||||
intermediateDirectory = Path.Combine(Path.GetDirectoryName(projectFile), "obj", intermediateDirectory);
|
||||
intermediateDirectory = Path.Combine(Path.GetDirectoryName(projectFile), "obj", CreateSafeFileName(config.Platform.ToDisplayName()), CreateSafeFileName(config.Name));
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -285,11 +284,11 @@ namespace ContentBuilder
|
||||
{
|
||||
if (string.IsNullOrEmpty(x.ImporterName))
|
||||
{
|
||||
x.ImporterName = ImporterManager.GuessImporterByFileExtension(x.SourceFilename);
|
||||
x.ImporterName = buildContentTask.ImporterManager.GuessImporterByFileExtension(x.SourceFilename);
|
||||
buildContentTask.BuildLogger.LogMessage(string.Format(Resources.MissedImporterUsingDefault, x.AssetName, x.ImporterName));
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(x.ProcessorName))
|
||||
if (string.IsNullOrEmpty(x.ProcessorName) && !string.IsNullOrEmpty(x.ImporterName))
|
||||
{
|
||||
x.ProcessorName = buildContentTask.ImporterManager.GetDefaultProcessor(x.ImporterName);
|
||||
buildContentTask.BuildLogger.LogMessage(string.Format(Resources.MissedProcessorUsingDefault, x.AssetName, x.ProcessorName));
|
||||
@ -523,6 +522,14 @@ namespace ContentBuilder
|
||||
intermediateDirectoryUri = new Uri(intermediateDirectory, UriKind.Absolute);
|
||||
}
|
||||
|
||||
private static string CreateSafeFileName(string text)
|
||||
{
|
||||
foreach (var invalidChar in Path.GetInvalidFileNameChars())
|
||||
text = text.Replace(invalidChar, '_');
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
static Uri anxFrameworkPath;
|
||||
|
||||
public static Uri GetAnxFrameworkPath()
|
||||
|
4
Tools/ContentBuilder/Resources.Designer.cs
generated
4
Tools/ContentBuilder/Resources.Designer.cs
generated
@ -1,7 +1,7 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Dieser Code wurde von einem Tool generiert.
|
||||
// Laufzeitversion:4.0.30319.34011
|
||||
// Laufzeitversion:4.0.30319.34014
|
||||
//
|
||||
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
// der Code erneut generiert wird.
|
||||
@ -106,7 +106,7 @@ namespace ContentBuilder {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die "{0}" missed a content processor, using "{2}". ähnelt.
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die "{0}" missed a content processor, using "{1}". ähnelt.
|
||||
/// </summary>
|
||||
internal static string MissedProcessorUsingDefault {
|
||||
get {
|
||||
|
@ -133,7 +133,7 @@
|
||||
<value>"{0}" missed a content importer, using "{1}".</value>
|
||||
</data>
|
||||
<data name="MissedProcessorUsingDefault" xml:space="preserve">
|
||||
<value>"{0}" missed a content processor, using "{2}".</value>
|
||||
<value>"{0}" missed a content processor, using "{1}".</value>
|
||||
</data>
|
||||
<data name="NoItemsSpecified" xml:space="preserve">
|
||||
<value>No items specified. Closing application.</value>
|
||||
|
@ -332,7 +332,12 @@ namespace ANX.Framework.Build
|
||||
|
||||
public string GuessImporterByFileExtension(string fileName)
|
||||
{
|
||||
return ImporterManager.GuessImporterByFileExtension(fileName);
|
||||
if (importerManager == null)
|
||||
{
|
||||
importerManager = new ImporterManager();
|
||||
}
|
||||
|
||||
return importerManager.GuessImporterByFileExtension(fileName);
|
||||
}
|
||||
|
||||
public string GetDefaultProcessorForImporter(string importer)
|
||||
@ -495,8 +500,7 @@ namespace ANX.Framework.Build
|
||||
|
||||
task.BuildCache = buildCache;
|
||||
|
||||
string intermediateDirectory = new string(activeConfiguration.Name.Select((x) => !Path.GetInvalidPathChars().Contains(x) ? x : '_').ToArray());
|
||||
intermediateDirectory = Path.Combine(projectHome, "obj", intermediateDirectory) + Path.DirectorySeparatorChar;
|
||||
string intermediateDirectory = Path.Combine(projectHome, "obj", CreateSafeFileName(activeConfiguration.Platform.ToDisplayName()), CreateSafeFileName(activeConfiguration.Name)) + Path.DirectorySeparatorChar;
|
||||
|
||||
var buildCacheUri = new Uri(new Uri(intermediateDirectory, UriKind.Absolute), new Uri("build.cache", UriKind.Relative));
|
||||
|
||||
@ -517,6 +521,14 @@ namespace ANX.Framework.Build
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private string CreateSafeFileName(string text)
|
||||
{
|
||||
foreach (var unsafeChar in Path.GetInvalidFileNameChars())
|
||||
text = text.Replace(unsafeChar, '_');
|
||||
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
||||
//pretty much the same as if one would use lock(appDomain) but as a public api.
|
||||
|
@ -186,7 +186,7 @@ namespace ANX.Framework.VisualStudio
|
||||
var activeContentConfig = this.config.ProjectMgr.ActiveContentConfiguration;
|
||||
|
||||
IVsCfg cfg;
|
||||
ErrorHandler.ThrowOnFailure(this.config.ProjectMgr.ConfigProvider.GetCfgOfName(activeContentConfig.Name, activeContentConfig.Platform.ToString(), out cfg));
|
||||
ErrorHandler.ThrowOnFailure(this.config.ProjectMgr.ConfigProvider.GetCfgOfName(activeContentConfig.Name, activeContentConfig.Platform.ToDisplayName(), out cfg));
|
||||
Config activeConfig = (Config)cfg;
|
||||
|
||||
if (config.ProjectMgr.PendingBuild != null && config.ProjectMgr.PendingBuild.IsFileBuild)
|
||||
|
@ -72,7 +72,7 @@ namespace ANX.Framework.VisualStudio
|
||||
/// <returns>If the method succeeds, it returns S_OK. If it fails, it returns an error code.</returns>
|
||||
public override int GetSupportedPlatformNames(uint celt, string[] names, uint[] actual)
|
||||
{
|
||||
return GetPlatforms(celt, names, actual, contentProjectNode.ContentProject.Configurations.GetUniquePlatforms().Select((x) => x.ToString()).ToArray());
|
||||
return GetPlatforms(celt, names, actual, GetPlatformNames());
|
||||
}
|
||||
|
||||
protected override Config GetProjectConfiguration(string configName, string platformName)
|
||||
@ -261,10 +261,5 @@ namespace ANX.Framework.VisualStudio
|
||||
|
||||
return VSConstants.S_OK;
|
||||
}
|
||||
|
||||
public override IEnumerator<Config> GetEnumerator()
|
||||
{
|
||||
return this.configurationsList.GetEnumerator();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -191,11 +191,12 @@ namespace ANX.Framework.VisualStudio.Nodes
|
||||
{
|
||||
get
|
||||
{
|
||||
var activeConfig = ((OAProject)this.GetAutomationObject()).ConfigurationManager.ActiveConfiguration;
|
||||
|
||||
var config = this.ConfigProvider.FirstOrDefault((x) => x.ConfigName == activeConfig.ConfigurationName && x.PlatformName == activeConfig.PlatformName) as ContentConfig;
|
||||
var activeConfig = this.GetProjectProperty(ProjectFileConstants.Configuration);
|
||||
var activePlatform = this.GetProjectProperty(ProjectFileConstants.Platform);
|
||||
|
||||
var config = this.ConfigProvider.FirstOrDefault((x) => x.ConfigName == activeConfig && x.PlatformName == activePlatform) as ContentConfig;
|
||||
if (config == null)
|
||||
throw new KeyNotFoundException(string.Format("Error when searching for configuration with name \"{0}\" and platform \"{1}\".", activeConfig.ConfigurationName, activeConfig.PlatformName));
|
||||
throw new KeyNotFoundException(string.Format("Error when searching for configuration with name \"{0}\" and platform \"{1}\".", activeConfig, activePlatform));
|
||||
|
||||
return config.Configuration;
|
||||
}
|
||||
|
@ -18,6 +18,8 @@ namespace ANX.Framework.VisualStudio
|
||||
{
|
||||
private static EnvDTE.DTE _dte;
|
||||
|
||||
private static Dictionary<string, TargetPlatform> _displayNames;
|
||||
|
||||
public static void Initialize(EnvDTE.DTE dte)
|
||||
{
|
||||
if (dte == null)
|
||||
@ -55,59 +57,49 @@ namespace ANX.Framework.VisualStudio
|
||||
return null;
|
||||
}
|
||||
|
||||
private static void InitializeTargetPlatforms()
|
||||
{
|
||||
if (_displayNames == null)
|
||||
{
|
||||
_displayNames = new Dictionary<string, TargetPlatform>();
|
||||
foreach (var enumValue in typeof(TargetPlatform).GetEnumValues())
|
||||
{
|
||||
var enumInstance = (TargetPlatform)Enum.ToObject(typeof(TargetPlatform), enumValue);
|
||||
_displayNames.Add(enumInstance.ToDisplayName(), enumInstance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static TargetPlatform ParseTargetPlatform(string displayName)
|
||||
{
|
||||
string[] names = Enum.GetNames(typeof(TargetPlatform));
|
||||
for (int i = 0; i < names.Length; i++)
|
||||
{
|
||||
if (displayName == names[i])
|
||||
return (TargetPlatform)Enum.Parse(typeof(TargetPlatform), names[i]);
|
||||
InitializeTargetPlatforms();
|
||||
|
||||
TargetPlatform targetPlatform;
|
||||
if (_displayNames.TryGetValue(displayName, out targetPlatform))
|
||||
return targetPlatform;
|
||||
|
||||
var attribute = typeof(TargetPlatform).GetMember(names[i]).FirstOrDefault().GetCustomAttribute<DescriptionAttribute>(false);
|
||||
if (attribute != null && displayName == attribute.Description)
|
||||
return (TargetPlatform)Enum.Parse(typeof(TargetPlatform), names[i]);
|
||||
}
|
||||
return default(TargetPlatform);
|
||||
}
|
||||
|
||||
public static string[] GetTargetPlatformDisplayNames()
|
||||
{
|
||||
string[] names = Enum.GetNames(typeof(TargetPlatform));
|
||||
string[] displayNames = new string[names.Length];
|
||||
for (int i = 0; i < names.Length; i++)
|
||||
{
|
||||
var attribute = typeof(TargetPlatform).GetMember(names[i]).FirstOrDefault().GetCustomAttribute<DescriptionAttribute>(false);
|
||||
if (attribute != null)
|
||||
displayNames[i] = attribute.Description;
|
||||
else
|
||||
displayNames[i] = names[i];
|
||||
}
|
||||
InitializeTargetPlatforms();
|
||||
|
||||
return displayNames;
|
||||
return _displayNames.Keys.ToArray();
|
||||
}
|
||||
|
||||
public static string GetDisplayName(TargetPlatform platform)
|
||||
{
|
||||
string name = Enum.GetName(typeof(TargetPlatform), platform);
|
||||
if (string.IsNullOrEmpty(name))
|
||||
return name;
|
||||
|
||||
var attribute = typeof(TargetPlatform).GetMember(name).FirstOrDefault().GetCustomAttribute<DescriptionAttribute>(false);
|
||||
if (attribute != null)
|
||||
return attribute.Description;
|
||||
else
|
||||
return name;
|
||||
return platform.ToDisplayName();
|
||||
}
|
||||
|
||||
public static string GetTargetPlatformName(string displayName)
|
||||
{
|
||||
string[] names = Enum.GetNames(typeof(TargetPlatform));
|
||||
for (int i = 0; i < names.Length; i++)
|
||||
{
|
||||
var attribute = typeof(TargetPlatform).GetMember(names[i]).FirstOrDefault().GetCustomAttribute<DescriptionAttribute>(false);
|
||||
if (attribute != null && displayName == attribute.Description)
|
||||
return names[i];
|
||||
}
|
||||
InitializeTargetPlatforms();
|
||||
|
||||
TargetPlatform targetPlatform;
|
||||
if (_displayNames.TryGetValue(displayName, out targetPlatform))
|
||||
return targetPlatform.ToString();
|
||||
|
||||
return displayName;
|
||||
}
|
||||
|
@ -595,11 +595,21 @@ namespace Microsoft.VisualStudio.Project
|
||||
return (configurations == null) ? new string[] { } : configurations.ToArray();
|
||||
}
|
||||
|
||||
public virtual IEnumerator<Config> GetEnumerator()
|
||||
public IEnumerator<Config> GetEnumerator()
|
||||
{
|
||||
foreach (var value in this.configurationsList.Values)
|
||||
uint[] elementsCountHolder = new uint[1] { 0 };
|
||||
if (this.GetCfgs(0, null, elementsCountHolder, null) == VSConstants.S_OK)
|
||||
{
|
||||
yield return value;
|
||||
var elementsCount = elementsCountHolder[0];
|
||||
IVsCfg[] configs = new IVsCfg[elementsCount];
|
||||
|
||||
if (this.GetCfgs(elementsCount, configs, null, null) == VSConstants.S_OK)
|
||||
{
|
||||
foreach (Config config in configs)
|
||||
{
|
||||
yield return config;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user