From 695ce34937f871aeb75d23482dee93d7773f95f9 Mon Sep 17 00:00:00 2001 From: "SND\\eagleeyestudios_cp" Date: Mon, 3 Dec 2012 15:42:11 +0000 Subject: [PATCH] - Removed "Patch applied" region directives from Game.cs and DrawableGameComponent.cs because they made MSBuild complain about bad Syntax. - Fixed bug in ContentCompiler build process that occurred when using relative Paths. - Changed creation method to use relative paths --- ANX.Framework/DrawableGameComponent.cs | 6 ------ ANX.Framework/Game.cs | 5 ----- Tools/ANXContentCompilerGUI/MainWindow.cs | 22 +++++++++++++++++++--- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/ANX.Framework/DrawableGameComponent.cs b/ANX.Framework/DrawableGameComponent.cs index 807d799c..1a703cfd 100644 --- a/ANX.Framework/DrawableGameComponent.cs +++ b/ANX.Framework/DrawableGameComponent.cs @@ -9,12 +9,6 @@ using ANX.Framework.NonXNA.Development; // "ANX.Framework developer group" and released under the Ms-PL license. // For details see: http://anxframework.codeplex.com/license -#region Patch-Log - -12/03/2012 #13365 clcrutch - -#endregion - namespace ANX.Framework { [PercentageComplete(100)] diff --git a/ANX.Framework/Game.cs b/ANX.Framework/Game.cs index 8d38f729..f2c428d2 100644 --- a/ANX.Framework/Game.cs +++ b/ANX.Framework/Game.cs @@ -14,11 +14,6 @@ using ANX.Framework.NonXNA.SoundSystem; // "ANX.Framework developer group" and released under the Ms-PL license. // For details see: http://anxframework.codeplex.com/license -#region Patch-Log - -12/03/2012 #13365 clcrutch - -#endregion namespace ANX.Framework { diff --git a/Tools/ANXContentCompilerGUI/MainWindow.cs b/Tools/ANXContentCompilerGUI/MainWindow.cs index 6d0779a4..5f813cce 100644 --- a/Tools/ANXContentCompilerGUI/MainWindow.cs +++ b/Tools/ANXContentCompilerGUI/MainWindow.cs @@ -132,7 +132,7 @@ namespace ANX.ContentCompiler.GUI { ProjectOutputDir = !String.IsNullOrEmpty(dlg2.textBoxLocation.Text) ? dlg2.textBoxLocation.Text - : Path.Combine(ProjectFolder, DefaultOutputPath); + : DefaultOutputPath; } else return; @@ -193,7 +193,9 @@ namespace ANX.ContentCompiler.GUI _contentProject = ContentProject.Load(path); ProjectName = _contentProject.Name; ProjectOutputDir = _contentProject.OutputDirectory; - ProjectFolder = _contentProject.InputDirectory; + ProjectFolder = Path.GetDirectoryName(path); + if (String.IsNullOrEmpty(_contentProject.InputDirectory)) + _contentProject.InputDirectory = ProjectFolder; ProjectImportersDir = _contentProject.ReferenceIncludeDirectory; ProjectPath = path; if (string.IsNullOrEmpty(_contentProject.Creator)) @@ -223,7 +225,12 @@ namespace ANX.ContentCompiler.GUI if (_contentProject == null) return; if (String.IsNullOrEmpty(ProjectPath)) SaveProjectAs(sender, e); - + foreach (var buildItem in _contentProject.BuildItems) + { + if (File.Exists(buildItem.SourceFilename)) + buildItem.SourceFilename = buildItem.SourceFilename.Remove(0, Path.GetDirectoryName(ProjectPath).Count() + 1); + } + _contentProject.InputDirectory = ""; //Clear input dir, because we do not need it anymore _contentProject.Save(ProjectPath); if (RecentProjects.Contains(ProjectPath)) RecentProjects.Remove(ProjectPath); @@ -275,6 +282,10 @@ namespace ANX.ContentCompiler.GUI var buildItems = _contentProject.BuildItems; foreach (var bI in buildItems) { + if (!File.Exists(bI.SourceFilename)) + bI.SourceFilename = Path.Combine(Path.GetDirectoryName(ProjectPath), bI.SourceFilename); + if (!File.Exists(bI.OutputFilename)) + bI.OutputFilename = Path.Combine(Path.GetDirectoryName(ProjectPath), bI.OutputFilename); if (String.IsNullOrEmpty(bI.ImporterName)) { bI.ImporterName = ImporterManager.GuessImporterByFileExtension(bI.SourceFilename); @@ -299,6 +310,11 @@ namespace ANX.ContentCompiler.GUI ribbonTextBox.AddMessage("[ERROR] " + ex + "\n Stack: " + ex.StackTrace); EnableUI(); } + foreach (var buildItem in buildItems) + { + buildItem.SourceFilename = buildItem.SourceFilename.Remove(0, ProjectFolder.Count() + 1); + buildItem.OutputFilename = buildItem.OutputFilename.Remove(0, ProjectFolder.Count() + 1); + } EnableUI(); }