diff --git a/ANX.Framework.Content.Pipeline/ANX.Framework.Content.Pipeline.csproj b/ANX.Framework.Content.Pipeline/ANX.Framework.Content.Pipeline.csproj index ed440d92..2b030833 100644 --- a/ANX.Framework.Content.Pipeline/ANX.Framework.Content.Pipeline.csproj +++ b/ANX.Framework.Content.Pipeline/ANX.Framework.Content.Pipeline.csproj @@ -109,6 +109,8 @@ + + @@ -139,6 +141,7 @@ + diff --git a/ANX.Framework.Content.Pipeline/AnxContentImporterContext.cs b/ANX.Framework.Content.Pipeline/AnxContentImporterContext.cs index 9267d553..58396d21 100644 --- a/ANX.Framework.Content.Pipeline/AnxContentImporterContext.cs +++ b/ANX.Framework.Content.Pipeline/AnxContentImporterContext.cs @@ -21,10 +21,23 @@ namespace ANX.Framework.Content.Pipeline public AnxContentImporterContext(BuildContent buildContent, BuildItem buildItem, ContentBuildLogger logger) { - + BuildContent = buildContent; + BuildItem = buildItem; this.logger = logger; } + public BuildContent BuildContent + { + get; + set; + } + + public BuildItem BuildItem + { + get; + set; + } + public override string IntermediateDirectory { get diff --git a/ANX.Framework.Content.Pipeline/AnxContentProcessorContext.cs b/ANX.Framework.Content.Pipeline/AnxContentProcessorContext.cs index 5f57d719..e98458af 100644 --- a/ANX.Framework.Content.Pipeline/AnxContentProcessorContext.cs +++ b/ANX.Framework.Content.Pipeline/AnxContentProcessorContext.cs @@ -4,6 +4,8 @@ using System.Collections.Generic; using System.Linq; using System.Text; using ANX.Framework.Graphics; +using ANX.Framework.Content.Pipeline.Tasks; +using System.IO; #endregion @@ -24,6 +26,23 @@ namespace ANX.Framework.Content.Pipeline private TargetPlatform targetPlatform; private GraphicsProfile targetProfile; + //public AnxContentProcessorContext(BuildCoordinator buildCoordinator, BuildItem buildItem, ContentBuildLogger logger, TargetPlatform targetPlatform, GraphicsProfile targetProfile, string buildConfiguration) + public AnxContentProcessorContext(BuildItem buildItem, ContentBuildLogger logger, TargetPlatform targetPlatform, GraphicsProfile targetProfile, string buildConfiguration) + { + BuildItem = buildItem; + this.contentBuildLogger = logger; + this.targetPlatform = targetPlatform; + this.targetProfile = targetProfile; + this.buildConfiguration = buildConfiguration; + this.intermediateDirectory = Path.GetTempPath(); + } + + public BuildItem BuildItem + { + get; + set; + } + public override string BuildConfiguration { get @@ -50,9 +69,13 @@ namespace ANX.Framework.Content.Pipeline public override string OutputDirectory { - get - { - return outputDirectory; + get + { + return outputDirectory; + } + internal set + { + outputDirectory = value; } } @@ -62,6 +85,10 @@ namespace ANX.Framework.Content.Pipeline { return outputFilename; } + internal set + { + outputFilename = value; + } } public override OpaqueDataDictionary Parameters diff --git a/ANX.Framework.Content.Pipeline/ContentBuildLogger.cs b/ANX.Framework.Content.Pipeline/ContentBuildLogger.cs index 9c139fbb..4ac49261 100644 --- a/ANX.Framework.Content.Pipeline/ContentBuildLogger.cs +++ b/ANX.Framework.Content.Pipeline/ContentBuildLogger.cs @@ -14,9 +14,10 @@ namespace ANX.Framework.Content.Pipeline { public abstract class ContentBuildLogger { + private Stack files = new Stack(); + protected ContentBuildLogger() { - throw new NotImplementedException(); } public abstract void LogImportantMessage(string message, params Object[] messageArgs); @@ -25,12 +26,12 @@ namespace ANX.Framework.Content.Pipeline public void PopFile() { - throw new NotImplementedException(); + files.Pop(); } public void PushFile(string filename) { - throw new NotImplementedException(); + files.Push(filename); } protected string GetCurrentFilename(ContentIdentity contentIdentity) diff --git a/ANX.Framework.Content.Pipeline/ContentProcessorContext.cs b/ANX.Framework.Content.Pipeline/ContentProcessorContext.cs index 546ba240..4be805dd 100644 --- a/ANX.Framework.Content.Pipeline/ContentProcessorContext.cs +++ b/ANX.Framework.Content.Pipeline/ContentProcessorContext.cs @@ -22,8 +22,8 @@ namespace ANX.Framework.Content.Pipeline public abstract string BuildConfiguration { get; } public abstract string IntermediateDirectory { get; } public abstract ContentBuildLogger Logger { get; } - public abstract string OutputDirectory { get; } - public abstract string OutputFilename { get; } + public abstract string OutputDirectory { get; internal set; } + public abstract string OutputFilename { get; internal set; } public abstract OpaqueDataDictionary Parameters { get; } public abstract TargetPlatform TargetPlatform { get; } public abstract GraphicsProfile TargetProfile { get; } diff --git a/ANX.Framework.Content.Pipeline/Processors/EffectProcessor.cs b/ANX.Framework.Content.Pipeline/Processors/EffectProcessor.cs index 748440d1..cc349d59 100644 --- a/ANX.Framework.Content.Pipeline/Processors/EffectProcessor.cs +++ b/ANX.Framework.Content.Pipeline/Processors/EffectProcessor.cs @@ -4,6 +4,8 @@ using System.Collections.Generic; using System.Linq; using System.Text; using ANX.Framework.Content.Pipeline.Graphics; +using System.IO; +using System.ComponentModel; #endregion @@ -16,6 +18,9 @@ namespace ANX.Framework.Content.Pipeline.Processors [ContentProcessor] public class EffectProcessor : ContentProcessor { + HLSLCompilerFactory hlslCompilerFactory = new HLSLCompilerFactory(); + private string targetProfile = "fx_4_0"; + public virtual EffectProcessorDebugMode DebugMode { get; @@ -28,9 +33,24 @@ namespace ANX.Framework.Content.Pipeline.Processors set; } + [DefaultValue("fx_4_0")] + public virtual string TargetProfile + { + get + { + return targetProfile; + } + set + { + targetProfile = value; + } + } + public override CompiledEffectContent Process(EffectContent input, ContentProcessorContext context) { - byte[] effectCompiledCode = new byte[1]; //TODO: compile effect!!! + HLSLCompiler compiler = hlslCompilerFactory.Compilers.Last(); + + byte[] effectCompiledCode = compiler.Compile(input.EffectCode, DebugMode, TargetProfile); return new CompiledEffectContent(effectCompiledCode) { @@ -39,5 +59,7 @@ namespace ANX.Framework.Content.Pipeline.Processors OpaqueData = input.OpaqueData }; } + + } } diff --git a/ANX.Framework.Content.Pipeline/Processors/HLSLCompiler.cs b/ANX.Framework.Content.Pipeline/Processors/HLSLCompiler.cs new file mode 100644 index 00000000..b4e89866 --- /dev/null +++ b/ANX.Framework.Content.Pipeline/Processors/HLSLCompiler.cs @@ -0,0 +1,192 @@ +#region Using Statements +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +using System.Diagnostics; +using System.IO; + +#endregion + +namespace ANX.Framework.Content.Pipeline.Processors +{ + public class HLSLCompiler : IComparable, IEquatable + { + private string executable; + private string version; + private string helpOutput; + private string[] profiles; + + public HLSLCompiler(string executable) + { + if (!String.IsNullOrEmpty(executable) && File.Exists(executable)) + { + this.executable = executable; + } + else + { + throw new ArgumentNullException("executable", "fxc.exe does not exist"); + } + } + + public string Version + { + get + { + if (String.IsNullOrEmpty(version)) + { + version = CompilerVersion; + } + + return version; + } + } + + public IEnumerable SupportedProfiles + { + get + { + if (profiles == null || profiles.Length <= 0) + { + const string profileStart = @"(cs|ds|fx|ps|hs|gs|vs|tx)(_)(\S+)\s?"; + + Regex pattern = new Regex(profileStart, RegexOptions.Singleline | RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + MatchCollection m = pattern.Matches(CompilerHelpOutput); + + HashSet tempProfiles = new HashSet(); + foreach (Match profileMatch in m) + { + tempProfiles.Add(profileMatch.Value.Trim()); + } + + profiles = tempProfiles.ToArray(); + } + + return profiles; + } + } + + public byte[] Compile(string source, EffectProcessorDebugMode debugMode, string targetProfile) + { + string tempInputFile = CreateTemporaryShaderFile(source); + string tempOutputFile = Path.GetTempFileName(); + byte[] byteCode; + + ProcessStartInfo startInfo = new ProcessStartInfo + { + FileName = executable, + Arguments = String.Format("{0} {1} {2} {3}", "/Fo " + tempOutputFile, GetCompilerTargetProfile(targetProfile), GetCompilerDebugFlags(debugMode), tempInputFile), + UseShellExecute = false, + RedirectStandardOutput = true, + CreateNoWindow = true + }; + + using (var proc = Process.Start(startInfo)) + { + helpOutput = proc.StandardOutput.ReadToEnd(); + } + + byteCode = File.ReadAllBytes(tempOutputFile); + + if (File.Exists(tempInputFile)) + { + File.Delete(tempInputFile); + } + + if (File.Exists(tempOutputFile)) + { + File.Delete(tempOutputFile); + } + + return byteCode; + } + + public int CompareTo(HLSLCompiler other) + { + return Version.CompareTo(other.Version); + } + + public bool Equals(HLSLCompiler other) + { + return String.Equals(Version, other.Version, StringComparison.InvariantCultureIgnoreCase); + } + + public override int GetHashCode() + { + return Version.GetHashCode(); + } + + private string GetCompilerDebugFlags(EffectProcessorDebugMode debugMode) + { + if ((debugMode == EffectProcessorDebugMode.Auto && System.Diagnostics.Debugger.IsAttached) || debugMode == EffectProcessorDebugMode.Debug) + { + return "/Od /Op /Zi"; + } + else + { + return "/O3 /Qstrip_debug"; + } + } + + private string GetCompilerTargetProfile(string targetProfile) + { + foreach (string profile in SupportedProfiles) + { + if (string.Equals(profile, targetProfile, StringComparison.InvariantCultureIgnoreCase)) + { + return String.Format("/T {0}", targetProfile); + } + } + + throw new Exception(String.Format("fxc.exe version {0} does not support profile {1}", CompilerVersion, targetProfile)); + } + + private string CreateTemporaryShaderFile(string shaderSourceCode) + { + string file = Path.GetTempFileName(); + File.WriteAllText(file, shaderSourceCode); + return file; + } + + private string CompilerHelpOutput + { + get + { + if (string.IsNullOrEmpty(helpOutput)) + { + ProcessStartInfo startInfo = new ProcessStartInfo + { + FileName = executable, + Arguments = @"/help", + UseShellExecute = false, + RedirectStandardOutput = true, + CreateNoWindow = true + }; + + using (var proc = Process.Start(startInfo)) + { + helpOutput = proc.StandardOutput.ReadToEnd(); + } + } + + return helpOutput; + } + } + + private string CompilerVersion + { + get + { + Regex pattern = new Regex(@"\d+(\.\d+)+"); + Match m = pattern.Match(CompilerHelpOutput); + if (m.Length > 0) + { + return m.Value; + } + + return ""; + } + } + } +} diff --git a/ANX.Framework.Content.Pipeline/Processors/HLSLCompilerFactory.cs b/ANX.Framework.Content.Pipeline/Processors/HLSLCompilerFactory.cs new file mode 100644 index 00000000..40e9cadc --- /dev/null +++ b/ANX.Framework.Content.Pipeline/Processors/HLSLCompilerFactory.cs @@ -0,0 +1,80 @@ +#region Using Statements +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.IO; +using System.Diagnostics; +using System.Text.RegularExpressions; +using System.Runtime.InteropServices; + +#endregion + +namespace ANX.Framework.Content.Pipeline.Processors +{ + public class HLSLCompilerFactory + { + private List compilers = new List(); + + public IEnumerable Compilers + { + get + { + if (compilers == null || compilers.Count <= 0) + { + HashSet tempCompilers = new HashSet(); + HLSLCompilerExecutables.All(x => tempCompilers.Add(x)); // deduplicate list + compilers = new List(tempCompilers); + compilers.Sort(); + } + + foreach (HLSLCompiler compiler in compilers) + { + yield return compiler; + } + } + } + + private IEnumerable ExecutablePaths + { + get + { + foreach (String subdir in new String[] { "x64", "x86" }) + { + string sdkPath = Environment.GetEnvironmentVariable("DXSDK_DIR"); + if (String.IsNullOrEmpty(sdkPath) == false) + { + yield return Path.Combine(sdkPath, subdir); + } + + foreach (String programFilesPath in new String[] { Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), + Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) }) + { + yield return Path.Combine(Path.Combine(programFilesPath, @"Windows Kits\8.0\bin\"), subdir); + yield return Path.Combine(Path.Combine(programFilesPath, @"Microsoft DirectX SDK (June 2010)\Utilities\bin\"), subdir); + } + } + } + } + + private IEnumerable HLSLCompilerExecutables + { + get + { + string fxcFile; + + foreach (string path in ExecutablePaths) + { + fxcFile = Path.Combine(path, @"fxc.exe"); + + if (File.Exists(fxcFile)) + { + yield return new HLSLCompiler(fxcFile); + } + } + } + } + + + } +} diff --git a/ANX.Framework.Content.Pipeline/Serialization/Compiler/BuiltInTypeWriter.cs b/ANX.Framework.Content.Pipeline/Serialization/Compiler/BuiltInTypeWriter.cs index 872cedab..4584c39a 100644 --- a/ANX.Framework.Content.Pipeline/Serialization/Compiler/BuiltInTypeWriter.cs +++ b/ANX.Framework.Content.Pipeline/Serialization/Compiler/BuiltInTypeWriter.cs @@ -1,5 +1,6 @@ #region Using Statements using System; +using System.Reflection; #endregion @@ -13,8 +14,23 @@ namespace ANX.Framework.Content.Pipeline.Serialization.Compiler { public override string GetRuntimeReader(TargetPlatform targetPlatform) { - // TODO! - return ""; - } + string @namespace = typeof(ContentTypeReader).Namespace; + string text = base.GetType().Name.Replace("Writer", "Reader"); + text += base.GetGenericArgumentRuntimeTypes(targetPlatform); + Assembly runtimeAssembly = this.RuntimeAssembly; + if (runtimeAssembly != null) + { + text = text + ", " + ContentTypeWriter.GetAssemblyFullName(runtimeAssembly, targetPlatform); + } + return @namespace + '.' + text; + } + + protected virtual Assembly RuntimeAssembly + { + get + { + return null; + } + } } } diff --git a/ANX.Framework.Content.Pipeline/Serialization/Compiler/ContentCompiler.cs b/ANX.Framework.Content.Pipeline/Serialization/Compiler/ContentCompiler.cs index 7fd06b58..5e9a30d3 100644 --- a/ANX.Framework.Content.Pipeline/Serialization/Compiler/ContentCompiler.cs +++ b/ANX.Framework.Content.Pipeline/Serialization/Compiler/ContentCompiler.cs @@ -1,5 +1,9 @@ #region Using Statements using System; +using System.IO; +using ANX.Framework.Graphics; +using System.Collections.Generic; +using System.Reflection; #endregion @@ -11,9 +15,100 @@ namespace ANX.Framework.Content.Pipeline.Serialization.Compiler { public sealed class ContentCompiler { + private Dictionary writerInstances = new Dictionary(); + + public ContentCompiler() + { + foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies()) + { + foreach (Type type in assembly.GetTypes()) + { + ContentTypeWriterAttribute[] value = (ContentTypeWriterAttribute[])type.GetCustomAttributes(typeof(ContentTypeWriterAttribute), true); + if (value.Length > 0) + { + if (!type.ContainsGenericParameters) + { + ContentTypeWriter writer = (ContentTypeWriter)Activator.CreateInstance(type); + writerInstances[writer.TargetType] = writer; + } + else + { + //TODO: implement generic writer instances... + System.Diagnostics.Debugger.Break(); + } + } + } + } + } + + internal void Compile(Stream output, object value, TargetPlatform targetPlatform, GraphicsProfile targetProfile, bool compressContent, string rootDirectory, string referenceRelocationPath) + { + if (output == null) + { + throw new ArgumentNullException("output"); + } + if (value == null) + { + throw new ArgumentNullException("value"); + } + if (!Enum.IsDefined(typeof(TargetPlatform), targetPlatform)) + { + throw new ArgumentOutOfRangeException("targetPlatform"); + } + if (!Enum.IsDefined(typeof(GraphicsProfile), targetProfile)) + { + throw new ArgumentOutOfRangeException("targetProfile"); + } + if (string.IsNullOrEmpty(rootDirectory)) + { + throw new ArgumentNullException("rootDirectory"); + } + if (string.IsNullOrEmpty(referenceRelocationPath)) + { + throw new ArgumentNullException("referenceRelocationPath"); + } + if (compressContent) + { + compressContent = this.ShouldCompressContent(targetPlatform, value); + } + using (ContentWriter contentWriter = new ContentWriter(this, output, targetPlatform, targetProfile, compressContent, rootDirectory, referenceRelocationPath)) + { + contentWriter.WriteObject(value); + contentWriter.FlushOutput(); + } + } + public ContentTypeWriter GetTypeWriter(Type type) { - throw new NotImplementedException(); + if (type == null) + { + throw new ArgumentNullException("type"); + } + ContentTypeWriter typeWriterInternal = this.GetTypeWriterInternal(type); + //TODO: this.RecordDependency(typeWriterInternal.TargetType); + return typeWriterInternal; + } + + private ContentTypeWriter GetTypeWriterInternal(Type type) + { + ContentTypeWriter contentTypeWriter; + if (!this.writerInstances.TryGetValue(type, out contentTypeWriter)) + { + //contentTypeWriter = this.typeWriterFactory.CreateWriter(type); + //this.AddTypeWriter(contentTypeWriter); + //this.InitializeTypeWriter(contentTypeWriter); + } + return contentTypeWriter; + } + + private bool ShouldCompressContent(TargetPlatform targetPlatform, object value) + { + if (targetPlatform == TargetPlatform.WindowsPhone) + { + return false; + } + ContentTypeWriter typeWriterInternal = this.GetTypeWriterInternal(value.GetType()); + return typeWriterInternal.ShouldCompressContent(targetPlatform, value); } } } diff --git a/ANX.Framework.Content.Pipeline/Serialization/Compiler/ContentTypeWriter.cs b/ANX.Framework.Content.Pipeline/Serialization/Compiler/ContentTypeWriter.cs index 2b82c6dd..59c9e476 100644 --- a/ANX.Framework.Content.Pipeline/Serialization/Compiler/ContentTypeWriter.cs +++ b/ANX.Framework.Content.Pipeline/Serialization/Compiler/ContentTypeWriter.cs @@ -1,5 +1,6 @@ #region Using Statements using System; +using System.Reflection; #endregion @@ -17,8 +18,87 @@ namespace ANX.Framework.Content.Pipeline.Serialization.Compiler protected ContentTypeWriter(Type targetType) { this.targetType = targetType; + } - throw new NotImplementedException(); + internal static string GetStrongTypeName(Type type, TargetPlatform targetPlatform) + { + string text = ContentTypeWriter.GetTypeName(type); + if (!string.IsNullOrEmpty(type.Namespace)) + { + text = type.Namespace + '.' + text; + } + return text + ", " + ContentTypeWriter.GetAssemblyFullName(type.Assembly, targetPlatform); + } + + internal static string GetAssemblyFullName(Assembly assembly, TargetPlatform targetPlatform) + { + AssemblyName assemblyName = assembly.GetName(); + //ContentTypeWriter.NetCFPlatformDescription[] netCFDescs = ContentTypeWriter.NetCFDescs; + //for (int i = 0; i < netCFDescs.Length; i++) + //{ + // ContentTypeWriter.NetCFPlatformDescription netCFPlatformDescription = netCFDescs[i]; + // if (netCFPlatformDescription.TargetPlatform == targetPlatform) + // { + // assemblyName = (AssemblyName)assemblyName.Clone(); + // if (ContentTypeWriter.KeysAreEqual(assemblyName.GetPublicKeyToken(), ContentTypeWriter.WindowsPublicKeyToken)) + // { + // assemblyName.SetPublicKeyToken(netCFPlatformDescription.PublicKeyToken); + // break; + // } + // string[] netCFAssemblies = netCFPlatformDescription.NetCFAssemblies; + // for (int j = 0; j < netCFAssemblies.Length; j++) + // { + // string value = netCFAssemblies[j]; + // if (assemblyName.Name.Equals(value, StringComparison.InvariantCulture)) + // { + // assemblyName.Version = netCFPlatformDescription.NetCFAssemblyVersion; + // assemblyName.SetPublicKeyToken(netCFPlatformDescription.NetCFPublicKeyToken); + // break; + // } + // } + // } + //} + return assemblyName.FullName; + } + + private static string GetTypeName(Type type) + { + string text = type.Name; + Type declaringType = type.DeclaringType; + if (declaringType != null) + { + text = ContentTypeWriter.GetTypeName(declaringType) + '+' + text; + } + return text; + } + + internal string GetGenericArgumentRuntimeTypes(TargetPlatform targetPlatform) + { + //TODO: implement + System.Diagnostics.Debugger.Break(); + return ""; + + //if (this.genericArgumentWriters == null) + //{ + // return string.Empty; + //} + //string text = string.Empty; + //for (int i = 0; i < this.genericArgumentWriters.Count; i++) + //{ + // if (i > 0) + // { + // text += ','; + // } + // object obj = text; + // text = string.Concat(new object[] + // { + // obj, + // '[', + // this.genericArgumentWriters[i].GetRuntimeType(targetPlatform), + // ']' + // }); + //} + //return '[' + text + ']'; } public abstract string GetRuntimeReader(TargetPlatform targetPlatform); diff --git a/ANX.Framework.Content.Pipeline/Serialization/Compiler/ContentWriter.cs b/ANX.Framework.Content.Pipeline/Serialization/Compiler/ContentWriter.cs index af5ce050..8cb543af 100644 --- a/ANX.Framework.Content.Pipeline/Serialization/Compiler/ContentWriter.cs +++ b/ANX.Framework.Content.Pipeline/Serialization/Compiler/ContentWriter.cs @@ -18,6 +18,27 @@ namespace ANX.Framework.Content.Pipeline.Serialization.Compiler { private TargetPlatform targetPlatform; private GraphicsProfile targetProfile; + private ContentCompiler compiler; + private MemoryStream headerData; + private MemoryStream contentData; + private Stream finalOutput; + private Boolean compressContent; + private string rootDirectory; + private string referenceRelocationPath; + + internal ContentWriter(ContentCompiler compiler, Stream output, TargetPlatform targetPlatform, GraphicsProfile targetProfile, bool compressContent, string rootDirectory, string referenceRelocationPath) + { + this.compiler = compiler; + this.targetPlatform = targetPlatform; + this.targetProfile = targetProfile; + this.compressContent = compressContent; + this.rootDirectory = rootDirectory; + this.referenceRelocationPath = referenceRelocationPath; + this.finalOutput = output; + this.headerData = new MemoryStream(); + this.contentData = new MemoryStream(); + this.OutStream = this.contentData; + } public void Write(Color value) { @@ -73,15 +94,43 @@ namespace ANX.Framework.Content.Pipeline.Serialization.Compiler base.Write(value.W); } - //TODO: implement -> ExternalReference needed first - //public void WriteExternalReference(ExternalReference reference) - //{ - - //} + public void WriteExternalReference(ExternalReference reference) + { + throw new NotImplementedException(); + } public void WriteObject(T value) { - throw new NotImplementedException(); + if (value == null) + { + base.Write7BitEncodedInt(0); + return; + } + + ContentTypeWriter typeWriter = this.compiler.GetTypeWriter(value.GetType()); + + base.Write7BitEncodedInt(1); + //if (this.recurseDetector.ContainsKey(value)) + //{ + // throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, Resources.FoundCyclicReference, new object[] + // { + // value + // })); + //} + //this.recurseDetector.Add(value, true); + this.InvokeWriter(value, typeWriter); + //this.recurseDetector.Remove(value); + } + + private void InvokeWriter(T value, ContentTypeWriter writer) + { + ContentTypeWriter contentTypeWriter = writer as ContentTypeWriter; + if (contentTypeWriter != null) + { + contentTypeWriter.Write(this, value); + return; + } + writer.Write(this, value); } public void WriteObject(T value, ContentTypeWriter typeWriter) @@ -104,6 +153,79 @@ namespace ANX.Framework.Content.Pipeline.Serialization.Compiler throw new NotImplementedException(); } + internal void FlushOutput() + { + //TODO: implement + + //this.WriteSharedResources(); + this.WriteHeader(); + this.WriteFinalOutput(); + } + + private void WriteHeader() + { + this.OutStream = this.headerData; + //TODO: implement + //base.Write7BitEncodedInt(this.typeWriters.Count); + //foreach (ContentTypeWriter current in this.typeWriters) + //{ + // this.Write(current.GetRuntimeReader(this.targetPlatform)); + // this.Write(current.TypeVersion); + //} + //base.Write7BitEncodedInt(this.sharedResourceNames.Count); + } + + private void WriteFinalOutput() + { + this.OutStream = this.finalOutput; + this.Write('X'); + this.Write('N'); + this.Write('B'); + this.Write((byte)this.targetPlatform); + //if (this.targetPlatform == TargetPlatform.Windows) + //{ + // this.Write((byte)119); + //} + //else + //{ + // if (this.targetPlatform == TargetPlatform.XBox360) + // { + // this.Write((byte)120); + // } + // else + // { + // if (this.targetPlatform != TargetPlatform.WindowsPhone) + // { + // throw new NotSupportedException(); + // } + // this.Write((byte)109); + // } + //} + if (this.compressContent) + { + throw new NotImplementedException(); + //this.WriteCompressedOutput(); + return; + } + this.WriteUncompressedOutput(); + } + + private void WriteUncompressedOutput() + { + this.WriteVersionNumber(5); + int num = (int)this.headerData.Length; + int num2 = (int)this.contentData.Length; + this.Write(10 + num + num2); + this.OutStream.Write(this.headerData.GetBuffer(), 0, num); + this.OutStream.Write(this.contentData.GetBuffer(), 0, num2); + } + + private void WriteVersionNumber(ushort version) + { + version |= (ushort)((int)this.targetProfile << 8); + this.Write(version); + } + public TargetPlatform TargetPlatform { get diff --git a/ANX.Framework.Content.Pipeline/Serialization/Compiler/GenericContentTypeWriter.cs b/ANX.Framework.Content.Pipeline/Serialization/Compiler/GenericContentTypeWriter.cs index b552ab5b..01c8e4eb 100644 --- a/ANX.Framework.Content.Pipeline/Serialization/Compiler/GenericContentTypeWriter.cs +++ b/ANX.Framework.Content.Pipeline/Serialization/Compiler/GenericContentTypeWriter.cs @@ -1,5 +1,6 @@ #region Using Statements using System; +using System.Globalization; #endregion @@ -18,9 +19,28 @@ namespace ANX.Framework.Content.Pipeline.Serialization.Compiler protected internal override void Write(ContentWriter output, object value) { - throw new NotImplementedException(); + this.Write(output, ContentTypeWriter.CastType(value)); } protected internal abstract void Write(ContentWriter output, T value); + + private static T CastType(object value) + { + if (value == null) + { + throw new ArgumentNullException("value"); + } + if (!(value is T)) + { + System.Diagnostics.Debugger.Break(); + //throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Resources.WrongArgumentType, new object[] + //{ + // typeof(T), + // value.GetType() + //})); + } + return (T)((object)value); + } + } } diff --git a/ANX.Framework.Content.Pipeline/Serialization/Compiler/GraphicTypeWriters/EffectWriter.cs b/ANX.Framework.Content.Pipeline/Serialization/Compiler/GraphicTypeWriters/EffectWriter.cs new file mode 100644 index 00000000..59ceca23 --- /dev/null +++ b/ANX.Framework.Content.Pipeline/Serialization/Compiler/GraphicTypeWriters/EffectWriter.cs @@ -0,0 +1,46 @@ +#region Using Statements +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using ANX.Framework.Content.Pipeline.Processors; +using System.Reflection; +using ANX.Framework.Graphics; + +#endregion + +// This file is part of the ANX.Framework created by the +// "ANX.Framework developer group" and released under the Ms-PL license. +// For details see: http://anxframework.codeplex.com/license + +namespace ANX.Framework.Content.Pipeline.Serialization.Compiler +{ + [ContentTypeWriter] + internal class EffectWriter : BuiltinTypeWriter + { + protected override Assembly RuntimeAssembly + { + get + { + return typeof(Effect).Assembly; + } + } + + protected internal override void Write(ContentWriter output, CompiledEffectContent value) + { + //TODO: implement + //if (output.TargetPlatform == TargetPlatform.WindowsPhone) + //{ + // throw new InvalidContentException(Resources.MobileNoEffects); + //} + byte[] effectCode = value.GetEffectCode(); + output.Write(effectCode.Length); + output.Write(effectCode); + } + + public override string GetRuntimeType(TargetPlatform targetPlatform) + { + return ContentTypeWriter.GetStrongTypeName(typeof(Effect), targetPlatform); + } + } +} diff --git a/ANX.Framework.Content.Pipeline/TargetPlatform.cs b/ANX.Framework.Content.Pipeline/TargetPlatform.cs index 0cb51577..d8f20bd4 100644 --- a/ANX.Framework.Content.Pipeline/TargetPlatform.cs +++ b/ANX.Framework.Content.Pipeline/TargetPlatform.cs @@ -9,10 +9,10 @@ using System; namespace ANX.Framework.Content.Pipeline { - public enum TargetPlatform + public enum TargetPlatform : byte { - Windows, - WindowsPhone, - XBox360, + Windows = (byte)119, + WindowsPhone = (byte)109, + XBox360 = (byte)120, } } diff --git a/ANX.Framework.Content.Pipeline/Tasks/BuildContent.cs b/ANX.Framework.Content.Pipeline/Tasks/BuildContent.cs index 005bfff8..49517d2b 100644 --- a/ANX.Framework.Content.Pipeline/Tasks/BuildContent.cs +++ b/ANX.Framework.Content.Pipeline/Tasks/BuildContent.cs @@ -3,6 +3,9 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; +using System.IO; +using ANX.Framework.Content.Pipeline.Serialization.Compiler; +using ANX.Framework.Graphics; #endregion @@ -16,6 +19,15 @@ namespace ANX.Framework.Content.Pipeline.Tasks { private ImporterManager importerManager; private ProcessorManager processorManager; + private ContentCompiler contentCompiler; + + public BuildContent() + { + OutputDirectory = Environment.CurrentDirectory; + TargetPlatform = TargetPlatform.Windows; + CompressContent = false; + TargetProfile = GraphicsProfile.HiDef; + } public ImporterManager ImporterManager { @@ -43,6 +55,49 @@ namespace ANX.Framework.Content.Pipeline.Tasks } } + public ContentCompiler ContentCompiler + { + get + { + if (this.contentCompiler == null) + { + this.contentCompiler = new ContentCompiler(); + } + + return this.contentCompiler; + } + } + + public string OutputDirectory + { + get; + set; + } + + public TargetPlatform TargetPlatform + { + get; + set; + } + + public bool CompressContent + { + get; + set; + } + + public GraphicsProfile TargetProfile + { + get; + set; + } + + public ContentBuildLogger BuildLogger + { + get; + set; + } + public void Execute(IEnumerable itemsToBuild) { foreach (BuildItem buildItem in itemsToBuild) @@ -55,18 +110,20 @@ namespace ANX.Framework.Content.Pipeline.Tasks } var buildedItem = Process(buildItem, importedObject); + + SerializeAsset(buildItem, buildedItem); } } private object ImportAsset(BuildItem item) { IContentImporter instance = this.ImporterManager.GetInstance(item.BuildRequest.ImporterName); - ContentImporterContext context = new AnxContentImporterContext(this, item, null); //this.buildLogger); - //this.buildLogger.LogMessage(Resources.BuildLogImporting, new object[] - //{ - // item.BuildRequest.SourceFilename, - // instance.GetType() - //}); + ContentImporterContext context = new AnxContentImporterContext(this, item, BuildLogger); + BuildLogger.LogMessage("building {0} of type {1}", new object[] + { + item.BuildRequest.SourceFilename, + instance.GetType() + }); return instance.Import(item.BuildRequest.SourceFilename, context); } @@ -75,7 +132,9 @@ namespace ANX.Framework.Content.Pipeline.Tasks if (String.IsNullOrEmpty(item.BuildRequest.ProcessorName) == false) { IContentProcessor instance = this.ProcessorManager.GetInstance(item.BuildRequest.ProcessorName); - ContentProcessorContext context = new AnxContentProcessorContext(); + ContentProcessorContext context = new AnxContentProcessorContext(item, BuildLogger, TargetPlatform, TargetProfile, ""); + context.OutputDirectory = OutputDirectory; + context.OutputFilename = item.OutputFilename; return instance.Process(importedObject, context); } else @@ -83,5 +142,18 @@ namespace ANX.Framework.Content.Pipeline.Tasks return importedObject; } } + + private void SerializeAsset(BuildItem item, object assetData) + { + string outputFilename = Path.Combine(OutputDirectory, item.OutputFilename); + + BuildLogger.LogMessage("serializing {0}", new object[] { item.OutputFilename }); + using (Stream stream = new FileStream(outputFilename, FileMode.Create, FileAccess.Write, FileShare.None)) + { + this.ContentCompiler.Compile(stream, assetData, TargetPlatform, TargetProfile, CompressContent, OutputDirectory, outputFilename); + } + //this.rebuiltFiles.Add(outputFilename); + } + } } diff --git a/ANX.Framework.Content.Pipeline/Tasks/BuildItem.cs b/ANX.Framework.Content.Pipeline/Tasks/BuildItem.cs index d3ec52a8..513f5c5e 100644 --- a/ANX.Framework.Content.Pipeline/Tasks/BuildItem.cs +++ b/ANX.Framework.Content.Pipeline/Tasks/BuildItem.cs @@ -20,5 +20,10 @@ namespace ANX.Framework.Content.Pipeline.Tasks set; } + public string OutputFilename + { + get; + set; + } } } diff --git a/Tools/ContentBuilder/ConsoleLogger.cs b/Tools/ContentBuilder/ConsoleLogger.cs new file mode 100644 index 00000000..a4acf878 --- /dev/null +++ b/Tools/ContentBuilder/ConsoleLogger.cs @@ -0,0 +1,38 @@ +#region Using Statements +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using ANX.Framework.Content.Pipeline; + +#endregion + +// This file is part of the ANX.Framework created by the +// "ANX.Framework developer group" and released under the Ms-PL license. +// For details see: http://anxframework.codeplex.com/license + +namespace ContentBuilder +{ + public class ConsoleLogger : ContentBuildLogger + { + public override void LogImportantMessage(string message, params object[] messageArgs) + { + Write("Important", message, messageArgs); + } + + public override void LogMessage(string message, params object[] messageArgs) + { + Write("", message, messageArgs); + } + + public override void LogWarning(string helpLink, ContentIdentity contentIdentity, string message, params object[] messageArgs) + { + Write("Warning", message, messageArgs); + } + + private void Write(string severity, string message, params object[] messageArgs) + { + Console.WriteLine(String.Format("[{0}] {1}", severity, String.Format(message, messageArgs))); + } + } +} diff --git a/Tools/ContentBuilder/ContentBuilder.csproj b/Tools/ContentBuilder/ContentBuilder.csproj index b35cac74..b0954831 100644 --- a/Tools/ContentBuilder/ContentBuilder.csproj +++ b/Tools/ContentBuilder/ContentBuilder.csproj @@ -43,6 +43,7 @@ + diff --git a/Tools/ContentBuilder/Program.cs b/Tools/ContentBuilder/Program.cs index a78b59a4..9098588a 100644 --- a/Tools/ContentBuilder/Program.cs +++ b/Tools/ContentBuilder/Program.cs @@ -21,6 +21,8 @@ namespace ContentBuilder // Generate a list of items to build and set build parameters // List itemsToBuild = new List(); + BuildContent buildContentTask = new BuildContent(); + buildContentTask.BuildLogger = new ConsoleLogger(); foreach (string arg in args) { @@ -32,15 +34,27 @@ namespace ContentBuilder //TODO: set configured processor name buildItem.BuildRequest.SourceFilename = arg; buildItem.BuildRequest.AssetName = System.IO.Path.GetFileNameWithoutExtension(arg); + buildItem.OutputFilename = String.Format("{0}.xnb", buildItem.BuildRequest.AssetName); itemsToBuild.Add(buildItem); } + else + { + // parse argument + string parameterChar1 = arg.Substring(1,1).ToLowerInvariant(); + string parameterChar2 = arg.Substring(2,1).ToLowerInvariant(); + + if (parameterChar1 == "o" && parameterChar2 == "d") + { + // output dir + buildContentTask.OutputDirectory = arg.Substring(3); + } + } } // // Build the content // - BuildContent buildContentTask = new BuildContent(); buildContentTask.Execute(itemsToBuild); } } diff --git a/Tools/XNBInspector/InspectForm.Designer.cs b/Tools/XNBInspector/InspectForm.Designer.cs index 2b339f78..3cad7058 100644 --- a/Tools/XNBInspector/InspectForm.Designer.cs +++ b/Tools/XNBInspector/InspectForm.Designer.cs @@ -28,6 +28,7 @@ /// private void InitializeComponent() { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(InspectForm)); this.statusStrip1 = new System.Windows.Forms.StatusStrip(); this.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -35,7 +36,9 @@ this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); this.richTextBox1 = new System.Windows.Forms.RichTextBox(); + this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.menuStrip1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); // // statusStrip1 @@ -98,6 +101,17 @@ this.richTextBox1.Text = ""; this.richTextBox1.WordWrap = false; // + // pictureBox1 + // + this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.pictureBox1.BackColor = System.Drawing.Color.Transparent; + this.pictureBox1.Image = global::ANX.Tools.XNBInspector.Properties.Resources.ANX_Framework_Logo_220x58; + this.pictureBox1.Location = new System.Drawing.Point(552, 266); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(220, 58); + this.pictureBox1.TabIndex = 3; + this.pictureBox1.TabStop = false; + // // InspectForm // this.AllowDrop = true; @@ -105,16 +119,20 @@ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScroll = true; this.ClientSize = new System.Drawing.Size(784, 362); + this.Controls.Add(this.pictureBox1); this.Controls.Add(this.richTextBox1); this.Controls.Add(this.statusStrip1); this.Controls.Add(this.menuStrip1); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MainMenuStrip = this.menuStrip1; this.Name = "InspectForm"; this.Text = "XNB Inspector"; + this.Load += new System.EventHandler(this.InspectForm_Load); this.DragDrop += new System.Windows.Forms.DragEventHandler(this.dropArea_DragDrop); this.DragEnter += new System.Windows.Forms.DragEventHandler(this.dropArea_DragEnter); this.menuStrip1.ResumeLayout(false); this.menuStrip1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -129,6 +147,7 @@ private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; private System.Windows.Forms.OpenFileDialog openFileDialog; private System.Windows.Forms.RichTextBox richTextBox1; + private System.Windows.Forms.PictureBox pictureBox1; } } diff --git a/Tools/XNBInspector/InspectForm.cs b/Tools/XNBInspector/InspectForm.cs index 92bfafbc..b33c720a 100644 --- a/Tools/XNBInspector/InspectForm.cs +++ b/Tools/XNBInspector/InspectForm.cs @@ -69,6 +69,11 @@ namespace ANX.Tools.XNBInspector } } } + + private void InspectForm_Load(object sender, EventArgs e) + { + this.Text += " v" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(); + } } } diff --git a/Tools/XNBInspector/InspectForm.resx b/Tools/XNBInspector/InspectForm.resx index 9722ffb9..a16ac7bd 100644 --- a/Tools/XNBInspector/InspectForm.resx +++ b/Tools/XNBInspector/InspectForm.resx @@ -126,4 +126,81 @@ 248, 17 + + + + AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAA + AAoHK0S5BytEuQAAAAr///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wAAAAAKBy1EwhWS5P8VkuT/By1EwgAAAAr///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8AAAAACgctRMIVkuT/F531/xed9f8VkuT/By1EwgAAAAr///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AAAAAAoHLUTCFZLk/xed9f8XnfX/F531/xed9f8VkuT/By1EwgAAAAr///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wAAAAAKBy1EwhWS5P8XnfX/F531/xed9f8XnfX/F531/xed9f8VkuT/By1EwgAA + AAr///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8AAAAACgctRMIVkuT/F531/xed9f8XnfX/F531/xed9f8XnfX/F531/xed + 9f8VkuT/By1EwgAAAAr///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AAAAAAoHLUTCFZLk/xed9f8XnfX/F531/xed9f8XnfX/F531/xed + 9f8XnfX/F531/xed9f8VkuT/By1EwgAAAAr///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wAAAAAKBy1EwhWS5P8XnfX/F531/xed9f8XnfX/F531/xed + 9f8XnfX/F531/xed9f8XnfX/F531/xed9f8VkuT/By1EwgAAAAr///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8AAAAACgctRMIVkuT/F531/xed9f8XnfX/F531/xed + 9f8XnfX/F531/xed9f8XnfX/F531/xed9f8XnfX/F531/xed9f8VkuT/By1EwgAAAAr///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAoHLUTCDFOb/wcvjP8HL4z/By+M/wg3 + iP8Vjt3/EXe6/xJ7wP8VkeL/EG6r/xN/x/8Tf8f/E3/H/xSH0v8XnfX/F531/xed9f8VkuT/By1EwgAA + AAr///8A////AP///wD///8A////AP///wD///8A////AP///wAAAAAKBy1EwhWS5P8OYaz/AACA/wAA + gP8AAID/AAF7/xJ7yf8Se7//F531/xJ8wv8Rd7r/F531/xed9f8XnfX/E3/G/xed9f8XnfX/F531/xed + 9f8VkuT/By1EwgAAAAr///8A////AP///wD///8A////AP///wD///8AAAAACgctRMIVkuT/F531/xWR + 4/8CCnT/AACA/wAAgP8AAID/DFKj/xJ6vv8XnfX/Enq+/xF3uf8XnfX/F531/xed9f8SfsT/F531/xed + 9f8XnfX/F531/xed9f8VkuT/By1EwgAAAAr///8A////AP///wD///8A////AAAAAAoHLUTCFZLk/xed + 9f8XnfX/F531/wYogf8AAID/AACA/wAAgP8GLYj/FY7e/xN/x/8UhtH/FpPm/xJ7wf8Se8H/EnvB/xJ9 + w/8XnfX/F531/xed9f8XnfX/F531/xed9f8VkuT/By1EwgAAAAr///8A////AP///wAAAAAKBy1EwhWS + 5P8XnfX/F531/xed9f8XnfX/C0ma/wAAgP8AAID/AACA/wIMc/8Wluv/F531/xed9f8Wk+b/AxFi/wIL + cf8CC3H/Agtx/xBstv8XnfX/F531/xed9f8XnfX/F531/xed9f8VkuT/By1EwgAAAAr///8AAAAACgct + RMIVkuT/F531/xed9f8XnfX/F531/xed9f8Qbrj/AAB9/wAAgP8AAID/AAB//w5ksP8XnfX/F531/xed + 9f8FJH3/AACA/wAAgP8AAID/C0mb/xed9f8XnfX/F531/xed9f8XnfX/F531/xed9f8VkuT/By1EwgAA + AAoHK0S5FZLk/xed9f8XnfX/F531/xed9f8XnfX/F531/xaZ7/8CEXT/AACA/wAAgP8AAID/BSd//wpE + l/8KQ5b/CUKV/wUeev8AAID/AACA/wAAgP8GKoP/F531/xed9f8XnfX/F531/xed9f8XnfX/F531/xed + 9f8VkuT/BytEuQcrRLkVkuT/F531/xed9f8XnfX/F531/xed9f8XnfX/F531/wcxif8AAID/AACA/wAA + gP8AAID/AACA/wAAgP8AAID/AACA/wAAgP8AAID/AACA/wILdP8Wkub/F531/xed9f8XnfX/F531/xed + 9f8XnfX/F531/xWS5P8HK0S5AAAACgcrRMIVkuT/F531/xed9f8XnfX/F531/xed9f8XnfX/DFKi/wAA + gP8AAID/AACA/wAAf/8DF3f/BB18/wUhf/8GJID/AQZ6/wAAgP8AAID/AACA/w9lr/8XnfX/F531/xed + 9f8XnfX/F531/xed9f8VkuT/By1EwgAAAAr///8AAAAACgcrRMIVkuT/F531/xed9f8XnfX/F531/xed + 9f8Se8j/AAF5/wAAgP8AAID/AACA/w5dp/8XnfX/F531/xed9f8FI37/AACA/wAAgP8AAID/CkSW/xed + 9f8XnfX/F531/xed9f8XnfX/FZLk/wctRMIAAAAK////AP///wD///8AAAAACgcrQ8MVkuT/F531/xed + 9f8XnfX/F531/xed9f8EGHf/AACA/wAAgP8AAID/Bid9/xeb8v8XnfX/F531/wlAlf8AAID/AACA/wAA + gP8FJH7/F531/xed9f8XnfX/F531/xWS5P8HLUTCAAAACv///wD///8A////AP///wD///8AAAAACgcr + Q8MVkuT/F531/xed9f8XnfX/F531/wtJmf8AAID/AACA/wAAgP8AAH7/BSOA/wk9lf8JP5f/BimA/wAA + gP8AAID/AACA/wEHdv8VjNv/F531/xed9f8VkuT/By1EwgAAAAr///8A////AP///wD///8A////AP// + /wD///8AAAAACgcrQ8MVkuT/F531/xed9f8XnfX/FpLm/wITd/8AAID/AACA/wAAgP8AAID/AACA/wAA + gP8AAID/AACA/wAAgP8AAID/AACA/w5eqf8XnfX/FZLk/wctRMIAAAAK////AP///wD///8A////AP// + /wD///8A////AP///wD///8AAAAACgcrQ8MVkuT/F531/xed9f8XnfX/DFOh/wEHdv8AAID/AACA/wAA + gP8AAID/AACA/wAAgP8AAID/AACA/wAAgP8AAID/CT6S/xWS5P8HLUTCAAAACv///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8AAAAACwcrQ8MVkuT/F531/xed9f8XnfX/FY/h/w5f + q/8JQZT/CTuQ/wk6kP8JOY7/CDeN/wg2jP8IN43/CTmP/wk7kP8KRo7/By1EwgAAAAr///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8AAAAACwcrQ8MVkuT/F531/xed + 9f8XnfX/F531/xed9f8XnfX/F531/xed9f8XnfX/F531/xed9f8XnfX/FZLk/wctRMIAAAAK////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8AAAAACwcr + QsQVkuT/F531/xed9f8XnfX/F531/xed9f8XnfX/F531/xed9f8XnfX/F531/xWS5P8HLUTCAAAACv// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8AAAAACwcrQsQVkuT/F531/xed9f8XnfX/F531/xed9f8XnfX/F531/xed9f8VkuT/By1EwgAA + AAr///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8AAAAACwcrQsQVkuT/F531/xed9f8XnfX/F531/xed9f8XnfX/FZLk/wct + RMIAAAAK////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8AAAAACwcqQcQVkuT/F531/xed9f8XnfX/F531/xWS + 5P8HLUTCAAAACv///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8AAAAADAcqQcQVkuT/F531/xed + 9f8VkuT/By1EwgAAAAr///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8AAAAADAYp + QcUVkuT/FZLk/wctRMIAAAAK////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8AAAAADAcpQLsHK0S5AAAACv///wD///8A////AP///wD///8A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A//5////8P///+B////AP///gB///wAP//4AB//8AAP/+AAB//AAAP/gA + AB/wAAAP4AAAB8AAAAOAAAABAAAAAAAAAACAAAABwAAAA+AAAAfwAAAP+AAAH/wAAD/+AAB//wAA//+A + Af//wAP//+AH///wD///+B////w////+f/8= + + \ No newline at end of file diff --git a/Tools/XNBInspector/Properties/AssemblyInfo.cs b/Tools/XNBInspector/Properties/AssemblyInfo.cs index db9698cb..657185e1 100644 --- a/Tools/XNBInspector/Properties/AssemblyInfo.cs +++ b/Tools/XNBInspector/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("0.2.0.0")] +[assembly: AssemblyFileVersion("0.2.0.0")] diff --git a/Tools/XNBInspector/Properties/Resources.Designer.cs b/Tools/XNBInspector/Properties/Resources.Designer.cs index 1eb51e98..9ce9d0bd 100644 --- a/Tools/XNBInspector/Properties/Resources.Designer.cs +++ b/Tools/XNBInspector/Properties/Resources.Designer.cs @@ -1,10 +1,10 @@ //------------------------------------------------------------------------------ // -// This code was generated by a tool. -// Runtime Version:4.0.30319.269 +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion:4.0.30319.269 // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +// der Code erneut generiert wird. // //------------------------------------------------------------------------------ @@ -13,12 +13,12 @@ namespace ANX.Tools.XNBInspector.Properties { /// - /// A strongly-typed resource class, for looking up localized strings, etc. + /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. + // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert + // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. + // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen + // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] @@ -33,7 +33,7 @@ namespace ANX.Tools.XNBInspector.Properties { } /// - /// Returns the cached ResourceManager instance used by this class. + /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { @@ -47,8 +47,8 @@ namespace ANX.Tools.XNBInspector.Properties { } /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. + /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle + /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { @@ -59,5 +59,12 @@ namespace ANX.Tools.XNBInspector.Properties { resourceCulture = value; } } + + internal static System.Drawing.Bitmap ANX_Framework_Logo_220x58 { + get { + object obj = ResourceManager.GetObject("ANX.Framework.Logo_220x58", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } } } diff --git a/Tools/XNBInspector/Properties/Resources.resx b/Tools/XNBInspector/Properties/Resources.resx index ffecec85..320a92f2 100644 --- a/Tools/XNBInspector/Properties/Resources.resx +++ b/Tools/XNBInspector/Properties/Resources.resx @@ -46,7 +46,7 @@ mimetype: application/x-microsoft.net.object.binary.base64 value : The object must be serialized with - : System.Serialization.Formatters.Binary.BinaryFormatter + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.soap.base64 @@ -60,6 +60,7 @@ : and then encoded with base64 encoding. --> + @@ -68,9 +69,10 @@ - + + @@ -85,9 +87,10 @@ - + + @@ -109,9 +112,13 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ..\Resources\ANX.Framework.Logo_220x58.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/Tools/XNBInspector/XNBInspector.csproj b/Tools/XNBInspector/XNBInspector.csproj index 9d93ae98..758d2fa0 100644 --- a/Tools/XNBInspector/XNBInspector.csproj +++ b/Tools/XNBInspector/XNBInspector.csproj @@ -33,6 +33,9 @@ prompt 4 + + anx.ico + @@ -84,6 +87,10 @@ ANX.Framework + + + +