From 5cad4866351e7d3ffb457c4c03de68ab655322f8 Mon Sep 17 00:00:00 2001
From: Jesse
Date: Wed, 10 Aug 2016 14:15:04 +0200
Subject: [PATCH 001/128] Clarification and updates for
setting_up_monogame_source
---
Documentation/setting_up_monogame_source.md | 34 +++++++++++----------
1 file changed, 18 insertions(+), 16 deletions(-)
diff --git a/Documentation/setting_up_monogame_source.md b/Documentation/setting_up_monogame_source.md
index c3e49a55d8a..ae1148aab22 100644
--- a/Documentation/setting_up_monogame_source.md
+++ b/Documentation/setting_up_monogame_source.md
@@ -4,22 +4,23 @@ This section will help you setup MonoGame by building it from source code.
Install the tools for the system you are building from:
* Windows:
- * [GitHub for Windows](https://windows.github.com/)
- * [Visual Studio](https://www.visualstudio.com/) or [Xamarin Studio](http://www.monodevelop.com/download/)
- * Optional download Xamarin.Android and Windows Phone 8 SDK
+ * [Git for Windows](https://git-scm.com/download/win)
+ * [Visual Studio](https://www.visualstudio.com/)
+ * [Xamarin.Android](https://www.xamarin.com/download) (Optional)
+ * [Windows Phone 8 SDK](https://www.microsoft.com/en-us/download/details.aspx?id=35471) (Optional)
* Mac:
- * [GitHub for Mac](https://mac.github.com/)
- * [Xamarin Studio](http://www.monodevelop.com/download/)
- * Optional download Xamarin.Android and Xamarin.iOS
+ * [Git](https://git-scm.com/download/mac)
+ * [Xamarin Studio](https://store.xamarin.com/)
+ * Xamarin.Android and Xamarin.iOS can be installed with the Xamarin Studio installer (Optional)
* Linux:
- * Install package called "git"
+ * [Git](https://git-scm.com/download/linux)
* [Monodevelop](http://www.monodevelop.com/download/linux/)
### Getting the source code
-If on Windows, start up Git Shell, if on Unix, start the terminal and type in the following:
+Start up a Terminal (Mac/Linux) or Git Bash (Windows) and clone the MonoGame repository:
```
-git clone https://github.com/mono/MonoGame.git
+git clone https://github.com/MonoGame/MonoGame.git
cd MonoGame
git submodule init
git submodule update
@@ -27,12 +28,13 @@ git submodule update
### Building from source
-If on Windows just start Protobuild.exe.
+MonoGame uses [Protobuild](https://protobuild.org/) to generate project and solution files. Protobuild.exe will be in your MonoGame folder. To run Protobuild:
-if on Unix open terminal and type in:
-```
-cd MonoGame
-mono Protobuild.exe
-```
+- On Windows run Protobuild.exe either by double-clicking or by executing it from the command line.
+- On Mac/Linux open a terminal and run `mono Protobuild.exe` in the MonoGame folder.
+
+Once the project and solution files are generated you can build them with the IDE you installed.
+
+### Referencing the projects
-Now the sln files are generated and you can build them with either Monodevelop or Visual Studio.
+First get the MonoGame SDK from the [downloads page](http://www.monogame.net/downloads/) and install it to get the IDE templates. Start up the IDE you have installed and create a new project from one of the templates. Click Add > Existing Project... on your solution and select the MonoGame.Framework project that matches the template (i.e. MonoGame.Framework.Windows.csproj for a MonoGame Windows project template). The project files are located in MonoGame/MonoGame.Framework. Delete the existing MonoGame.Framework reference and add a reference to the added project by clicking Add Reference... > Projects and selecting the project. You can run your game now. If you make changes to the MonoGame.Framework project it will automatically rebuild when running your game.
From 6a03b6def14eda86abd5f6f39ac030c4577af6a3 Mon Sep 17 00:00:00 2001
From: Jesse
Date: Wed, 10 Aug 2016 14:19:22 +0200
Subject: [PATCH 002/128] Update pipeline.md
---
Documentation/pipeline.md | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Documentation/pipeline.md b/Documentation/pipeline.md
index 9c545da97d0..b8daab6855a 100644
--- a/Documentation/pipeline.md
+++ b/Documentation/pipeline.md
@@ -4,10 +4,10 @@ The MonoGame Pipeline Tool (Pipeline.exe) is the front-end GUI editor for MonoGa
-The Pipeline Tool is still relatively new to MonoGame, but it already has the following features:
+The Pipeline Tool has the following features:
* Create, open, and save MGCB projects.
- * Import existing .contentproj.
+ * Import existing XNA .contentproj.
* Tree view showing content of project.
* Property grid for editing content settings.
* Full undo/redo support.
@@ -17,7 +17,7 @@ The Pipeline Tool is still relatively new to MonoGame, but it already has the fo
* Support for custom importers/processors/writers.
* Template format for adding new custom content types.
-Currently the Pipeline Tool is only available on Windows and is part of the SDK installation. The Mac and Linux versions are in development and should be available soon.
+The Pipeline Tool is included in the SDK installation.
[Read detailed documentation](using_pipeline_tool.md)
From 905b0ead1198144150f4f63537852ad2e6b1059e Mon Sep 17 00:00:00 2001
From: Jesse
Date: Wed, 10 Aug 2016 14:47:20 +0200
Subject: [PATCH 003/128] Update using_pipeline_tool.md
---
Documentation/using_pipeline_tool.md | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/Documentation/using_pipeline_tool.md b/Documentation/using_pipeline_tool.md
index 3fca7416b60..dee5d93d6ac 100644
--- a/Documentation/using_pipeline_tool.md
+++ b/Documentation/using_pipeline_tool.md
@@ -1,4 +1,4 @@
-The [Pipeline Tool](pipeline.md) is used to organize and define content for use with MonoGame. It is installed as part of the MonoGame SDK Installer or can be build [directly from source](https://github.com/mono/MonoGame/tree/develop/Tools/Pipeline) if needed.
+The [Pipeline Tool](pipeline.md) is used to organize and build content for use with MonoGame. It is installed as part of the MonoGame SDK Installer or can be built [directly from source](https://github.com/mono/MonoGame/tree/develop/Tools/Pipeline) if needed.
## Create A Project
@@ -27,7 +27,7 @@ Note that currently the Pipeline tool is not setup to support multiple target pl
## Adding Content Items
-Once you have a project setup you can then add content to it for building. You can do this from the "Edit" menu:
+Once you have a project setup you can add content to it for building. You can do this from the "Edit" menu:
@@ -39,7 +39,7 @@ Selecting "New Item..." will bring up the New Item dialog which displays a list
-When you select "Add Item..." you get to select an existing item from disk to add to the content project.
+When you select "Existing Item..." you get to select an existing item from disk to add to the content project.
## Custom Content Processors
@@ -57,14 +57,18 @@ After you have done these fixes you should be able to add these new processors t
Once you have built your content you have a few different ways to add the XNBs to your game project.
+### MonoGameContentReference
+
+The simplest method is to setup your game project from one of the templates that come with the SDK. When you create a new project it will include a Content.mgcb file with its Build Action set to MonoGameContentReference. This build action is defined in the .targets file [here](https://github.com/MonoGame/MonoGame/blob/develop/MonoGame.Framework.Content.Pipeline/MonoGame.Content.Builder.targets). MonoGameContentReference is set up so that when the project is built, the mgcb will build any new/modified content and copy the resulting xnb's to the output directory so they can be used in the project. The content files do not need to be added to your project.
+
### Manual Copy
-The simplest and method is to simply copy the content into a Content folder under the output folder where you game executable is. This should work for most desktop builds.
+If you don't want to use the automated process, you can build the content project with the Pipeline Tool and copy the xnb's to the output folder of your project manually.
### Add As Content
-If you are using Visual Studio you can simply add the content files into your C# game project. Create a folder in the project called Content then right click on the folder and select Add -> Existing Item.
+If you are using Visual Studio you can simply add the xnb files to your C# game project. Create a folder in the project called Content then right click on the folder and select Add -> Existing Item.
@@ -85,7 +89,7 @@ Once the files are added you need to select them all and change their build acti
### Add With Wildcard
-The more automatic option is to hand edit your game .csproj and have it include you content using wildcards. To do this just open the .csproj with any text editor then add the following after any other ``:
+The more automatic option is to hand edit your game .csproj and have it include you content using wildcards. To do this just open the .csproj with any text editor then add the following after any other ``:
```
@@ -100,4 +104,4 @@ Then any files you put in a Content folder within your game project will automat
## Reporting Bugs
-The MonoGame content pipeline, MGCB, and the Pipeline tool are all very new in MonoGame. If you run into any problems with them please ask for help on the [community site](http://community.monogame.net/) or submit a [bug report on GitHub](https://github.com/mono/MonoGame/issues).
+If you run into any problems with MGCB or the Pipeline tool them please ask for help on the [community site](http://community.monogame.net/) or submit a [bug report on GitHub](https://github.com/MonoGame/MonoGame/issues).
From f0acd4596cb24c4a2ad38c78648d537847a055b6 Mon Sep 17 00:00:00 2001
From: Jesse
Date: Sat, 13 Aug 2016 19:54:55 +0200
Subject: [PATCH 004/128] Fix typo's and clarify using_pipeline_tool
---
Documentation/using_pipeline_tool.md | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/Documentation/using_pipeline_tool.md b/Documentation/using_pipeline_tool.md
index dee5d93d6ac..20da1827815 100644
--- a/Documentation/using_pipeline_tool.md
+++ b/Documentation/using_pipeline_tool.md
@@ -44,7 +44,7 @@ When you select "Existing Item..." you get to select an existing item from disk
## Custom Content Processors
-Justl ike XNA, the MonoGame content pipeline supports custom content processors. To use them you need to rebuild them correctly to work against MonoGame.
+Just like XNA, the MonoGame content pipeline supports custom content processors. To use them you need to rebuild them correctly to work against MonoGame.
The first step is removing all `Microsoft.Xna.Framework.XXX` references and replacing them with references to `MonoGame.Framework` and `MonoGame.Framework.Content.Pipeline`. This is required as you will no longer be building against Microsoft XNA.
@@ -52,14 +52,17 @@ Once you references are working you then need to change your assembly target pla
After you have done these fixes you should be able to add these new processors to the content project "References".
+## Building Content
+
+The Pipeline Tool has 3 actions related to building content: Build, Rebuild and Clean. Build will build all content that needs to be built and put the xnb's in the output directory (bin by default). Content will be skipped if it hasn't changed since the last build. The time source content was last edited is saved in the intermediate directory (obj by default) to determine if content changed since the last build. Clean will empty the output and intermediate directories. Rebuild will first Clean and then Build.
## Linking Content To Your Game
-Once you have built your content you have a few different ways to add the XNBs to your game project.
+Once you have built your content you have a few different ways to add the xnb's to your game project. They all have the same goal, to get the built xnb's in your project output folder so a ContentManager can easily find and load them.
### MonoGameContentReference
-The simplest method is to setup your game project from one of the templates that come with the SDK. When you create a new project it will include a Content.mgcb file with its Build Action set to MonoGameContentReference. This build action is defined in the .targets file [here](https://github.com/MonoGame/MonoGame/blob/develop/MonoGame.Framework.Content.Pipeline/MonoGame.Content.Builder.targets). MonoGameContentReference is set up so that when the project is built, the mgcb will build any new/modified content and copy the resulting xnb's to the output directory so they can be used in the project. The content files do not need to be added to your project.
+The simplest method is to setup your game project from one of the templates that come with the SDK. When you create a new project it will include a Content.mgcb file with its Build Action set to MonoGameContentReference. This build action is defined in the .targets file [here](https://github.com/MonoGame/MonoGame/blob/develop/MonoGame.Framework.Content.Pipeline/MonoGame.Content.Builder.targets). MonoGameContentReference is set up so that when the project is built, the mgcb will build any new/modified content and copy the resulting xnb's to the project output directory so they can be used in the project. Note that this way you don't even have to manually build the content with the Pipeline Tool. Just add your content to the .mgcb with the Pipeline Tool and the rest will happen when you build your project. The content files do not need to be added to your project.
### Manual Copy
@@ -104,4 +107,4 @@ Then any files you put in a Content folder within your game project will automat
## Reporting Bugs
-If you run into any problems with MGCB or the Pipeline tool them please ask for help on the [community site](http://community.monogame.net/) or submit a [bug report on GitHub](https://github.com/MonoGame/MonoGame/issues).
+If you run into any problems with MGCB or the Pipeline Tool, please ask for help on the [community site](http://community.monogame.net/) or submit a [bug report on GitHub](https://github.com/MonoGame/MonoGame/issues).
From d7a7f1d55f5f6174359b557b52060b16f811bea9 Mon Sep 17 00:00:00 2001
From: Dean Ellis
Date: Mon, 29 Feb 2016 16:52:09 +0000
Subject: [PATCH 005/128] Upgrade Xamarin Studio Addin for Version 6.0
---
.../MonoDevelop.MonoGame.Android.csproj | 4 +-
.../MonoDevelop.MonoGame.Mac.csproj | 8 --
.../templates/MonoGameOSXProject.xpt.xml | 7 +-
.../templates/MonoGameXamMacProject.xpt.xml | 11 +-
.../ContentItemTemplate.cs | 7 +-
.../MonoDevelop.MonoGame.addin.xml | 13 +-
.../MonoDevelop.MonoGame.csproj | 6 +-
.../MonoGameMSBuildImports.cs | 134 +++++++++---------
.../MonoDevelop.MonoGame/MonoGameProject.cs | 3 +-
.../templates/MonoGamePipelineProject.xpt.xml | 2 +-
default.build | 8 +-
11 files changed, 107 insertions(+), 96 deletions(-)
diff --git a/IDE/MonoDevelop/MonoDevelop.MonoGame.Android/MonoDevelop.MonoGame.Android.csproj b/IDE/MonoDevelop/MonoDevelop.MonoGame.Android/MonoDevelop.MonoGame.Android.csproj
index b8cb33f833b..2162f02f08e 100644
--- a/IDE/MonoDevelop/MonoDevelop.MonoGame.Android/MonoDevelop.MonoGame.Android.csproj
+++ b/IDE/MonoDevelop/MonoDevelop.MonoGame.Android/MonoDevelop.MonoGame.Android.csproj
@@ -62,7 +62,6 @@
-
@@ -108,4 +107,7 @@
PreserveNewest
+
+
+
diff --git a/IDE/MonoDevelop/MonoDevelop.MonoGame.Mac/MonoDevelop.MonoGame.Mac.csproj b/IDE/MonoDevelop/MonoDevelop.MonoGame.Mac/MonoDevelop.MonoGame.Mac.csproj
index c8153acaaec..888733b7cfa 100644
--- a/IDE/MonoDevelop/MonoDevelop.MonoGame.Mac/MonoDevelop.MonoGame.Mac.csproj
+++ b/IDE/MonoDevelop/MonoDevelop.MonoGame.Mac/MonoDevelop.MonoGame.Mac.csproj
@@ -39,18 +39,10 @@
/Applications/Xamarin Studio.app/Contents/Resources/lib/monodevelop/bin/MonoDevelop.Core.dll
False
-
- /Applications/Xamarin Studio.app/Contents/Resources/lib/monodevelop/AddIns/MonoDevelop.MonoMac/MonoDevelop.MonoMac.dll
- False
-
/Applications/Xamarin Studio.app/Contents/Resources/lib/monodevelop/AddIns/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.dll
False
-
- /Applications/Xamarin Studio.app/Contents/Resources/lib/monodevelop/AddIns/MonoDevelop.MacDev/MonoDevelop.MacDev.dll
- False
-
diff --git a/IDE/MonoDevelop/MonoDevelop.MonoGame.Mac/templates/MonoGameOSXProject.xpt.xml b/IDE/MonoDevelop/MonoDevelop.MonoGame.Mac/templates/MonoGameOSXProject.xpt.xml
index 39676ae2f16..0ab9c08f043 100644
--- a/IDE/MonoDevelop/MonoDevelop.MonoGame.Mac/templates/MonoGameOSXProject.xpt.xml
+++ b/IDE/MonoDevelop/MonoDevelop.MonoGame.Mac/templates/MonoGameOSXProject.xpt.xml
@@ -27,8 +27,6 @@
-
-
@@ -41,6 +39,11 @@
+
+
+
+
+
diff --git a/IDE/MonoDevelop/MonoDevelop.MonoGame.Mac/templates/MonoGameXamMacProject.xpt.xml b/IDE/MonoDevelop/MonoDevelop.MonoGame.Mac/templates/MonoGameXamMacProject.xpt.xml
index 712488048eb..d49598230c7 100644
--- a/IDE/MonoDevelop/MonoDevelop.MonoGame.Mac/templates/MonoGameXamMacProject.xpt.xml
+++ b/IDE/MonoDevelop/MonoDevelop.MonoGame.Mac/templates/MonoGameXamMacProject.xpt.xml
@@ -27,8 +27,6 @@
-
-
@@ -42,6 +40,15 @@
+
+
+
+
+
+
+
+
+
diff --git a/IDE/MonoDevelop/MonoDevelop.MonoGame/ContentItemTemplate.cs b/IDE/MonoDevelop/MonoDevelop.MonoGame/ContentItemTemplate.cs
index 1ab59e10dac..27564325e14 100644
--- a/IDE/MonoDevelop/MonoDevelop.MonoGame/ContentItemTemplate.cs
+++ b/IDE/MonoDevelop/MonoDevelop.MonoGame/ContentItemTemplate.cs
@@ -31,10 +31,11 @@ public override void Load (XmlElement filenode, FilePath baseDirectory)
}
}
- public override bool AddToProject (SolutionItem policyParent, Project project, string language, string directory, string name)
+ public override bool AddToProject(SolutionFolderItem policyParent, Project project, string language, string directory, string name)
{
- ProjectFile file = template.AddFileToProject (policyParent, project, language, directory, name);
- if (file != null) {
+ ProjectFile file = template.AddFileToProject(policyParent, project, language, directory, name);
+ if (file != null)
+ {
file.BuildAction = BuildAction.Content;
file.CopyToOutputDirectory = mode;
return true;
diff --git a/IDE/MonoDevelop/MonoDevelop.MonoGame/MonoDevelop.MonoGame.addin.xml b/IDE/MonoDevelop/MonoDevelop.MonoGame/MonoDevelop.MonoGame.addin.xml
index 77e6e2ba2f8..aebdd78e5e7 100644
--- a/IDE/MonoDevelop/MonoDevelop.MonoGame/MonoDevelop.MonoGame.addin.xml
+++ b/IDE/MonoDevelop/MonoDevelop.MonoGame/MonoDevelop.MonoGame.addin.xml
@@ -89,8 +89,8 @@
-
-
+
+
@@ -99,14 +99,15 @@
-
+
+
+ -->
@@ -121,9 +122,11 @@
+
@@ -163,9 +166,11 @@
+
diff --git a/IDE/MonoDevelop/MonoDevelop.MonoGame/MonoDevelop.MonoGame.csproj b/IDE/MonoDevelop/MonoDevelop.MonoGame/MonoDevelop.MonoGame.csproj
index acb5a9f2c6e..b2ab7cfc140 100644
--- a/IDE/MonoDevelop/MonoDevelop.MonoGame/MonoDevelop.MonoGame.csproj
+++ b/IDE/MonoDevelop/MonoDevelop.MonoGame/MonoDevelop.MonoGame.csproj
@@ -71,10 +71,8 @@
-
-
@@ -241,4 +239,8 @@
+
+
+
+
diff --git a/IDE/MonoDevelop/MonoDevelop.MonoGame/MonoGameMSBuildImports.cs b/IDE/MonoDevelop/MonoDevelop.MonoGame/MonoGameMSBuildImports.cs
index 6cc88f9b6dc..fa33621e7fe 100644
--- a/IDE/MonoDevelop/MonoDevelop.MonoGame/MonoGameMSBuildImports.cs
+++ b/IDE/MonoDevelop/MonoDevelop.MonoGame/MonoGameMSBuildImports.cs
@@ -2,56 +2,60 @@
using System.Xml;
using System.Xml.XPath;
using System.Linq;
-using MonoDevelop.Projects.Formats.MSBuild;
using System.Collections.Generic;
+using MonoDevelop.Projects.MSBuild;
using MonoDevelop.Projects;
namespace MonoDevelop.MonoGame
{
- public class MonoGameMSBuildImports : MSBuildExtension
+ public class MonoGameMSBuildImports : DotNetProjectExtension
{
const string MonoGameContentBuildTargets = "$(MSBuildExtensionsPath)\\MonoGame\\v3.0\\MonoGame.Content.Builder.targets";
const string MonoGameCommonProps = "$(MSBuildExtensionsPath)\\MonoGame\\v3.0\\MonoGame.Common.props";
const string MonoGameExtensionsPath = @"$(MonoGameInstallDirectory)\MonoGame\v3.0\Assemblies\{0}\{1}";
const string MonoGameExtensionsAbsolutePath = @"/Library/Frameworks/MonoGame.framework/v3.0/Assemblies/{0}/{1}";
- static bool UpgradeMonoGameProject (MonoDevelop.Core.IProgressMonitor monitor, MonoDevelop.Projects.SolutionEntityItem item, MSBuildProject project)
+ static bool UpgradeMonoGameProject (MonoDevelop.Core.ProgressMonitor monitor, DotNetProjectExtension extension, MSBuildProject project)
{
bool needsSave = false;
bool containsMGCB = project.ItemGroups.Any (x => x.Items.Any (i => System.IO.Path.GetExtension (i.Include) == ".mgcb"));
- bool isMonoGame = project.PropertyGroups.Any (x => x.Properties.Any (p => p.Name == "MonoGamePlatform")) ||
+ bool isMonoGame = project.PropertyGroups.Any (x => x.GetProperties().Any (p => p.Name == "MonoGamePlatform")) ||
project.ItemGroups.Any (x => x.Items.Any (i => i.Name == "Reference" && i.Include == "MonoGame.Framework")) ||
containsMGCB;
- bool isApplication = project.PropertyGroups.Any (x => x.Properties.Any (p => p.Name == "OutputType" && p.GetValue () == "Exe")) ||
- project.PropertyGroups.Any (x => x.Properties.Any (p => p.Name == "AndroidApplication" && string.Compare (p.GetValue (), bool.TrueString, true)==0));
- bool isShared = project.PropertyGroups.Any (x => x.Properties.Any (p => p.Name == "HasSharedItems" && p.GetValue () == "true"));
- var type = item.GetType ().Name;
+ bool isDesktopGL = project.ItemGroups.Any (x => x.Items.Any (i => i.Include.EndsWith ("SDL2.dll")));
+ bool isApplication = project.PropertyGroups.Any (x => x.GetProperties().Any (p => p.Name == "OutputType" && p.Value == "Exe"))
+ | project.PropertyGroups.Any (x => x.GetProperties().Any (p => p.Name == "AndroidApplication" && string.Compare (p.Value, bool.TrueString, true)==0));
+ bool isShared = project.PropertyGroups.Any (x => x.GetProperties().Any (p => p.Name == "HasSharedItems" && p.Value == "true"));
+ bool absoluteReferenes = false;
+ var type = extension.Project.GetType ().Name;
+
monitor.Log.WriteLine ("Found {0}", type);
- var platform = Environment.OSVersion.Platform == PlatformID.Win32NT ? "Windows" : "DesktopGL";
+ monitor.Log.WriteLine ("Found {0}", project.GetType ().Name);
+ var platform = isDesktopGL ? "DesktopGL" : "Windows";
var path = MonoGameExtensionsPath;
- switch (type) {
- case "XamarinIOSProject":
+ if (extension.Project.FlavorGuids.Contains ("{FEACFBD2-3405-455C-9665-78FE426C6842}")) {
platform = "iOS";
- break;
- case "MonoDroidProject":
+ }
+ if (extension.Project.FlavorGuids.Contains ("{06FA79CB-D6CD-4721-BB4B-1BD202089C55}")) {
+ platform = "tvOS";
+ }
+ if (extension.Project.FlavorGuids.Contains ("{EFBA0AD7-5A72-4C68-AF49-83D382785DCF}")) {
platform = "Android";
- break;
- case "XamMac2Project":
- case "MonoGameProject":
- platform = "DesktopGL";
- break;
- case "XamMac":
- case "XamMacProject":
- platform = "DesktopGL";
- // Xamarin.Mac Classic does not use MSBuild so we need to absolute path.
- path = MonoGameExtensionsAbsolutePath;
- break;
- case "MonoMac":
- case "MonoMacProject":
+ }
+ if (extension.Project.FlavorGuids.Contains ("{948B3504-5B70-4649-8FE4-BDE1FB46EC69}")) {
platform = "MacOSX";
+ // MonoMac Classic does not use MSBuild so we need to absolute path.
+ path = MonoGameExtensionsAbsolutePath;
+ absoluteReferenes = true;
+ }
+ if (extension.Project.FlavorGuids.Contains ("{42C0BBD9-55CE-4FC1-8D90-A7348ABAFB23}")) {
+ platform = "DesktopGL";
// Xamarin.Mac Classic does not use MSBuild so we need to absolute path.
path = MonoGameExtensionsAbsolutePath;
- break;
+ absoluteReferenes = true;
+ }
+ if (extension.Project.FlavorGuids.Contains ("{A3F8F2AB-B479-4A4A-A458-A89E7DC349F1}")) {
+ platform = "DesktopGL";
}
monitor.Log.WriteLine ("Platform = {0}", platform);
monitor.Log.WriteLine ("Path = {0}", path);
@@ -60,31 +64,28 @@ static bool UpgradeMonoGameProject (MonoDevelop.Core.IProgressMonitor monitor, M
var ritems = new List ();
foreach (var ig in project.ItemGroups) {
foreach (var i in ig.Items.Where (x => x.Name == "Reference" && x.Include == "MonoGame.Framework")) {
- if (!i.HasMetadata ("HintPath")) {
+ var metaData = i.Metadata;
+ if (!metaData.HasProperty("HintPath")) {
monitor.Log.WriteLine ("Fixing {0} to be MonoGameContentReference", i.Include);
- var a = ig.AddNewItem ("Reference", i.Include);
- a.SetMetadata ("HintPath", string.Format (path, platform, "MonoGame.Framework.dll"));
- ritems.Add (i);
+ metaData.SetValue ("HintPath", string.Format (path, platform, "MonoGame.Framework.dll"));
needsSave = true;
}
}
foreach (var i in ig.Items.Where (x => x.Name == "Reference" && x.Include == "Tao.Sdl")) {
- if (!i.HasMetadata ("HintPath")) {
+ var metaData = i.Metadata;
+ if (!metaData.HasProperty("HintPath")) {
monitor.Log.WriteLine ("Fixing {0} to be Tao.Sdl", i.Include);
- var a = ig.AddNewItem ("Reference", i.Include);
- a.SetMetadata ("HintPath", string.Format (path, platform, "Tao.Sdl.dll"));
- ritems.Add (i);
+ metaData.SetValue ("HintPath", string.Format (path, platform, "Tao.Sdl.dll"));
needsSave = true;
}
}
foreach (var i in ig.Items.Where (x => x.Name == "Reference" && x.Include.StartsWith ("OpenTK") &&
(platform != "iOS" && platform != "Android"))) {
- if (!i.HasMetadata ("HintPath")) {
- monitor.Log.WriteLine ("Fixing {0} to be OpenTK", i.Include);
- var a = ig.AddNewItem ("Reference", i.Include);
- a.SetMetadata ("HintPath", string.Format (path, platform, "OpenTK.dll"));
- a.SetMetadata ("SpecificVersion", "true");
- ritems.Add (i);
+ var metaData = i.Metadata;
+ if (!metaData.HasProperty ("HintPath")) {
+ monitor.Log.WriteLine("Fixing {0} to be OpenTK", i.Include);
+ metaData.SetValue ("HintPath", string.Format (path, platform, "OpenTK.dll"));
+ metaData.SetValue ("SpecificVersion", "true");
needsSave = true;
}
}
@@ -92,22 +93,22 @@ static bool UpgradeMonoGameProject (MonoDevelop.Core.IProgressMonitor monitor, M
foreach (var a in ritems) {
project.RemoveItem (a);
}
- var dotNetProject = item as DotNetProject;
- if (dotNetProject != null && (type == "MonoMacProject" || type == "XamMacProject" )) {
+ var dotNetProject = extension.Project;
+ if (dotNetProject != null && absoluteReferenes) {
var items = new List ();
var newitems = new List ();
foreach (var reference in dotNetProject.References) {
if (reference.Reference == "MonoGame.Framework" && string.IsNullOrEmpty (reference.HintPath)) {
items.Add (reference);
- newitems.Add (new ProjectReference (ReferenceType.Assembly, reference.Reference, string.Format (path, platform, "MonoGame.Framework.dll")));
+ newitems.Add (ProjectReference.CreateCustomReference (ReferenceType.Assembly, reference.Reference, string.Format(path, platform, "MonoGame.Framework.dll")));
}
- if (reference.Reference.StartsWith ("OpenTK") && string.IsNullOrEmpty (reference.HintPath)) {
+ if (reference.Reference.StartsWith ("OpenTK", StringComparison.OrdinalIgnoreCase) && string.IsNullOrEmpty (reference.HintPath)) {
items.Add (reference);
- newitems.Add (new ProjectReference (ReferenceType.Assembly, reference.Reference, string.Format (path, platform, "OpenTK.dll")));
+ newitems.Add (ProjectReference.CreateCustomReference (ReferenceType.Assembly, reference.Reference, string.Format (path, platform, "OpenTK.dll")));
}
if (reference.Reference == "Tao.Sdl" && string.IsNullOrEmpty (reference.HintPath)) {
items.Add (reference);
- newitems.Add (new ProjectReference (ReferenceType.Assembly, reference.Reference, string.Format (path, platform, "Tao.Sdl.dll")));
+ newitems.Add (ProjectReference.CreateCustomReference (ReferenceType.Assembly, reference.Reference, string.Format (path, platform, "Tao.Sdl.dll")));
}
}
dotNetProject.References.RemoveRange (items);
@@ -115,21 +116,14 @@ static bool UpgradeMonoGameProject (MonoDevelop.Core.IProgressMonitor monitor, M
}
}
if (isMonoGame && containsMGCB && (isApplication || isShared)) {
- if (!project.PropertyGroups.Any (x => x.Properties.Any (p => p.Name == "MonoGamePlatform")) && !isShared) {
- monitor.Log.WriteLine ("Adding MonoGamePlatform", platform);
- project.PropertyGroups.First ().SetPropertyValue ("MonoGamePlatform", platform, true);
+ if (!project.PropertyGroups.Any (x => x.GetProperties().Any (p => p.Name == "MonoGamePlatform")) && !isShared) {
+ monitor.Log.WriteLine ("Adding MonoGamePlatform {0}", platform == "tvOS" ? "iOS" : platform);
+ project.PropertyGroups.First ().SetValue ("MonoGamePlatform", platform == "tvOS" ? "iOS" : platform, true);
needsSave = true;
}
if (!project.Imports.Any (x => x.Project.StartsWith (MonoGameCommonProps, StringComparison.OrdinalIgnoreCase))&& !isShared) {
monitor.Log.WriteLine ("Adding MonoGame.Common.props Import");
- var e = project.Document.DocumentElement;
- var manager = new XmlNamespaceManager (new NameTable ());
- var schema = "http://schemas.microsoft.com/developer/msbuild/2003";
- manager.AddNamespace ("tns", schema);
- var import = project.Document.CreateElement ("Import", schema);
- import.SetAttribute ("Project", MonoGameCommonProps);
- import.SetAttribute ("Condition", string.Format ("Exists('{0}')", MonoGameCommonProps));
- project.Document.DocumentElement.InsertBefore (import, project.Document.DocumentElement.FirstChild);
+ project.AddNewImport(MonoGameCommonProps, string.Format ("Exists('{0}')", MonoGameCommonProps), project.PropertyGroups.First());
needsSave = true;
}
if (containsMGCB) {
@@ -157,21 +151,25 @@ static bool UpgradeMonoGameProject (MonoDevelop.Core.IProgressMonitor monitor, M
return needsSave;
}
- public override void LoadProject (MonoDevelop.Core.IProgressMonitor monitor, MonoDevelop.Projects.SolutionEntityItem item, MSBuildProject project)
+ protected override void OnWriteProject(MonoDevelop.Core.ProgressMonitor monitor, MSBuildProject msproject)
{
- var changed = (UpgradeMonoGameProject (monitor, item, project));
- base.LoadProject (monitor, item, project);
- if (changed) {
- project.Save (project.FileName);
+ base.OnWriteProject(monitor, msproject);
+ var changed = UpgradeMonoGameProject (monitor, this, msproject);
+ if (changed)
+ {
+ msproject.Save(msproject.FileName);
+ this.Project.NeedsReload = true;
}
}
- public override void SaveProject (MonoDevelop.Core.IProgressMonitor monitor, MonoDevelop.Projects.SolutionEntityItem item, MSBuildProject project)
+ protected override void OnReadProject(MonoDevelop.Core.ProgressMonitor monitor, MSBuildProject msproject)
{
- var changed = UpgradeMonoGameProject (monitor, item, project);
- base.SaveProject (monitor, item, project);
- if (changed) {
- this.LoadProject (monitor, item, project);
+ base.OnReadProject (monitor, msproject);
+ var changed = (UpgradeMonoGameProject(monitor, this, msproject));
+ if (changed)
+ {
+ msproject.Save (msproject.FileName);
+ this.Project.NeedsReload = true;
}
}
}
diff --git a/IDE/MonoDevelop/MonoDevelop.MonoGame/MonoGameProject.cs b/IDE/MonoDevelop/MonoDevelop.MonoGame/MonoGameProject.cs
index f76d41fdc48..cbbe891525e 100644
--- a/IDE/MonoDevelop/MonoDevelop.MonoGame/MonoGameProject.cs
+++ b/IDE/MonoDevelop/MonoDevelop.MonoGame/MonoGameProject.cs
@@ -1,7 +1,8 @@
using System;
-using MonoDevelop.Projects;
+using MonoDevelop.Projects.MSBuild;
using MonoDevelop.Core.Assemblies;
using System.Xml;
+using MonoDevelop.Projects;
namespace MonoDevelop.MonoGame
{
diff --git a/IDE/MonoDevelop/MonoDevelop.MonoGame/templates/MonoGamePipelineProject.xpt.xml b/IDE/MonoDevelop/MonoDevelop.MonoGame/templates/MonoGamePipelineProject.xpt.xml
index e58c278b12c..6e329adc742 100644
--- a/IDE/MonoDevelop/MonoDevelop.MonoGame/templates/MonoGamePipelineProject.xpt.xml
+++ b/IDE/MonoDevelop/MonoDevelop.MonoGame/templates/MonoGamePipelineProject.xpt.xml
@@ -13,7 +13,7 @@
-
+
diff --git a/default.build b/default.build
index 7f5c8868e0c..4458382f431 100644
--- a/default.build
+++ b/default.build
@@ -164,11 +164,11 @@
-
-
+
+
-
-
+
+
From 97a265d8a806cf7ba52790ad909c917bbcb1be9f Mon Sep 17 00:00:00 2001
From: Jesse Gielen
Date: Fri, 23 Sep 2016 00:36:25 +0200
Subject: [PATCH 006/128] Fix some compiler warnings
---
.../Builder/PipelineManager.cs | 1 -
.../Processors/EffectProcessor.cs | 2 +-
.../Intermediate/NamespaceAliasHelper.cs | 2 +-
MonoGame.Framework/Audio/OpenAL.cs | 1 -
.../Audio/OpenALSoundController.cs | 9 +++---
.../Audio/Xact/ReverbSettings.cs | 2 --
MonoGame.Framework/Color.cs | 2 +-
MonoGame.Framework/Graphics/ClearOptions.cs | 2 +-
.../Graphics/GraphicsAdapter.DirectX.cs | 2 +-
MonoGame.Framework/Graphics/GraphicsDevice.cs | 14 ++++----
.../Graphics/GraphicsMetrics.cs | 32 +++++++++----------
MonoGame.Framework/Graphics/ModelMesh.cs | 2 +-
MonoGame.Framework/Graphics/SpriteBatcher.cs | 2 +-
MonoGame.Framework/Graphics/States/Blend.cs | 2 +-
.../Graphics/Texture2D.DirectX.cs | 1 -
.../Graphics/Texture3D.DirectX.cs | 2 --
MonoGame.Framework/Input/GamePad.XInput.cs | 2 +-
.../Utilities/ZLibStream/ZlibStream.cs | 2 +-
Test/ContentPipeline/AudioContentTests.cs | 2 --
Test/Framework/TestGameBase.cs | 2 +-
Test/Runner/Interface/CommandLineInterface.cs | 2 +-
Tools/2MGFX/Properties/AssemblyInfo.cs | 6 +++-
.../PipelineController.ExcludeAction.cs | 2 +-
Tools/Pipeline/Common/PipelineController.cs | 2 +-
24 files changed, 46 insertions(+), 52 deletions(-)
diff --git a/MonoGame.Framework.Content.Pipeline/Builder/PipelineManager.cs b/MonoGame.Framework.Content.Pipeline/Builder/PipelineManager.cs
index d781bad942b..d3a7da064de 100644
--- a/MonoGame.Framework.Content.Pipeline/Builder/PipelineManager.cs
+++ b/MonoGame.Framework.Content.Pipeline/Builder/PipelineManager.cs
@@ -59,7 +59,6 @@ private struct ProcessorInfo
public string IntermediateDirectory { get; private set; }
private ContentCompiler _compiler;
- private MethodInfo _compileMethod;
public ContentBuildLogger Logger { get; set; }
diff --git a/MonoGame.Framework.Content.Pipeline/Processors/EffectProcessor.cs b/MonoGame.Framework.Content.Pipeline/Processors/EffectProcessor.cs
index 9d016b9e5ee..f04d9a55732 100644
--- a/MonoGame.Framework.Content.Pipeline/Processors/EffectProcessor.cs
+++ b/MonoGame.Framework.Content.Pipeline/Processors/EffectProcessor.cs
@@ -96,7 +96,7 @@ public override CompiledEffectContent Process(EffectContent input, ContentProces
foreach (var outfile in shaderInfo.AdditionalOutputFiles)
context.AddOutputFile(outfile);
}
- catch (ShaderCompilerException ex)
+ catch (ShaderCompilerException)
{
// This will log any warnings and errors and throw.
ProcessErrorsAndWarnings(true, shaderErrorsAndWarnings, input, context);
diff --git a/MonoGame.Framework.Content.Pipeline/Serialization/Intermediate/NamespaceAliasHelper.cs b/MonoGame.Framework.Content.Pipeline/Serialization/Intermediate/NamespaceAliasHelper.cs
index fc7dae29ce6..2d7b3e65c30 100644
--- a/MonoGame.Framework.Content.Pipeline/Serialization/Intermediate/NamespaceAliasHelper.cs
+++ b/MonoGame.Framework.Content.Pipeline/Serialization/Intermediate/NamespaceAliasHelper.cs
@@ -136,7 +136,7 @@ private static AliasedNamespace FindAlias(Dictionary a
}
///
- /// Returns just the portion relative to .
+ /// Returns just the portion relative to .
/// For example, given namespaceParent=Foo.Bar and @namespace=Foo.Bar.Baz, will return Baz.
///
private static string GetRelativeNamespace(string namespaceParent, string @namespace)
diff --git a/MonoGame.Framework/Audio/OpenAL.cs b/MonoGame.Framework/Audio/OpenAL.cs
index 8e486b86374..b72ec2440d6 100644
--- a/MonoGame.Framework/Audio/OpenAL.cs
+++ b/MonoGame.Framework/Audio/OpenAL.cs
@@ -325,7 +325,6 @@ public static void DeleteSource(int source)
[DllImport (NativeLibName, CallingConvention = CallingConvention.Cdecl, EntryPoint = "alSourceStop")]
public static extern void SourceStop (int sourceId);
- [CLSCompliant (false)]
[DllImport (NativeLibName, CallingConvention = CallingConvention.Cdecl, EntryPoint = "alSourcei")]
internal static extern void Source (int sourceId, int i, int a);
diff --git a/MonoGame.Framework/Audio/OpenALSoundController.cs b/MonoGame.Framework/Audio/OpenALSoundController.cs
index 02f3ce79308..2d487567063 100644
--- a/MonoGame.Framework/Audio/OpenALSoundController.cs
+++ b/MonoGame.Framework/Audio/OpenALSoundController.cs
@@ -406,12 +406,11 @@ void Dispose(bool disposing)
}
///
- /// Reserves the given sound buffer. If there are no available sources then false is
- /// returned, otherwise true will be returned and the sound buffer can be played. If
- /// the controller was not able to setup the hardware, then false will be returned.
+ /// Reserves a sound buffer and return its identifier. If there are no available sources
+ /// or the controller was not able to setup the hardware then an
+ /// is thrown.
///
- /// The sound buffer you want to play
- /// True if the buffer can be played, and false if not.
+ /// The source number of the reserved sound buffer.
public int ReserveSource()
{
if (!CheckInitState())
diff --git a/MonoGame.Framework/Audio/Xact/ReverbSettings.cs b/MonoGame.Framework/Audio/Xact/ReverbSettings.cs
index 26add3ad246..6c414f5f596 100644
--- a/MonoGame.Framework/Audio/Xact/ReverbSettings.cs
+++ b/MonoGame.Framework/Audio/Xact/ReverbSettings.cs
@@ -11,8 +11,6 @@ class ReverbSettings
{
private readonly DspParameter[] _parameters = new DspParameter[22];
- private bool _dirty;
-
public ReverbSettings(BinaryReader reader)
{
_parameters[0] = new DspParameter(reader); // ReflectionsDelayMs
diff --git a/MonoGame.Framework/Color.cs b/MonoGame.Framework/Color.cs
index 75afbbaf28a..bbfc61b9ec4 100644
--- a/MonoGame.Framework/Color.cs
+++ b/MonoGame.Framework/Color.cs
@@ -1788,7 +1788,7 @@ public Vector4 ToVector4()
return new Vector4(R / 255.0f, G / 255.0f, B / 255.0f, A / 255.0f);
}
- ///
+ ///
/// Gets or sets packed value of this .
///
[CLSCompliant(false)]
diff --git a/MonoGame.Framework/Graphics/ClearOptions.cs b/MonoGame.Framework/Graphics/ClearOptions.cs
index 10a24ffe0d1..f580572446a 100644
--- a/MonoGame.Framework/Graphics/ClearOptions.cs
+++ b/MonoGame.Framework/Graphics/ClearOptions.cs
@@ -7,7 +7,7 @@
namespace Microsoft.Xna.Framework.Graphics
{
///
- /// Defines the buffers for clearing when calling operation.
+ /// Defines the buffers for clearing when calling operation.
///
[Flags]
public enum ClearOptions
diff --git a/MonoGame.Framework/Graphics/GraphicsAdapter.DirectX.cs b/MonoGame.Framework/Graphics/GraphicsAdapter.DirectX.cs
index 07644a690cb..a5cc88225d1 100644
--- a/MonoGame.Framework/Graphics/GraphicsAdapter.DirectX.cs
+++ b/MonoGame.Framework/Graphics/GraphicsAdapter.DirectX.cs
@@ -79,7 +79,7 @@ private static GraphicsAdapter CreateAdapter(SharpDX.DXGI.Adapter1 device, Sharp
{
displayModes = monitor.GetDisplayModeList(formatTranslation.Key, 0);
}
- catch (SharpDX.SharpDXException ex)
+ catch (SharpDX.SharpDXException)
{
var mode = new DisplayMode(desktopWidth, desktopHeight, SurfaceFormat.Color);
modes.Add(mode);
diff --git a/MonoGame.Framework/Graphics/GraphicsDevice.cs b/MonoGame.Framework/Graphics/GraphicsDevice.cs
index 544356556e3..424391682bb 100644
--- a/MonoGame.Framework/Graphics/GraphicsDevice.cs
+++ b/MonoGame.Framework/Graphics/GraphicsDevice.cs
@@ -733,7 +733,7 @@ public void SetRenderTargets(params RenderTargetBinding[] renderTargets)
{
unchecked
{
- _graphicsMetrics._targetCount += (ulong)renderTargetCount;
+ _graphicsMetrics._targetCount += renderTargetCount;
}
}
}
@@ -927,7 +927,7 @@ public void DrawIndexedPrimitives(PrimitiveType primitiveType, int baseVertex, i
unchecked
{
_graphicsMetrics._drawCount++;
- _graphicsMetrics._primitiveCount += (ulong)primitiveCount;
+ _graphicsMetrics._primitiveCount += primitiveCount;
}
}
@@ -963,7 +963,7 @@ public void DrawUserPrimitives(PrimitiveType primitiveType, T[] vertexData, i
unchecked
{
_graphicsMetrics._drawCount++;
- _graphicsMetrics._primitiveCount += (ulong) primitiveCount;
+ _graphicsMetrics._primitiveCount += primitiveCount;
}
}
@@ -985,7 +985,7 @@ public void DrawPrimitives(PrimitiveType primitiveType, int vertexStart, int pri
unchecked
{
_graphicsMetrics._drawCount++;
- _graphicsMetrics._primitiveCount += (ulong) primitiveCount;
+ _graphicsMetrics._primitiveCount += primitiveCount;
}
}
@@ -1031,7 +1031,7 @@ public void DrawUserIndexedPrimitives(PrimitiveType primitiveType, T[] vertex
unchecked
{
_graphicsMetrics._drawCount++;
- _graphicsMetrics._primitiveCount += (ulong) primitiveCount;
+ _graphicsMetrics._primitiveCount += primitiveCount;
}
}
@@ -1077,7 +1077,7 @@ public void DrawUserIndexedPrimitives(PrimitiveType primitiveType, T[] vertex
unchecked
{
_graphicsMetrics._drawCount++;
- _graphicsMetrics._primitiveCount += (ulong) primitiveCount;
+ _graphicsMetrics._primitiveCount += primitiveCount;
}
}
@@ -1101,7 +1101,7 @@ public void DrawInstancedPrimitives(PrimitiveType primitiveType, int baseVertex,
unchecked
{
_graphicsMetrics._drawCount++;
- _graphicsMetrics._primitiveCount += (ulong)(primitiveCount * instanceCount);
+ _graphicsMetrics._primitiveCount += (primitiveCount * instanceCount);
}
}
diff --git a/MonoGame.Framework/Graphics/GraphicsMetrics.cs b/MonoGame.Framework/Graphics/GraphicsMetrics.cs
index 44820c3df9a..feb30f34ef3 100644
--- a/MonoGame.Framework/Graphics/GraphicsMetrics.cs
+++ b/MonoGame.Framework/Graphics/GraphicsMetrics.cs
@@ -9,54 +9,54 @@ namespace Microsoft.Xna.Framework.Graphics
///
public struct GraphicsMetrics
{
- internal ulong _clearCount;
- internal ulong _drawCount;
- internal ulong _pixelShaderCount;
- internal ulong _primitiveCount;
- internal ulong _spriteCount;
- internal ulong _targetCount;
- internal ulong _textureCount;
- internal ulong _vertexShaderCount;
+ internal long _clearCount;
+ internal long _drawCount;
+ internal long _pixelShaderCount;
+ internal long _primitiveCount;
+ internal long _spriteCount;
+ internal long _targetCount;
+ internal long _textureCount;
+ internal long _vertexShaderCount;
///
/// Number of times Clear was called.
///
- public ulong ClearCount { get { return _clearCount; } }
+ public long ClearCount { get { return _clearCount; } }
///
/// Number of times Draw was called.
///
- public ulong DrawCount { get { return _drawCount; } }
+ public long DrawCount { get { return _drawCount; } }
///
/// Number of times the pixel shader was changed on the GPU.
///
- public ulong PixelShaderCount { get { return _pixelShaderCount; } }
+ public long PixelShaderCount { get { return _pixelShaderCount; } }
///
/// Number of rendered primitives.
///
- public ulong PrimitiveCount { get { return _primitiveCount; } }
+ public long PrimitiveCount { get { return _primitiveCount; } }
///
/// Number of sprites and text characters rendered via .
///
- public ulong SpriteCount { get { return _spriteCount; } }
+ public long SpriteCount { get { return _spriteCount; } }
///
/// Number of times a target was changed on the GPU.
///
- public ulong TargetCount {get { return _targetCount; } }
+ public long TargetCount {get { return _targetCount; } }
///
/// Number of times a texture was changed on the GPU.
///
- public ulong TextureCount { get { return _textureCount; } }
+ public long TextureCount { get { return _textureCount; } }
///
/// Number of times the vertex shader was changed on the GPU.
///
- public ulong VertexShaderCount { get { return _vertexShaderCount; } }
+ public long VertexShaderCount { get { return _vertexShaderCount; } }
///
/// Returns the difference between two sets of metrics.
diff --git a/MonoGame.Framework/Graphics/ModelMesh.cs b/MonoGame.Framework/Graphics/ModelMesh.cs
index 3673f9f2fa1..dfec491709f 100644
--- a/MonoGame.Framework/Graphics/ModelMesh.cs
+++ b/MonoGame.Framework/Graphics/ModelMesh.cs
@@ -84,7 +84,7 @@ public void Draw()
for (int j = 0; j < effect.CurrentTechnique.Passes.Count; j++)
{
effect.CurrentTechnique.Passes[j].Apply ();
- this.graphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, part.VertexOffset, 0, part.NumVertices, part.StartIndex, part.PrimitiveCount);
+ graphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, part.VertexOffset, part.StartIndex, part.PrimitiveCount);
}
}
}
diff --git a/MonoGame.Framework/Graphics/SpriteBatcher.cs b/MonoGame.Framework/Graphics/SpriteBatcher.cs
index fb6eb5ffab3..0ad0333ec77 100644
--- a/MonoGame.Framework/Graphics/SpriteBatcher.cs
+++ b/MonoGame.Framework/Graphics/SpriteBatcher.cs
@@ -170,7 +170,7 @@ public unsafe void DrawBatch(SpriteSortMode sortMode, Effect effect)
unchecked
{
- _device._graphicsMetrics._spriteCount += (ulong)batchCount;
+ _device._graphicsMetrics._spriteCount += batchCount;
}
// Iterate through the batches, doing short.MaxValue sets of vertices only.
diff --git a/MonoGame.Framework/Graphics/States/Blend.cs b/MonoGame.Framework/Graphics/States/Blend.cs
index afa58a65933..d89fc8dc635 100644
--- a/MonoGame.Framework/Graphics/States/Blend.cs
+++ b/MonoGame.Framework/Graphics/States/Blend.cs
@@ -58,7 +58,7 @@ public enum Blend
///
InverseDestinationAlpha,
///
- /// Each component of the color is multiplied by a constant in the .
+ /// Each component of the color is multiplied by a constant in the .
///
BlendFactor,
///
diff --git a/MonoGame.Framework/Graphics/Texture2D.DirectX.cs b/MonoGame.Framework/Graphics/Texture2D.DirectX.cs
index 4e229550718..d20d347eb1b 100644
--- a/MonoGame.Framework/Graphics/Texture2D.DirectX.cs
+++ b/MonoGame.Framework/Graphics/Texture2D.DirectX.cs
@@ -322,7 +322,6 @@ private void SaveAsImage(Guid encoderId, Stream stream, int width, int height)
#endif
#if !WINDOWS_PHONE
- [CLSCompliant(false)]
static SharpDX.Direct3D11.Texture2D CreateTex2DFromBitmap(SharpDX.WIC.BitmapSource bsource, GraphicsDevice device)
{
diff --git a/MonoGame.Framework/Graphics/Texture3D.DirectX.cs b/MonoGame.Framework/Graphics/Texture3D.DirectX.cs
index 37f46d559de..b1f591a8ad7 100644
--- a/MonoGame.Framework/Graphics/Texture3D.DirectX.cs
+++ b/MonoGame.Framework/Graphics/Texture3D.DirectX.cs
@@ -7,7 +7,6 @@
using System.Runtime.InteropServices;
using SharpDX;
using SharpDX.Direct3D11;
-using SharpDX.DXGI;
using MapFlags = SharpDX.Direct3D11.MapFlags;
namespace Microsoft.Xna.Framework.Graphics
@@ -16,7 +15,6 @@ public partial class Texture3D : Texture
{
private bool renderTarget;
private bool mipMap;
- private SampleDescription _sampleDescription;
private void PlatformConstruct(GraphicsDevice graphicsDevice, int width, int height, int depth, bool mipMap, SurfaceFormat format, bool renderTarget)
{
diff --git a/MonoGame.Framework/Input/GamePad.XInput.cs b/MonoGame.Framework/Input/GamePad.XInput.cs
index f178520054d..ac41fd26a4a 100644
--- a/MonoGame.Framework/Input/GamePad.XInput.cs
+++ b/MonoGame.Framework/Input/GamePad.XInput.cs
@@ -169,7 +169,7 @@ private static GamePadState PlatformGetState(int index, GamePadDeadZone deadZone
packetNumber = xistate.PacketNumber;
gamepad = xistate.Gamepad;
}
- catch (Exception ex)
+ catch (Exception)
{
}
diff --git a/MonoGame.Framework/Utilities/ZLibStream/ZlibStream.cs b/MonoGame.Framework/Utilities/ZLibStream/ZlibStream.cs
index b2252e331c6..a544c3bd578 100644
--- a/MonoGame.Framework/Utilities/ZLibStream/ZlibStream.cs
+++ b/MonoGame.Framework/Utilities/ZLibStream/ZlibStream.cs
@@ -8378,7 +8378,7 @@ internal Int32 Crc
///
///
///
- /// Set this at any point before calling .
+ /// Set this at any point before calling .
///
///
internal bool LeaveOpen
diff --git a/Test/ContentPipeline/AudioContentTests.cs b/Test/ContentPipeline/AudioContentTests.cs
index 9f5ba7569e0..5ef9d993a8e 100644
--- a/Test/ContentPipeline/AudioContentTests.cs
+++ b/Test/ContentPipeline/AudioContentTests.cs
@@ -192,10 +192,8 @@ private static int ToWavFormat(ConversionFormat format, int bitsPerSample)
if (bitsPerSample == 32)
return -2;
return 1;
- break;
case ConversionFormat.Adpcm:
return 2;
- break;
case ConversionFormat.WindowsMedia:
case ConversionFormat.Xma:
default:
diff --git a/Test/Framework/TestGameBase.cs b/Test/Framework/TestGameBase.cs
index 3ade9bc8577..73b8eb5bceb 100644
--- a/Test/Framework/TestGameBase.cs
+++ b/Test/Framework/TestGameBase.cs
@@ -166,7 +166,7 @@ protected override void UnloadContent ()
SafeRaise (UnloadContentWith);
}
- public new void Run (Predicate until = null)
+ public void Run (Predicate until = null)
{
if (until != null)
ExitCondition = until;
diff --git a/Test/Runner/Interface/CommandLineInterface.cs b/Test/Runner/Interface/CommandLineInterface.cs
index 676dfdc3188..f2ddfe24401 100644
--- a/Test/Runner/Interface/CommandLineInterface.cs
+++ b/Test/Runner/Interface/CommandLineInterface.cs
@@ -121,7 +121,7 @@ public override void RunFinished(TestResult result)
resultWriter.SaveTestResult (result);
if (_runOptions.PerformXslTransform) {
- var transform = new XslTransform ();
+ var transform = new XslCompiledTransform();
transform.Load (_runOptions.XslTransformPath);
transform.Transform (_runOptions.XmlResultsPath, _runOptions.TransformedResultsPath);
}
diff --git a/Tools/2MGFX/Properties/AssemblyInfo.cs b/Tools/2MGFX/Properties/AssemblyInfo.cs
index a6712f3ffe7..33571bcfcb4 100644
--- a/Tools/2MGFX/Properties/AssemblyInfo.cs
+++ b/Tools/2MGFX/Properties/AssemblyInfo.cs
@@ -1,4 +1,5 @@
-using System.Reflection;
+using System;
+using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
@@ -14,6 +15,9 @@
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
+// Mark the assembly as CLS compliant so it can be safely used in other .NET languages
+[assembly: CLSCompliant(true)]
+
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
diff --git a/Tools/Pipeline/Common/PipelineController.ExcludeAction.cs b/Tools/Pipeline/Common/PipelineController.ExcludeAction.cs
index 953a278acb3..e882bab676c 100644
--- a/Tools/Pipeline/Common/PipelineController.ExcludeAction.cs
+++ b/Tools/Pipeline/Common/PipelineController.ExcludeAction.cs
@@ -53,7 +53,7 @@ public bool Do()
else
File.Delete(_con.GetFullPath(item.OriginalPath));
}
- catch (FileNotFoundException ex)
+ catch (FileNotFoundException)
{
// No error needed in case file is not found
}
diff --git a/Tools/Pipeline/Common/PipelineController.cs b/Tools/Pipeline/Common/PipelineController.cs
index 96e7018f352..b8e30c38ebb 100644
--- a/Tools/Pipeline/Common/PipelineController.cs
+++ b/Tools/Pipeline/Common/PipelineController.cs
@@ -271,7 +271,7 @@ public void OpenProject(string projectFilePath)
PipelineSettings.Default.Save();
View.UpdateRecentList(PipelineSettings.Default.ProjectHistory);
}
- catch (Exception e)
+ catch (Exception)
{
View.ShowError("Open Project", "Failed to open project!");
return;
From 6af92b91f13cb5710755df7c74bbd8acb272d354 Mon Sep 17 00:00:00 2001
From: cra0zy
Date: Sat, 1 Oct 2016 21:17:30 +0200
Subject: [PATCH 007/128] [SDL] Fix setting IsBorderless state inverse
---
MonoGame.Framework/SDL/SDLGameWindow.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/MonoGame.Framework/SDL/SDLGameWindow.cs b/MonoGame.Framework/SDL/SDLGameWindow.cs
index 5b87e2dc443..f930040997e 100644
--- a/MonoGame.Framework/SDL/SDLGameWindow.cs
+++ b/MonoGame.Framework/SDL/SDLGameWindow.cs
@@ -73,7 +73,7 @@ public override bool IsBorderless
get { return _borderless; }
set
{
- Sdl.Window.SetBordered(_handle, value ? 1 : 0);
+ Sdl.Window.SetBordered(_handle, value ? 0 : 1);
_borderless = value;
}
}
From 8b79ccc3ad6646251173a74e4c9fd35186cd0b0f Mon Sep 17 00:00:00 2001
From: Tom Spilman
Date: Mon, 3 Oct 2016 11:46:11 -0500
Subject: [PATCH 008/128] Add a common constructor for ConstantBufferData used
by multiple console platforms.
---
Tools/2MGFX/ConstantBufferData.cs | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/Tools/2MGFX/ConstantBufferData.cs b/Tools/2MGFX/ConstantBufferData.cs
index 7248eaf7665..f98b040ed16 100644
--- a/Tools/2MGFX/ConstantBufferData.cs
+++ b/Tools/2MGFX/ConstantBufferData.cs
@@ -14,6 +14,15 @@ internal partial class ConstantBufferData
public List Parameters { get; private set; }
+ public ConstantBufferData(string name)
+ {
+ Name = name;
+
+ ParameterIndex = new List();
+ ParameterOffset = new List();
+ Parameters = new List();
+ Size = 0;
+ }
public bool SameAs(ConstantBufferData other)
{
From a8f0adfdfd3c10e83e8f4d8c206c2d837385cc0c Mon Sep 17 00:00:00 2001
From: cra0zy
Date: Fri, 30 Sep 2016 15:01:21 +0200
Subject: [PATCH 009/128] Updated Dependencies
---
ThirdParty/Dependencies | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ThirdParty/Dependencies b/ThirdParty/Dependencies
index c053985a0d7..a82c40d9e60 160000
--- a/ThirdParty/Dependencies
+++ b/ThirdParty/Dependencies
@@ -1 +1 @@
-Subproject commit c053985a0d716d5f525c7f8dd2d403e1182d88ba
+Subproject commit a82c40d9e607711d25448bb05b349a7de5631713
From c8f476041ece222d4bd8c60d0ae57797a63c3b64 Mon Sep 17 00:00:00 2001
From: cra0zy
Date: Tue, 4 Oct 2016 12:39:36 +0200
Subject: [PATCH 010/128] [Linux Installer] Update dependency list
---
Installers/Linux/RUN/postinstall.sh | 43 ++++++++++++++---------------
1 file changed, 21 insertions(+), 22 deletions(-)
diff --git a/Installers/Linux/RUN/postinstall.sh b/Installers/Linux/RUN/postinstall.sh
index 6c6225f668b..7d22b22b5bc 100755
--- a/Installers/Linux/RUN/postinstall.sh
+++ b/Installers/Linux/RUN/postinstall.sh
@@ -26,36 +26,17 @@ if [ "$(id -u)" != "0" ]; then
exit 1
fi
-# Check previous versions
-if type "mgcb" > /dev/null 2>&1
-then
- echo "Previous version detected, trying to uninstall..."
-
- # Try and uninstall previus versions
- if [ -f /opt/monogame/uninstall.sh ]
- then
- sudo sh /opt/monogame/uninstall.sh
- elif [ -f /opt/MonoGameSDK/uninstall.sh ]
- then
- sudo sh /opt/MonoGameSDK/uninstall.sh
- else
- echo "Could not uninstall, please uninstall any previous version of MonoGame SDK manually." 1>&2
- exit 1
- fi
-fi
-
DIR=$(pwd)
IDIR="/usr/lib/mono/xbuild/MonoGame/v3.0"
# Show dependency list
echo "Dependencies:"
echodep "mono-runtime" "type 'mono' > /dev/null 2>&1"
-echodep "libopenal" "ldconfig -p | grep -q libopenal"
echodep "gtk-sharp3" "type 'gacutil' > /dev/null 2>&1 && gacutil /l gtk-sharp | grep -q 3.0.0.0"
echo ""
echo "Optional Dependencies:"
-echodep "monodevelop" "type 'mdtool' > /dev/null 2>&1"
-echodep "rider" "type 'rider' > /dev/null 2>&1"
+echodep "MonoDevelop 6" "monodevelop --help | grep 'MonoDevelop 6' > /dev/null 2>&1"
+echodep "Rider" "type 'rider' > /dev/null 2>&1"
echodep "referenceassemblies-pcl / mono-pcl" "test -d /usr/lib/mono/xbuild/Microsoft/Portable"
echodep "ttf-mscorefonts-installer / mscore-fonts" "fc-list | grep -q Arial"
echo ""
@@ -65,6 +46,24 @@ case "$choice2" in
*) ;;
esac
+# Check previous versions
+if type "mgcb" > /dev/null 2>&1
+then
+ echo "Previous version detected, trying to uninstall..."
+
+ # Try and uninstall previus versions
+ if [ -f /opt/monogame/uninstall.sh ]
+ then
+ sudo sh /opt/monogame/uninstall.sh
+ elif [ -f /opt/MonoGameSDK/uninstall.sh ]
+ then
+ sudo sh /opt/MonoGameSDK/uninstall.sh
+ else
+ echo "Could not uninstall, please uninstall any previous version of MonoGame SDK manually." 1>&2
+ exit 1
+ fi
+fi
+
# MonoGame SDK installation
echo "Installing MonoGame SDK..."
@@ -97,7 +96,7 @@ then
fi
# MonoDevelop addin
-if type "mdtool" > /dev/null 2>&1
+if monodevelop --help | grep 'MonoDevelop 6' > /dev/null 2>&1
then
echo "Installing MonoDevelop Addin..."
sudo -H -u $SUDO_USER bash -c "mdtool setup install -y $DIR/Main/MonoDevelop.MonoGame.mpack > /dev/null"
From 7bead9ee84c7777d5024fc254eba5ef54b3d717c Mon Sep 17 00:00:00 2001
From: Jesse
Date: Sat, 8 Oct 2016 02:29:28 +0200
Subject: [PATCH 011/128] Improve setting BlendState in DX (#5212)
Improve setting BlendState in DX
---
.../Graphics/GraphicsDevice.DirectX.cs | 25 +++++++++++++++----
.../Graphics/GraphicsDevice.OpenGL.cs | 21 ++++++++++------
.../Graphics/GraphicsDevice.Web.cs | 2 +-
MonoGame.Framework/Graphics/GraphicsDevice.cs | 12 +--------
.../Graphics/States/BlendState.DirectX.cs | 9 +++----
5 files changed, 38 insertions(+), 31 deletions(-)
diff --git a/MonoGame.Framework/Graphics/GraphicsDevice.DirectX.cs b/MonoGame.Framework/Graphics/GraphicsDevice.DirectX.cs
index c311f3bfdf9..913328a2161 100644
--- a/MonoGame.Framework/Graphics/GraphicsDevice.DirectX.cs
+++ b/MonoGame.Framework/Graphics/GraphicsDevice.DirectX.cs
@@ -1182,19 +1182,34 @@ internal void PlatformBeginApplyState()
Debug.Assert(_d3dContext != null, "The d3d context is null!");
}
- private void PlatformApplyBlendFactor()
+ private void PlatformApplyBlend()
{
+ if (_blendFactorDirty || _blendStateDirty)
+ {
+ var state = _actualBlendState.GetDxState(this);
+ var factor = GetBlendFactor();
+ _d3dContext.OutputMerger.SetBlendState(state, factor);
+
+ _blendFactorDirty = false;
+ _blendStateDirty = false;
+ }
+ }
+
#if WINDOWS_UAP
- _d3dContext.OutputMerger.BlendFactor =
- new SharpDX.Mathematics.Interop.RawColor4(
+ private SharpDX.Mathematics.Interop.RawColor4 GetBlendFactor()
+ {
+ return new SharpDX.Mathematics.Interop.RawColor4(
BlendFactor.R / 255.0f,
BlendFactor.G / 255.0f,
BlendFactor.B / 255.0f,
BlendFactor.A / 255.0f);
+ }
#else
- _d3dContext.OutputMerger.BlendFactor = BlendFactor.ToColor4();
-#endif
+ private Color4 GetBlendFactor()
+ {
+ return BlendFactor.ToColor4();
}
+#endif
internal void PlatformApplyState(bool applyShaders)
{
diff --git a/MonoGame.Framework/Graphics/GraphicsDevice.OpenGL.cs b/MonoGame.Framework/Graphics/GraphicsDevice.OpenGL.cs
index 54e51966441..c42e68bcadf 100644
--- a/MonoGame.Framework/Graphics/GraphicsDevice.OpenGL.cs
+++ b/MonoGame.Framework/Graphics/GraphicsDevice.OpenGL.cs
@@ -296,9 +296,8 @@ private void PlatformInitialize()
"Try updating your graphics drivers.");
}
- // Force reseting states
- this.BlendState.PlatformApplyState(this, true);
- this.PlatformApplyBlendFactor(true);
+ // Force resetting states
+ this.PlatformApplyBlend(true);
this.DepthStencilState.PlatformApplyState(this, true);
this.RasterizerState.PlatformApplyState(this, true);
@@ -843,15 +842,21 @@ internal void PlatformBeginApplyState()
Threading.EnsureUIThread();
}
- private void PlatformApplyBlendFactor(bool force = false)
+ private void PlatformApplyBlend(bool force = false)
+ {
+ _actualBlendState.PlatformApplyState(this, force);
+ ApplyBlendFactor(force);
+ }
+
+ private void ApplyBlendFactor(bool force)
{
if (force || BlendFactor != _lastBlendState.BlendFactor)
{
GL.BlendColor(
- this.BlendFactor.R / 255.0f,
- this.BlendFactor.G / 255.0f,
- this.BlendFactor.B / 255.0f,
- this.BlendFactor.A / 255.0f);
+ this.BlendFactor.R/255.0f,
+ this.BlendFactor.G/255.0f,
+ this.BlendFactor.B/255.0f,
+ this.BlendFactor.A/255.0f);
GraphicsExtensions.CheckGLError();
_lastBlendState.BlendFactor = this.BlendFactor;
}
diff --git a/MonoGame.Framework/Graphics/GraphicsDevice.Web.cs b/MonoGame.Framework/Graphics/GraphicsDevice.Web.cs
index 3e3cb7212bb..776d73af19d 100644
--- a/MonoGame.Framework/Graphics/GraphicsDevice.Web.cs
+++ b/MonoGame.Framework/Graphics/GraphicsDevice.Web.cs
@@ -67,7 +67,7 @@ internal void PlatformBeginApplyState()
{
}
- private void PlatformApplyBlendFactor()
+ private void PlatformApplyBlend()
{
}
diff --git a/MonoGame.Framework/Graphics/GraphicsDevice.cs b/MonoGame.Framework/Graphics/GraphicsDevice.cs
index 375503dc9d5..ff038c6d793 100644
--- a/MonoGame.Framework/Graphics/GraphicsDevice.cs
+++ b/MonoGame.Framework/Graphics/GraphicsDevice.cs
@@ -434,17 +434,7 @@ internal void ApplyState(bool applyShaders)
{
PlatformBeginApplyState();
- if (_blendStateDirty)
- {
- _actualBlendState.PlatformApplyState(this);
- _blendStateDirty = false;
- }
-
- if (_blendFactorDirty)
- {
- PlatformApplyBlendFactor();
- _blendFactorDirty = false;
- }
+ PlatformApplyBlend();
if (_depthStencilStateDirty)
{
diff --git a/MonoGame.Framework/Graphics/States/BlendState.DirectX.cs b/MonoGame.Framework/Graphics/States/BlendState.DirectX.cs
index 10c60a95cfa..4bb95386d8b 100644
--- a/MonoGame.Framework/Graphics/States/BlendState.DirectX.cs
+++ b/MonoGame.Framework/Graphics/States/BlendState.DirectX.cs
@@ -8,7 +8,7 @@ namespace Microsoft.Xna.Framework.Graphics
{
public partial class BlendState
{
- SharpDX.Direct3D11.BlendState _state;
+ private SharpDX.Direct3D11.BlendState _state;
protected internal override void GraphicsDeviceResetting()
{
@@ -16,7 +16,7 @@ protected internal override void GraphicsDeviceResetting()
base.GraphicsDeviceResetting();
}
- internal void PlatformApplyState(GraphicsDevice device)
+ internal SharpDX.Direct3D11.BlendState GetDxState(GraphicsDevice device)
{
if (_state == null)
{
@@ -38,11 +38,8 @@ internal void PlatformApplyState(GraphicsDevice device)
Debug.Assert(GraphicsDevice == device, "The state was created for a different device!");
- // NOTE: We make the assumption here that the caller has
- // locked the d3dContext for us to use.
-
// Apply the state!
- device._d3dContext.OutputMerger.BlendState = _state;
+ return _state;
}
protected override void Dispose(bool disposing)
From b4eea12ee77c165188e599d0d0a23a3c5c11c1f3 Mon Sep 17 00:00:00 2001
From: cra0zy
Date: Sun, 9 Oct 2016 01:17:37 +0200
Subject: [PATCH 012/128] [Pipeline Tool] Improved references editor
---
Tools/Pipeline/Controls/PropertyCells/CellBase.cs | 6 ++++--
Tools/Pipeline/Controls/PropertyCells/CellRefs.cs | 11 ++++++++++-
Tools/Pipeline/Controls/PropertyGridTable.cs | 4 +++-
3 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/Tools/Pipeline/Controls/PropertyCells/CellBase.cs b/Tools/Pipeline/Controls/PropertyCells/CellBase.cs
index 0cb992484d7..12054e38ae1 100644
--- a/Tools/Pipeline/Controls/PropertyCells/CellBase.cs
+++ b/Tools/Pipeline/Controls/PropertyCells/CellBase.cs
@@ -27,6 +27,7 @@ public class CellBase
public string DisplayValue { get; set; }
public string Text { get; set; }
public bool Editable { get; set; }
+ public int Height { get; set; }
public Action OnKill;
protected EventHandler _eventHandler;
@@ -40,6 +41,7 @@ public void Create(string category, string name, object value, Type type, EventH
DisplayValue = (value == null) ? "" : value.ToString();
Text = name;
Editable = true;
+ Height = PropInfo.TextHeight;
_eventHandler = eventHandler;
_type = type;
@@ -62,7 +64,7 @@ public virtual void Draw(Graphics g, Rectangle rec, int separatorPos, bool selec
if (selected)
g.FillRectangle(SystemColors.Highlight, rec);
- g.DrawText(SystemFonts.Default(), PropInfo.GetTextColor(selected, false), rec.X + 5, rec.Y + (rec.Height - PropInfo.TextHeight) / 2, Text);
+ g.DrawText(SystemFonts.Default(), PropInfo.GetTextColor(selected, false), rec.X + 5, rec.Y + (rec.Height - Height) / 2, Text);
g.FillRectangle(PropInfo.GetBackgroundColor(selected), separatorPos - 6, rec.Y, rec.Width, rec.Height);
DrawCell(g, rec, separatorPos, selected);
}
@@ -73,7 +75,7 @@ public virtual void DrawCell(Graphics g, Rectangle rec, int separatorPos, bool s
_lastRec.X += separatorPos;
_lastRec.Width -= separatorPos - 1;
- g.DrawText(SystemFonts.Default(), PropInfo.GetTextColor(selected, !Editable), separatorPos + 5, rec.Y + (rec.Height - PropInfo.TextHeight) / 2, DisplayValue);
+ g.DrawText(SystemFonts.Default(), PropInfo.GetTextColor(selected, !Editable), separatorPos + 5, rec.Y + (rec.Height - Height) / 2, DisplayValue);
}
}
}
diff --git a/Tools/Pipeline/Controls/PropertyCells/CellRefs.cs b/Tools/Pipeline/Controls/PropertyCells/CellRefs.cs
index 701fd5fa5f7..21150b71d5b 100644
--- a/Tools/Pipeline/Controls/PropertyCells/CellRefs.cs
+++ b/Tools/Pipeline/Controls/PropertyCells/CellRefs.cs
@@ -3,8 +3,10 @@
// file 'LICENSE.txt', which is part of this source code package.
using System;
+using System.IO;
using System.Collections.Generic;
using Eto.Forms;
+using Eto.Drawing;
namespace MonoGame.Tools.Pipeline
{
@@ -16,7 +18,14 @@ public override void OnCreate()
if (Value == null)
Value = new List();
- DisplayValue = (Value as List).Count > 0 ? "Collection" : "None";
+ var list = Value as List;
+ var displayValue = "";
+
+ foreach (var value in list)
+ displayValue += Environment.NewLine + Path.GetFileNameWithoutExtension (value);
+
+ DisplayValue = (Value as List).Count > 0 ? displayValue.Trim(Environment.NewLine.ToCharArray()) : "None";
+ Height = Height * Math.Max(list.Count, 1);
}
public override void Edit(PixelLayout control)
diff --git a/Tools/Pipeline/Controls/PropertyGridTable.cs b/Tools/Pipeline/Controls/PropertyGridTable.cs
index 988eb20e76d..4ad9d7d747b 100755
--- a/Tools/Pipeline/Controls/PropertyGridTable.cs
+++ b/Tools/Pipeline/Controls/PropertyGridTable.cs
@@ -194,6 +194,8 @@ private void Drawable_Paint(object sender, PaintEventArgs e)
foreach (var c in _cells)
{
+ rec.Height = c.Height + _spacing;
+
// Draw group
if (prevCategory != c.Category)
{
@@ -215,7 +217,7 @@ private void Drawable_Paint(object sender, PaintEventArgs e)
// Draw separator for the current row
g.FillRectangle(PropInfo.BorderColor, _separatorPos - 1, rec.Y, 1, rec.Height);
- rec.Y += PropInfo.TextHeight + _spacing;
+ rec.Y += c.Height + _spacing;
}
if (_height != rec.Y + 1)
From 7a037449ccea6c51a5b419775cac06ba161dbe83 Mon Sep 17 00:00:00 2001
From: cra0zy
Date: Sun, 9 Oct 2016 01:20:51 +0200
Subject: [PATCH 013/128] [Pipeline Tool] Rename Pads menu to View menu
---
Tools/Pipeline/MainWindow.cs | 2 +-
Tools/Pipeline/MainWindow.eto.cs | 10 +++++-----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/Tools/Pipeline/MainWindow.cs b/Tools/Pipeline/MainWindow.cs
index 9f0430639c5..ae2302a87a1 100644
--- a/Tools/Pipeline/MainWindow.cs
+++ b/Tools/Pipeline/MainWindow.cs
@@ -45,7 +45,7 @@ public MainWindow()
foreach (var com in pad.Commands)
menu.Items.Add(com.CreateMenuItem());
- menuPads.Items.Add(menu);
+ menuView.Items.Add(menu);
}
}
diff --git a/Tools/Pipeline/MainWindow.eto.cs b/Tools/Pipeline/MainWindow.eto.cs
index 6be27619e20..efd957764cd 100644
--- a/Tools/Pipeline/MainWindow.eto.cs
+++ b/Tools/Pipeline/MainWindow.eto.cs
@@ -21,7 +21,7 @@ partial class MainWindow
MenuBar menubar;
ToolBar toolbar;
- ButtonMenuItem menuFile, menuRecent, menuEdit, menuAdd, menuPads, menuBuild, menuHelp;
+ ButtonMenuItem menuFile, menuRecent, menuEdit, menuAdd, menuView, menuBuild, menuHelp;
ToolItem toolBuild, toolRebuild, toolClean, toolCancelBuild;
MenuItem cmOpenItem, cmOpenItemWith, cmOpenItemLocation, cmRebuildItem, cmExclude, cmRename, cmDelete;
ButtonMenuItem cmAdd;
@@ -289,11 +289,11 @@ private void InitalizeMenu()
menuEdit.Items.Add(cmdDelete);
Menu.Items.Add(menuEdit);
- //Pads Commands
+ // View Commands
- menuPads = new ButtonMenuItem();
- menuPads.Text = "Pads";
- Menu.Items.Add(menuPads);
+ menuView = new ButtonMenuItem();
+ menuView.Text = "View";
+ Menu.Items.Add(menuView);
menuBuild = new ButtonMenuItem();
menuBuild.Text = "Build";
From 51e52891f49ad10181f15128ea366d8bf1d26f9c Mon Sep 17 00:00:00 2001
From: cra0zy
Date: Sun, 9 Oct 2016 13:17:01 +0200
Subject: [PATCH 014/128] [Pipeline Tool] Fix default values of properties
---
Tools/Pipeline/Common/PipelineTypes.cs | 2 --
1 file changed, 2 deletions(-)
diff --git a/Tools/Pipeline/Common/PipelineTypes.cs b/Tools/Pipeline/Common/PipelineTypes.cs
index 602c0148254..2acccb51f51 100644
--- a/Tools/Pipeline/Common/PipelineTypes.cs
+++ b/Tools/Pipeline/Common/PipelineTypes.cs
@@ -300,8 +300,6 @@ public static void Load(PipelineProject project)
browsable = (a as BrowsableAttribute).Browsable;
else if (a is DisplayNameAttribute)
name = (a as DisplayNameAttribute).DisplayName;
- else if (a is DefaultValueAttribute)
- defvalue = (a as DefaultValueAttribute).Value;
}
var p = new ProcessorTypeDescription.Property()
From f4fc62ca4889a17a71f81c0ead3d375b8bb12a88 Mon Sep 17 00:00:00 2001
From: Nikos Kastellanos
Date: Mon, 10 Oct 2016 03:43:48 +0300
Subject: [PATCH 015/128] [Pipeline Tool] Add SucceedWithWarnings Icon
---
Build/Projects/Pipeline.definition | 3 +++
Tools/Pipeline/Controls/BuildOutput.cs | 5 ++++-
.../Pipeline/Icons/Build/SucceedWithWarnings.png | Bin 0 -> 494 bytes
3 files changed, 7 insertions(+), 1 deletion(-)
create mode 100644 Tools/Pipeline/Icons/Build/SucceedWithWarnings.png
diff --git a/Build/Projects/Pipeline.definition b/Build/Projects/Pipeline.definition
index c8c7d97e9a9..cf48255d380 100644
--- a/Build/Projects/Pipeline.definition
+++ b/Build/Projects/Pipeline.definition
@@ -231,6 +231,9 @@
Build.Succeed.png
+
+ Build.SucceedWithWarnings.png
+
diff --git a/Tools/Pipeline/Controls/BuildOutput.cs b/Tools/Pipeline/Controls/BuildOutput.cs
index b99433350bb..1625c11d4e7 100644
--- a/Tools/Pipeline/Controls/BuildOutput.cs
+++ b/Tools/Pipeline/Controls/BuildOutput.cs
@@ -15,7 +15,7 @@ public partial class BuildOutput
private readonly DataField _dataImage;
private readonly DataField _dataText;
private TreePosition _last;
- private Image _iconInformation, _iconFail, _iconProcessing, _iconSkip, _iconSucceed, _iconStart, _iconEndSucceed, _iconEndFailed;
+ private Image _iconInformation, _iconFail, _iconProcessing, _iconSkip, _iconSucceed, _iconSucceedWithWarnings, _iconStart, _iconEndSucceed, _iconEndFailed;
private Eto.Forms.CheckCommand _cmdFilterOutput, _cmdAutoScroll;
public BuildOutput()
@@ -32,6 +32,7 @@ public BuildOutput()
_iconEndSucceed = Global.GetXwtIcon("Build.EndSucceed.png");
_iconEndFailed = Global.GetXwtIcon("Build.EndFailed.png");
_iconSucceed = Global.GetXwtIcon("Build.Succeed.png");
+ _iconSucceedWithWarnings = Global.GetXwtIcon("Build.SucceedWithWarnings.png");
_dataImage = new DataField();
_dataText = new DataField();
@@ -110,6 +111,8 @@ public void WriteLine(string line)
AddItem(_output.ErrorMessage);
break;
case OutputState.BuildWarning:
+ if (_treeStore.GetNavigatorAt(_last).GetValue(_dataImage) == _iconProcessing)
+ _treeStore.GetNavigatorAt(_last).SetValue(_dataImage, _iconSucceedWithWarnings);
AddItem(_output.ErrorMessage);
break;
case OutputState.BuildEnd:
diff --git a/Tools/Pipeline/Icons/Build/SucceedWithWarnings.png b/Tools/Pipeline/Icons/Build/SucceedWithWarnings.png
new file mode 100644
index 0000000000000000000000000000000000000000..ecd0633ee6f678569cf2dbee5556f85afcb3e6f0
GIT binary patch
literal 494
zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!WQl7;NpOBzNqJ&XDuZK6ep0G}
zXKrG8YEWuoN@d~6R2!h8nE^f_uEsNs{{z7phQELRe*5ATH6n||GOx^_~POvmzMna{bTLrwHC82igy-2
zc>mzz_mAhFpLbs9JmL6+*tM}gpUr&xVD0B0pHDnF@!|W2fB*h99%yu5?EdBFmxUJ=
ze*5+9{`>ns-t7GQ@9(ZVyKcX|{r212zt`=6E;8?%2(*a7xFpCg8013I07K!ty?sFK
zYdl>XLn>~?^gri2tiaP!>%i8sBr
zY)Q@}9dDmC4|$fDEsC4yd$4WWm&sRUPyUG3H(aVQO+;#bzkkJ+V&R|(70Db5_Ueo)
z&oC?V9C=k4viIYmrbe%j%C*0y2}!eyB-wiYy&x+S(D6O?SH8EwgOb~ylX#Wc3&K7$
wNAK-iakf=_-*Mg7Z{Ji+wCVbH{y&ES1N#l$+H0?k^+EpjboFyt=akR{0B3R$pa1{>
literal 0
HcmV?d00001
From d5b738fcd9f90039e6b9889a4b4a4b5dcd110c87 Mon Sep 17 00:00:00 2001
From: MichaelDePiazzi
Date: Tue, 11 Oct 2016 08:11:48 +0800
Subject: [PATCH 016/128] WinDX fix: Fullscreen was being forced to native res
---
MonoGame.Framework/Windows/WinFormsGameWindow.cs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/MonoGame.Framework/Windows/WinFormsGameWindow.cs b/MonoGame.Framework/Windows/WinFormsGameWindow.cs
index 62270f8ef25..19f55a73a3e 100644
--- a/MonoGame.Framework/Windows/WinFormsGameWindow.cs
+++ b/MonoGame.Framework/Windows/WinFormsGameWindow.cs
@@ -298,7 +298,8 @@ internal void Initialize(int width, int height)
private void OnClientSizeChanged(object sender, EventArgs eventArgs)
{
- if (Game.Window == this)
+ // Only resize the backbuffer in windowed mode. In fullscreen mode, it gets stretched to fit the window.
+ if (Game.Window == this && !Game.graphicsDeviceManager.IsFullScreen)
{
var manager = Game.graphicsDeviceManager;
From e2598c4c3b8d3b3e9b99a3b692c38f5029aa8460 Mon Sep 17 00:00:00 2001
From: MichaelDePiazzi
Date: Thu, 13 Oct 2016 13:00:53 +0800
Subject: [PATCH 017/128] WinDX fix: Resolution change didn't apply when
switching out of fullscreen borderless mode
---
.../Windows/WinFormsGamePlatform.cs | 35 +++++++++----------
.../Windows/WinFormsGameWindow.cs | 12 +++++++
2 files changed, 28 insertions(+), 19 deletions(-)
diff --git a/MonoGame.Framework/Windows/WinFormsGamePlatform.cs b/MonoGame.Framework/Windows/WinFormsGamePlatform.cs
index 09e22bae6fd..f2284434c9c 100644
--- a/MonoGame.Framework/Windows/WinFormsGamePlatform.cs
+++ b/MonoGame.Framework/Windows/WinFormsGamePlatform.cs
@@ -47,6 +47,8 @@ public override void BeforeInitialize()
{
var gdm = Game.graphicsDeviceManager;
+ _window.EnableClientSizeChangedEvent(false); // Disable ClientSizeChanged event while the window is initialised
+
_window.Initialize(gdm.PreferredBackBufferWidth, gdm.PreferredBackBufferHeight);
base.BeforeInitialize();
@@ -55,6 +57,8 @@ public override void BeforeInitialize()
EnterFullScreen();
else
ExitFullScreen();
+
+ _window.EnableClientSizeChangedEvent(true); // Re-enable (and trigger) ClientSizeChanged event
}
public override void RunLoop()
@@ -94,15 +98,14 @@ public override void EnterFullScreen()
{
Game.GraphicsDevice.PresentationParameters.IsFullScreen = true;
Game.GraphicsDevice.SetHardwareFullscreen();
-
- _window._form.WindowState = FormWindowState.Maximized;
}
else
{
_window.IsBorderless = true;
- _window._form.WindowState = FormWindowState.Maximized;
}
+ _window._form.WindowState = FormWindowState.Maximized;
+
_alreadyInWindowedMode = false;
_alreadyInFullScreenMode = true;
}
@@ -114,39 +117,33 @@ public override void ExitFullScreen()
if (Game.graphicsDeviceManager.HardwareModeSwitch)
{
-
Game.GraphicsDevice.PresentationParameters.IsFullScreen = false;
Game.GraphicsDevice.SetHardwareFullscreen();
-
- _window._form.WindowState = FormWindowState.Normal;
-
- Game.GraphicsDevice.PresentationParameters.BackBufferWidth = Game.graphicsDeviceManager.PreferredBackBufferWidth;
- Game.GraphicsDevice.PresentationParameters.BackBufferHeight = Game.graphicsDeviceManager.PreferredBackBufferHeight;
-
- Game.GraphicsDevice.OnPresentationChanged();
}
else
{
- _window._form.WindowState = FormWindowState.Normal;
_window.IsBorderless = false;
}
+ _window._form.WindowState = FormWindowState.Normal;
+ _window.ChangeClientSize(new Size(Game.graphicsDeviceManager.PreferredBackBufferWidth, Game.graphicsDeviceManager.PreferredBackBufferHeight));
+
_alreadyInWindowedMode = true;
_alreadyInFullScreenMode = false;
}
internal override void OnPresentationChanged()
{
- var presentationParameters = Game.GraphicsDevice.PresentationParameters;
-
- if (presentationParameters.IsFullScreen)
+ _window.EnableClientSizeChangedEvent(false); // Disable ClientSizeChanged event while the window is resized
+
+ if (Game.GraphicsDevice.PresentationParameters.IsFullScreen)
EnterFullScreen();
else
- ExitFullScreen();
-
- _window.ChangeClientSize(new Size(presentationParameters.BackBufferWidth, presentationParameters.BackBufferHeight));
+ ExitFullScreen();
+
+ _window.EnableClientSizeChangedEvent(true); // Re-enable (and trigger) ClientSizeChanged event
}
-
+
public override void EndScreenDeviceChange(string screenDeviceName, int clientWidth, int clientHeight)
{
}
diff --git a/MonoGame.Framework/Windows/WinFormsGameWindow.cs b/MonoGame.Framework/Windows/WinFormsGameWindow.cs
index 19f55a73a3e..6b40a7bf4f9 100644
--- a/MonoGame.Framework/Windows/WinFormsGameWindow.cs
+++ b/MonoGame.Framework/Windows/WinFormsGameWindow.cs
@@ -37,6 +37,8 @@ class WinFormsGameWindow : GameWindow, IDisposable
private bool _isMouseInBounds;
+ private bool _areClientSizeChangedEventsIgnored;
+
#region Internal Properties
internal Game Game { get; private set; }
@@ -296,8 +298,18 @@ internal void Initialize(int width, int height)
_form.Show();
}
+ internal void EnableClientSizeChangedEvent(bool isEnabled)
+ {
+ _areClientSizeChangedEventsIgnored = !isEnabled;
+ if (isEnabled)
+ OnClientSizeChanged(this, EventArgs.Empty);
+ }
+
private void OnClientSizeChanged(object sender, EventArgs eventArgs)
{
+ if (_areClientSizeChangedEventsIgnored)
+ return;
+
// Only resize the backbuffer in windowed mode. In fullscreen mode, it gets stretched to fit the window.
if (Game.Window == this && !Game.graphicsDeviceManager.IsFullScreen)
{
From cfd2479e05fe1b72db8344b0740a7645e6f018ba Mon Sep 17 00:00:00 2001
From: MichaelDePiazzi
Date: Fri, 14 Oct 2016 13:03:47 +0800
Subject: [PATCH 018/128] WinDX fix: Don't resize backbuffer when window is
minimized
---
.../Windows/WinFormsGameWindow.cs | 24 +++++++++----------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/MonoGame.Framework/Windows/WinFormsGameWindow.cs b/MonoGame.Framework/Windows/WinFormsGameWindow.cs
index 6b40a7bf4f9..717df429dca 100644
--- a/MonoGame.Framework/Windows/WinFormsGameWindow.cs
+++ b/MonoGame.Framework/Windows/WinFormsGameWindow.cs
@@ -310,23 +310,23 @@ private void OnClientSizeChanged(object sender, EventArgs eventArgs)
if (_areClientSizeChangedEventsIgnored)
return;
- // Only resize the backbuffer in windowed mode. In fullscreen mode, it gets stretched to fit the window.
- if (Game.Window == this && !Game.graphicsDeviceManager.IsFullScreen)
+ if (Game.Window == this)
{
var manager = Game.graphicsDeviceManager;
-
- // Set the default new back buffer size and viewport, but this
- // can be overloaded by the two events below.
-
- var newWidth = _form.ClientRectangle.Width;
- var newHeight = _form.ClientRectangle.Height;
-
if (manager.GraphicsDevice == null)
return;
- manager.GraphicsDevice.PresentationParameters.BackBufferWidth = newWidth;
- manager.GraphicsDevice.PresentationParameters.BackBufferHeight = newHeight;
- manager.GraphicsDevice.OnPresentationChanged();
+ // Only resize the backbuffer in windowed mode. In fullscreen mode, it gets stretched to fit the window.
+ // Also skip resizing the backbuffer when the window is minimized.
+ if (!manager.IsFullScreen && (_form.WindowState != FormWindowState.Minimized))
+ {
+ // Set the default new back buffer size and viewport, but this
+ // can be overloaded by the two events below.
+ var newSize = _form.ClientSize;
+ manager.GraphicsDevice.PresentationParameters.BackBufferWidth = newSize.Width;
+ manager.GraphicsDevice.PresentationParameters.BackBufferHeight = newSize.Height;
+ manager.GraphicsDevice.OnPresentationChanged();
+ }
}
// Set the new view state which will trigger the
From 61a05fa14472af7ddda9247cc00266d2bfa3ba5c Mon Sep 17 00:00:00 2001
From: MichaelDePiazzi
Date: Fri, 14 Oct 2016 13:22:57 +0800
Subject: [PATCH 019/128] WinDX fix: Accidentally broke resizing in windowed
mode
---
MonoGame.Framework/Windows/WinFormsGamePlatform.cs | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/MonoGame.Framework/Windows/WinFormsGamePlatform.cs b/MonoGame.Framework/Windows/WinFormsGamePlatform.cs
index f2284434c9c..0c7e8feae4f 100644
--- a/MonoGame.Framework/Windows/WinFormsGamePlatform.cs
+++ b/MonoGame.Framework/Windows/WinFormsGamePlatform.cs
@@ -126,7 +126,6 @@ public override void ExitFullScreen()
}
_window._form.WindowState = FormWindowState.Normal;
- _window.ChangeClientSize(new Size(Game.graphicsDeviceManager.PreferredBackBufferWidth, Game.graphicsDeviceManager.PreferredBackBufferHeight));
_alreadyInWindowedMode = true;
_alreadyInFullScreenMode = false;
@@ -137,9 +136,14 @@ internal override void OnPresentationChanged()
_window.EnableClientSizeChangedEvent(false); // Disable ClientSizeChanged event while the window is resized
if (Game.GraphicsDevice.PresentationParameters.IsFullScreen)
+ {
EnterFullScreen();
+ }
else
+ {
ExitFullScreen();
+ _window.ChangeClientSize(new Size(Game.graphicsDeviceManager.PreferredBackBufferWidth, Game.graphicsDeviceManager.PreferredBackBufferHeight));
+ }
_window.EnableClientSizeChangedEvent(true); // Re-enable (and trigger) ClientSizeChanged event
}
From e1df9478865d8e50c4b6a8bbfe42a7f973113cba Mon Sep 17 00:00:00 2001
From: cra0zy
Date: Fri, 14 Oct 2016 22:10:41 +0200
Subject: [PATCH 020/128] [Pipeline Tool] Implement copying asset path
---
Tools/Pipeline/Common/IController.cs | 2 ++
Tools/Pipeline/Common/IView.cs | 2 ++
Tools/Pipeline/Common/MenuInfo.cs | 2 ++
Tools/Pipeline/Common/PipelineController.cs | 14 ++++++++++++++
Tools/Pipeline/Controls/PropertyCells/CellText.cs | 2 +-
Tools/Pipeline/MainWindow.cs | 15 +++++++++++++++
Tools/Pipeline/MainWindow.eto.cs | 9 +++++++--
7 files changed, 43 insertions(+), 3 deletions(-)
diff --git a/Tools/Pipeline/Common/IController.cs b/Tools/Pipeline/Common/IController.cs
index 755d6c6d298..6785b389c81 100644
--- a/Tools/Pipeline/Common/IController.cs
+++ b/Tools/Pipeline/Common/IController.cs
@@ -118,6 +118,8 @@ public interface IController : IContentItemObserver
IProjectItem GetItem(string originalPath);
+ void CopyAssetPath();
+
#endregion
#region Undo, Redo
diff --git a/Tools/Pipeline/Common/IView.cs b/Tools/Pipeline/Common/IView.cs
index 48d2c795a6c..c2d7a9522b2 100644
--- a/Tools/Pipeline/Common/IView.cs
+++ b/Tools/Pipeline/Common/IView.cs
@@ -77,5 +77,7 @@ public interface IView
void UpdateCommands(MenuInfo info);
void UpdateRecentList(List recentList);
+
+ void SetClipboard(string text);
}
}
diff --git a/Tools/Pipeline/Common/MenuInfo.cs b/Tools/Pipeline/Common/MenuInfo.cs
index cea0df61da1..f9b2e39009e 100644
--- a/Tools/Pipeline/Common/MenuInfo.cs
+++ b/Tools/Pipeline/Common/MenuInfo.cs
@@ -50,6 +50,8 @@ public class MenuInfo
public bool OpenItemLocation { get; set; }
+ public bool CopyAssetPath { get; set; }
+
public bool RebuildItem { get; set; }
}
}
diff --git a/Tools/Pipeline/Common/PipelineController.cs b/Tools/Pipeline/Common/PipelineController.cs
index 96e7018f352..1001feca1ec 100644
--- a/Tools/Pipeline/Common/PipelineController.cs
+++ b/Tools/Pipeline/Common/PipelineController.cs
@@ -959,6 +959,19 @@ public IProjectItem GetItem(string originalPath)
return null;
}
+ public void CopyAssetPath()
+ {
+ var item = SelectedItem as ContentItem;
+ if (item != null)
+ {
+ var path = item.OriginalPath;
+ path = path.Remove(path.Length - Path.GetExtension(path).Length);
+ path = path.Replace('\\', '/');
+
+ View.SetClipboard(path);
+ }
+ }
+
#region Undo, Redo
private readonly ActionStack _actionStack;
@@ -1114,6 +1127,7 @@ private void UpdateContextMenu()
info.OpenItem = exists && oneselected && SelectedItem is ContentItem;
info.OpenItemWith = exists && oneselected && !(SelectedItem is DirectoryItem);
info.OpenItemLocation = exists && oneselected;
+ info.CopyAssetPath = exists && oneselected && SelectedItem is ContentItem;
info.Add = (exists && oneselected && !(SelectedItem is ContentItem)) || !somethingselected && ProjectOpen;
info.Exclude = somethingselected && !SelectedItems.Contains(_project);
info.Rename = exists && oneselected;
diff --git a/Tools/Pipeline/Controls/PropertyCells/CellText.cs b/Tools/Pipeline/Controls/PropertyCells/CellText.cs
index e53eaee1092..7c64893b49b 100644
--- a/Tools/Pipeline/Controls/PropertyCells/CellText.cs
+++ b/Tools/Pipeline/Controls/PropertyCells/CellText.cs
@@ -17,7 +17,7 @@ public override void Edit(PixelLayout control)
editText.Style = "OverrideSize";
editText.Width = _lastRec.Width;
editText.Height = _lastRec.Height;
- editText.Text = Value.ToString();
+ editText.Text = (Value == null) ? "" : Value.ToString();
control.Add(editText, _lastRec.X, _lastRec.Y);
diff --git a/Tools/Pipeline/MainWindow.cs b/Tools/Pipeline/MainWindow.cs
index 9f0430639c5..0ff31059acf 100644
--- a/Tools/Pipeline/MainWindow.cs
+++ b/Tools/Pipeline/MainWindow.cs
@@ -18,6 +18,7 @@ partial class MainWindow : Form, IView
public static MainWindow Instance;
private List _pads;
+ private Clipboard _clipboard;
private ContextMenu _contextMenu;
private FileDialogFilter _mgcbFileFilter, _allFileFilter, _xnaFileFilter;
private string[] monoLocations = {
@@ -29,6 +30,7 @@ partial class MainWindow : Form, IView
public MainWindow()
{
_pads = new List();
+ _clipboard = new Clipboard();
InitializeComponent();
@@ -383,6 +385,7 @@ public void UpdateCommands(MenuInfo info)
cmdOpenItem.Enabled = info.OpenItem;
cmdOpenItemWith.Enabled = info.OpenItemWith;
cmdOpenItemLocation.Enabled = info.OpenItemLocation;
+ cmdCopyAssetPath.Enabled = info.CopyAssetPath;
cmdRebuildItem.Enabled = info.RebuildItem;
// Visibility of menu items can't be changed so
@@ -398,6 +401,7 @@ public void UpdateCommands(MenuInfo info)
AddContextMenu(cmAdd, ref sep);
AddSeparator(ref sep);
AddContextMenu(cmOpenItemLocation, ref sep);
+ AddContextMenu(cmCopyAssetPath, ref sep);
AddContextMenu(cmRebuildItem, ref sep);
AddSeparator(ref sep);
AddContextMenu(cmExclude, ref sep);
@@ -463,6 +467,12 @@ public void UpdateRecentList(List recentList)
}
}
+ public void SetClipboard(string text)
+ {
+ _clipboard.Clear();
+ _clipboard.Text = text;
+ }
+
#endregion
#region Commands
@@ -602,6 +612,11 @@ private void CmdOpenItemLocation_Executed(object sender, EventArgs e)
Process.Start(PipelineController.Instance.GetFullPath(PipelineController.Instance.SelectedItem.Location));
}
+ private void CmdCopyAssetPath_Executed(object sender, EventArgs e)
+ {
+ PipelineController.Instance.CopyAssetPath();
+ }
+
private void CmdRebuildItem_Executed(object sender, EventArgs e)
{
PipelineController.Instance.RebuildItems();
diff --git a/Tools/Pipeline/MainWindow.eto.cs b/Tools/Pipeline/MainWindow.eto.cs
index 6be27619e20..96d3a14bc04 100644
--- a/Tools/Pipeline/MainWindow.eto.cs
+++ b/Tools/Pipeline/MainWindow.eto.cs
@@ -17,13 +17,13 @@ partial class MainWindow
public Command cmdBuild, cmdRebuild, cmdClean, cmdCancelBuild;
public CheckCommand cmdDebugMode;
public Command cmdHelp, cmdAbout;
- public Command cmdOpenItem, cmdOpenItemWith, cmdOpenItemLocation, cmdRebuildItem;
+ public Command cmdOpenItem, cmdOpenItemWith, cmdOpenItemLocation, cmdCopyAssetPath, cmdRebuildItem;
MenuBar menubar;
ToolBar toolbar;
ButtonMenuItem menuFile, menuRecent, menuEdit, menuAdd, menuPads, menuBuild, menuHelp;
ToolItem toolBuild, toolRebuild, toolClean, toolCancelBuild;
- MenuItem cmOpenItem, cmOpenItemWith, cmOpenItemLocation, cmRebuildItem, cmExclude, cmRename, cmDelete;
+ MenuItem cmOpenItem, cmOpenItemWith, cmOpenItemLocation, cmCopyAssetPath, cmRebuildItem, cmExclude, cmRename, cmDelete;
ButtonMenuItem cmAdd;
ProjectControl projectControl;
@@ -102,6 +102,7 @@ private void InitializeComponent()
cmdOpenItem.Executed += CmdOpenItem_Executed;
cmdOpenItemWith.Executed += CmdOpenItemWith_Executed;
cmdOpenItemLocation.Executed += CmdOpenItemLocation_Executed;
+ cmdCopyAssetPath.Executed += CmdCopyAssetPath_Executed;
cmdRebuildItem.Executed += CmdRebuildItem_Executed;
}
@@ -241,6 +242,9 @@ private void InitalizeCommands()
cmdOpenItemLocation = new Command();
cmdOpenItemLocation.MenuText = "Open Containing Directory";
+ cmdCopyAssetPath = new Command();
+ cmdCopyAssetPath.MenuText = "Copy Asset Path";
+
cmdRebuildItem = new Command();
cmdRebuildItem.Image = Global.GetEtoIcon("Commands.Rebuild.png");
cmdRebuildItem.MenuText = "Rebuild";
@@ -327,6 +331,7 @@ private void InitalizeContextMenu()
cmAdd.Items.Add(cmdExistingFolder.CreateMenuItem());
cmOpenItemLocation = cmdOpenItemLocation.CreateMenuItem();
+ cmCopyAssetPath = cmdCopyAssetPath.CreateMenuItem();
cmRebuildItem = cmdRebuildItem.CreateMenuItem();
cmExclude = cmdExclude.CreateMenuItem();
cmRename = cmdRename.CreateMenuItem();
From 875f2f20239de8efd0563283944680cb5fd5f59e Mon Sep 17 00:00:00 2001
From: cra0zy
Date: Sat, 15 Oct 2016 02:11:51 +0200
Subject: [PATCH 021/128] Updated Dependencies
---
ThirdParty/Dependencies | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ThirdParty/Dependencies b/ThirdParty/Dependencies
index a82c40d9e60..177c3be65f9 160000
--- a/ThirdParty/Dependencies
+++ b/ThirdParty/Dependencies
@@ -1 +1 @@
-Subproject commit a82c40d9e607711d25448bb05b349a7de5631713
+Subproject commit 177c3be65f9f8bf8daaf11a7d84cd6edb3d96415
From a607ef8458a7e9517b40582bb8fef607ca95eb0a Mon Sep 17 00:00:00 2001
From: Simon Jackson
Date: Sat, 15 Oct 2016 22:11:16 +0100
Subject: [PATCH 022/128] Updated target framework of the Content Pipeline
Extension project
---
.../MonoGameContentPipelineExtension.csproj | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ProjectTemplates/VisualStudio2010/ContentPipelineExtension/MonoGameContentPipelineExtension.csproj b/ProjectTemplates/VisualStudio2010/ContentPipelineExtension/MonoGameContentPipelineExtension.csproj
index 078fa98f2f9..872ed6adfe7 100644
--- a/ProjectTemplates/VisualStudio2010/ContentPipelineExtension/MonoGameContentPipelineExtension.csproj
+++ b/ProjectTemplates/VisualStudio2010/ContentPipelineExtension/MonoGameContentPipelineExtension.csproj
@@ -10,7 +10,7 @@
Properties
$safeprojectname$
$safeprojectname$
- v4.0
+ v4.5
512
From 936f18406a16131240f1ead9fbcccc9190958104 Mon Sep 17 00:00:00 2001
From: Nikos Kastellanos
Date: Sat, 22 Oct 2016 06:54:38 +0300
Subject: [PATCH 023/128] Fix for Pipeline Filter View blocking MGCB.exe output
(#5234)
* Fix for Pipeline Filter View blocking MGCB.exe output
* remove check for UI thread.
---
Tools/Pipeline/MainWindow.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Tools/Pipeline/MainWindow.cs b/Tools/Pipeline/MainWindow.cs
index 9f0430639c5..4bce0cc8bdb 100644
--- a/Tools/Pipeline/MainWindow.cs
+++ b/Tools/Pipeline/MainWindow.cs
@@ -197,7 +197,7 @@ public void UpdateProperties()
public void OutputAppend(string text)
{
- Application.Instance.Invoke(() => buildOutput.WriteLine(text));
+ Application.Instance.AsyncInvoke(() => buildOutput.WriteLine(text));
}
public void OutputClear()
From fad9a327ffe4c296e599b51a4e99acb9d7ad95e3 Mon Sep 17 00:00:00 2001
From: cra0zy
Date: Sun, 23 Oct 2016 13:32:19 +0200
Subject: [PATCH 024/128] [Pipeline Tool] Fix keyboard shortcuts not working on
WPF backend
---
Tools/Pipeline/MainWindow.eto.cs | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/Tools/Pipeline/MainWindow.eto.cs b/Tools/Pipeline/MainWindow.eto.cs
index efd957764cd..74251d5e264 100644
--- a/Tools/Pipeline/MainWindow.eto.cs
+++ b/Tools/Pipeline/MainWindow.eto.cs
@@ -248,8 +248,7 @@ private void InitalizeCommands()
private void InitalizeMenu()
{
- Menu = menubar = new MenuBar();
- Menu.Style = "MenuBar";
+ menubar = new MenuBar();
menuFile = new ButtonMenuItem();
menuFile.Text = "File";
@@ -266,7 +265,7 @@ private void InitalizeMenu()
menuFile.Items.Add(new SeparatorMenuItem());
menuFile.Items.Add(cmdSave);
menuFile.Items.Add(cmdSaveAs);
- Menu.Items.Add(menuFile);
+ menubar.Items.Add(menuFile);
menuEdit = new ButtonMenuItem();
menuEdit.Text = "Edit";
@@ -287,13 +286,13 @@ private void InitalizeMenu()
menuEdit.Items.Add(new SeparatorMenuItem());
menuEdit.Items.Add(cmdRename);
menuEdit.Items.Add(cmdDelete);
- Menu.Items.Add(menuEdit);
+ menubar.Items.Add(menuEdit);
// View Commands
menuView = new ButtonMenuItem();
menuView.Text = "View";
- Menu.Items.Add(menuView);
+ menubar.Items.Add(menuView);
menuBuild = new ButtonMenuItem();
menuBuild.Text = "Build";
@@ -303,15 +302,18 @@ private void InitalizeMenu()
menuBuild.Items.Add(cmdCancelBuild);
menuBuild.Items.Add(new SeparatorMenuItem());
menuBuild.Items.Add(cmdDebugMode);
- Menu.Items.Add(menuBuild);
+ menubar.Items.Add(menuBuild);
menuHelp = new ButtonMenuItem();
menuHelp.Text = "Help";
menuHelp.Items.Add(cmdHelp);
- Menu.Items.Add(menuHelp);
+ menubar.Items.Add(menuHelp);
+
+ menubar.QuitItem = cmdExit;
+ menubar.AboutItem = cmdAbout;
- Menu.QuitItem = cmdExit;
- Menu.AboutItem = cmdAbout;
+ Menu = menubar;
+ Menu.Style = "MenuBar";
}
private void InitalizeContextMenu()
From 2423549a45fd3ff7183de2530b2bbf0c6b4e4d4f Mon Sep 17 00:00:00 2001
From: Nikos Kastellanos
Date: Tue, 25 Oct 2016 23:35:11 +0300
Subject: [PATCH 025/128] Performance improvement to SpriteBatch.DrawString()
(#5226)
Performance improvements to SpriteBatch.DrawString()
---
MonoGame.Framework/Graphics/SpriteFont.cs | 114 +++++++---------------
1 file changed, 34 insertions(+), 80 deletions(-)
diff --git a/MonoGame.Framework/Graphics/SpriteFont.cs b/MonoGame.Framework/Graphics/SpriteFont.cs
index 4dc7d924e26..d10025fdc88 100644
--- a/MonoGame.Framework/Graphics/SpriteFont.cs
+++ b/MonoGame.Framework/Graphics/SpriteFont.cs
@@ -1,70 +1,6 @@
-#region License
-/*
-Microsoft Public License (Ms-PL)
-MonoGame - Copyright © 2009-2012 The MonoGame Team
-
-All rights reserved.
-
-This license governs use of the accompanying software. If you use the software,
-you accept this license. If you do not accept the license, do not use the
-software.
-
-1. Definitions
-
-The terms "reproduce," "reproduction," "derivative works," and "distribution"
-have the same meaning here as under U.S. copyright law.
-
-A "contribution" is the original software, or any additions or changes to the
-software.
-
-A "contributor" is any person that distributes its contribution under this
-license.
-
-"Licensed patents" are a contributor's patent claims that read directly on its
-contribution.
-
-2. Grant of Rights
-
-(A) Copyright Grant- Subject to the terms of this license, including the
-license conditions and limitations in section 3, each contributor grants you a
-non-exclusive, worldwide, royalty-free copyright license to reproduce its
-contribution, prepare derivative works of its contribution, and distribute its
-contribution or any derivative works that you create.
-
-(B) Patent Grant- Subject to the terms of this license, including the license
-conditions and limitations in section 3, each contributor grants you a
-non-exclusive, worldwide, royalty-free license under its licensed patents to
-make, have made, use, sell, offer for sale, import, and/or otherwise dispose of
-its contribution in the software or derivative works of the contribution in the
-software.
-
-3. Conditions and Limitations
-
-(A) No Trademark License- This license does not grant you rights to use any
-contributors' name, logo, or trademarks.
-
-(B) If you bring a patent claim against any contributor over patents that you
-claim are infringed by the software, your patent license from such contributor
-to the software ends automatically.
-
-(C) If you distribute any portion of the software, you must retain all
-copyright, patent, trademark, and attribution notices that are present in the
-software.
-
-(D) If you distribute any portion of the software in source code form, you may
-do so only under this license by including a complete copy of this license with
-your distribution. If you distribute any portion of the software in compiled or
-object code form, you may only do so under a license that complies with this
-license.
-
-(E) The software is licensed "as-is." You bear the risk of using it. The
-contributors give no express warranties, guarantees or conditions. You may have
-additional consumer rights under your local laws which this license cannot
-change. To the extent permitted under your local laws, the contributors exclude
-the implied warranties of merchantability, fitness for a particular purpose and
-non-infringement.
-*/
-#endregion License
+// MonoGame - Copyright (C) The MonoGame Team
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE.txt', which is part of this source code package.
// Original code from SilverSprite Project
using System;
@@ -297,19 +233,37 @@ internal void DrawInto( SpriteBatch spriteBatch, ref CharacterSource text, Vecto
}
}
- // TODO: This looks excessive... i suspect we could do most
- // of this with simple vector math and avoid this much matrix work.
-
- Matrix transformation, temp;
- Matrix.CreateTranslation(-origin.X, -origin.Y, 0f, out transformation);
- Matrix.CreateScale((flippedHorz ? -scale.X : scale.X), (flippedVert ? -scale.Y : scale.Y), 1f, out temp);
- Matrix.Multiply(ref transformation, ref temp, out transformation);
- Matrix.CreateTranslation(flipAdjustment.X, flipAdjustment.Y, 0, out temp);
- Matrix.Multiply(ref temp, ref transformation, out transformation);
- Matrix.CreateRotationZ(rotation, out temp);
- Matrix.Multiply(ref transformation, ref temp, out transformation);
- Matrix.CreateTranslation(position.X, position.Y, 0f, out temp);
- Matrix.Multiply(ref transformation, ref temp, out transformation);
+ // OPTIMIZED
+ //Matrix transformation, temp;
+ //Matrix.CreateTranslation(-origin.X, -origin.Y, 0f, out transformation);
+ //Matrix.CreateScale((flippedHorz ? -scale.X : scale.X), (flippedVert ? -scale.Y : scale.Y), 1f, out temp);
+ //Matrix.Multiply(ref transformation, ref temp, out transformation);
+ //Matrix.CreateTranslation(flipAdjustment.X, flipAdjustment.Y, 0, out temp);
+ //Matrix.Multiply(ref temp, ref transformation, out transformation);
+ //Matrix.CreateRotationZ(rotation, out temp);
+ //Matrix.Multiply(ref transformation, ref temp, out transformation);
+ //Matrix.CreateTranslation(position.X, position.Y, 0f, out temp);
+ //Matrix.Multiply(ref transformation, ref temp, out transformation);
+
+ Matrix transformation = Matrix.Identity;
+ if (rotation == 0)
+ {
+ transformation.M11 = (flippedHorz ? -scale.X : scale.X);
+ transformation.M22 = (flippedVert ? -scale.Y : scale.Y);
+ transformation.M41 = ((flipAdjustment.X - origin.X) * transformation.M11) + position.X;
+ transformation.M42 = ((flipAdjustment.Y - origin.Y) * transformation.M22) + position.Y;
+ }
+ else
+ {
+ var cos = (float)Math.Cos(rotation);
+ var sin = (float)Math.Sin(rotation);
+ transformation.M11 = (flippedHorz ? -scale.X : scale.X) * cos;
+ transformation.M12 = (flippedHorz ? -scale.X : scale.X) * sin;
+ transformation.M21 = (flippedVert ? -scale.Y : scale.Y) * (-sin);
+ transformation.M22 = (flippedVert ? -scale.Y : scale.Y) * cos;
+ transformation.M41 = (((flipAdjustment.X - origin.X) * transformation.M11) + (flipAdjustment.Y - origin.Y) * transformation.M21) + position.X;
+ transformation.M42 = (((flipAdjustment.X - origin.X) * transformation.M12) + (flipAdjustment.Y - origin.Y) * transformation.M22) + position.Y;
+ }
// Get the default glyph here once.
Glyph? defaultGlyph = null;
From 7e2f3d16f3e0f82b7be3a4bdfe0333254508e7ac Mon Sep 17 00:00:00 2001
From: Nikos Kastellanos
Date: Thu, 27 Oct 2016 08:27:59 +0300
Subject: [PATCH 026/128] Fix: IndexBuffer doesn't detect the correct
IndexElementSize.
IndexElementSize depents on the number of Vertices, not the number of
indices.
---
.../Serialization/Compiler/IndexBufferWriter.cs | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/MonoGame.Framework.Content.Pipeline/Serialization/Compiler/IndexBufferWriter.cs b/MonoGame.Framework.Content.Pipeline/Serialization/Compiler/IndexBufferWriter.cs
index 47ff00d499b..cf09f372060 100644
--- a/MonoGame.Framework.Content.Pipeline/Serialization/Compiler/IndexBufferWriter.cs
+++ b/MonoGame.Framework.Content.Pipeline/Serialization/Compiler/IndexBufferWriter.cs
@@ -11,7 +11,17 @@ class IndexBufferWriter : BuiltInContentWriter
{
protected internal override void Write(ContentWriter output, IndexCollection value)
{
- var shortIndices = value.Count < ushort.MaxValue;
+ // Check if the buffer and can be saved as Int16.
+ var shortIndices = true;
+ foreach(var index in value)
+ {
+ if(index > ushort.MaxValue)
+ {
+ shortIndices = false;
+ break;
+ }
+ }
+
output.Write(shortIndices);
var byteCount = shortIndices
From ea7cbc170fc36bf71ede8621924c676bf8cee716 Mon Sep 17 00:00:00 2001
From: James Ford
Date: Thu, 27 Oct 2016 13:33:10 -0500
Subject: [PATCH 027/128] Prevent duplicates in ModelMesh.Effects
---
MonoGame.Framework/Graphics/ModelMeshPart.cs | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/MonoGame.Framework/Graphics/ModelMeshPart.cs b/MonoGame.Framework/Graphics/ModelMeshPart.cs
index 7cf1fb2f42e..337c253021a 100644
--- a/MonoGame.Framework/Graphics/ModelMeshPart.cs
+++ b/MonoGame.Framework/Graphics/ModelMeshPart.cs
@@ -38,7 +38,9 @@ public Effect Effect
// Set the new effect.
_effect = value;
- parent.Effects.Add(value);
+
+ if (_effect != null && !parent.Effects.Contains(_effect))
+ parent.Effects.Add(_effect);
}
}
From 48e0e12fda6a1ce4b8f933e134402b4dd9fd2a2b Mon Sep 17 00:00:00 2001
From: Jesse
Date: Fri, 28 Oct 2016 23:28:45 +0200
Subject: [PATCH 028/128] Fix BoundinBox.Contains(Vector3) to match XNA (#5246)
* Fix BoundinBox.Contains(Vector3) to match XNA
* Add some more tests
---
MonoGame.Framework/BoundingBox.cs | 11 +++--------
Test/Framework/Bounding.cs | 25 +++++++++++++++++++++++++
2 files changed, 28 insertions(+), 8 deletions(-)
diff --git a/MonoGame.Framework/BoundingBox.cs b/MonoGame.Framework/BoundingBox.cs
index 077a01da9fc..c51d7e40b36 100644
--- a/MonoGame.Framework/BoundingBox.cs
+++ b/MonoGame.Framework/BoundingBox.cs
@@ -214,16 +214,11 @@ public void Contains(ref Vector3 point, out ContainmentType result)
|| point.Z > this.Max.Z)
{
result = ContainmentType.Disjoint;
- }//or if point is on box because coordonate of point is lesser or equal
- else if (point.X == this.Min.X
- || point.X == this.Max.X
- || point.Y == this.Min.Y
- || point.Y == this.Max.Y
- || point.Z == this.Min.Z
- || point.Z == this.Max.Z)
- result = ContainmentType.Intersects;
+ }
else
+ {
result = ContainmentType.Contains;
+ }
}
private static readonly Vector3 MaxVector3 = new Vector3(float.MaxValue);
diff --git a/Test/Framework/Bounding.cs b/Test/Framework/Bounding.cs
index 4459e6b05ef..cb38c0c9458 100644
--- a/Test/Framework/Bounding.cs
+++ b/Test/Framework/Bounding.cs
@@ -11,6 +11,31 @@ namespace MonoGame.Tests.Framework
[TestFixture]
class Bounding
{
+ [Test]
+ public void BoxContainsVector3Test()
+ {
+ var box = new BoundingBox(Vector3.Zero, Vector3.One);
+
+ Assert.AreEqual(ContainmentType.Disjoint, box.Contains(-Vector3.One));
+ Assert.AreEqual(ContainmentType.Disjoint, box.Contains(new Vector3(0.5f, 0.5f, -1f)));
+ Assert.AreEqual(ContainmentType.Contains, box.Contains(Vector3.Zero));
+ Assert.AreEqual(ContainmentType.Contains, box.Contains(new Vector3(0f, 0, 0.5f)));
+ Assert.AreEqual(ContainmentType.Contains, box.Contains(new Vector3(0f, 0.5f, 0.5f)));
+ Assert.AreEqual(ContainmentType.Contains, box.Contains(Vector3.One));
+ Assert.AreEqual(ContainmentType.Contains, box.Contains(new Vector3(1f, 1, 0.5f)));
+ Assert.AreEqual(ContainmentType.Contains, box.Contains(new Vector3(1f, 0.5f, 0.5f)));
+ Assert.AreEqual(ContainmentType.Contains, box.Contains(new Vector3(0.5f, 0.5f, 0.5f)));
+ }
+
+ [Test]
+ public void BoxContainsIdenticalBox()
+ {
+ var b1 = new BoundingBox(Vector3.Zero, Vector3.One);
+ var b2 = new BoundingBox(Vector3.Zero, Vector3.One);
+
+ Assert.AreEqual(ContainmentType.Contains, b1.Contains(b2));
+ }
+
[Test]
public void BoundingSphereTests()
{
From 41fde0707931697a893a8a83794a8d5f340005f1 Mon Sep 17 00:00:00 2001
From: cra0zy
Date: Sat, 29 Oct 2016 22:07:50 +0200
Subject: [PATCH 029/128] [Pipeline Tool] Update Linux icons
---
Tools/Pipeline/Global.Linux.cs | 2 +-
Tools/Pipeline/MainWindow.glade | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Tools/Pipeline/Global.Linux.cs b/Tools/Pipeline/Global.Linux.cs
index be3209d822e..e8cff544a9c 100644
--- a/Tools/Pipeline/Global.Linux.cs
+++ b/Tools/Pipeline/Global.Linux.cs
@@ -198,7 +198,7 @@ private static Gdk.Pixbuf PlatformGetIcon(string resource)
iconInfo = _theme.LookupIcon("edit-clear-all", 16, 0);
break;
case "Commands.CancelBuild.png":
- iconInfo = _theme.LookupIcon("stop", 16, 0);
+ iconInfo = _theme.LookupIcon("process-stop", 16, 0);
break;
case "Commands.Help.png":
iconInfo = _theme.LookupIcon("help", 16, 0);
diff --git a/Tools/Pipeline/MainWindow.glade b/Tools/Pipeline/MainWindow.glade
index 4d5f2c8f4e2..36142cdcbc5 100644
--- a/Tools/Pipeline/MainWindow.glade
+++ b/Tools/Pipeline/MainWindow.glade
@@ -18,7 +18,7 @@
True
False
- emblem-system-symbolic
+ applications-system-symbolic
True
@@ -28,7 +28,7 @@
True
False
- media-playback-stop-symbolic
+ process-stop-symbolic
True
From 7bfc49ce342a7d8d06de8d31104aed5c9fd992c7 Mon Sep 17 00:00:00 2001
From: cra0zy
Date: Sun, 30 Oct 2016 00:00:12 +0200
Subject: [PATCH 030/128] [Pipeline Tool] Optimize ProjectView image loading
---
Tools/Pipeline/Global.Linux.cs | 80 ++++++++++--------------
Tools/Pipeline/Global.Mac.cs | 11 +++-
Tools/Pipeline/Global.Windows.cs | 47 ++++++--------
Tools/Pipeline/Global.cs | 102 +++++++++++++++++++------------
4 files changed, 119 insertions(+), 121 deletions(-)
diff --git a/Tools/Pipeline/Global.Linux.cs b/Tools/Pipeline/Global.Linux.cs
index be3209d822e..b64a8447da4 100644
--- a/Tools/Pipeline/Global.Linux.cs
+++ b/Tools/Pipeline/Global.Linux.cs
@@ -3,12 +3,10 @@
// file 'LICENSE.txt', which is part of this source code package.
using System;
-using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
using Eto.Drawing;
-using Eto.Forms;
using Eto.GtkSharp.Drawing;
using Gtk;
@@ -34,26 +32,34 @@ static partial class Gtk3Wrapper
static partial class Global
{
private static IconTheme _theme;
- private static Gdk.Pixbuf _iconMissing;
- private static Gtk.Application _app;
+ private static Application _app;
private static void PlatformInit()
{
Linux = true;
_theme = IconTheme.Default;
- try
- {
- _iconMissing = _theme.LoadIcon("error", 16, 0);
- }
- catch
- {
- _iconMissing = new Gdk.Pixbuf(null, "TreeView.Missing.png");
- }
+ var iconMissing = _theme.LoadIcon("error", 16, 0);
+ var file = _theme.LoadIcon("text-x-generic", 16, 0);
+ var fileMissing = file.Copy();
+ iconMissing.Composite(fileMissing, 8, 8, 8, 8, 8, 8, 0.5, 0.5, Gdk.InterpType.Tiles, 255);
+ var folder = _theme.LoadIcon("folder", 16, 0);
+ var folderMissing = folder.Copy();
+ iconMissing.Composite(folderMissing, 8, 8, 8, 8, 8, 8, 0.5, 0.5, Gdk.InterpType.Tiles, 255);
+
+ _files["."] = ToEtoImage(file);
+ _fileMissing = ToEtoImage(fileMissing);
+ _folder = ToEtoImage(folder);
+ _folderMissing = ToEtoImage(folderMissing);
+
+ _xwtFiles["."] = ToXwtImage(file);
+ _xwtFileMissing = ToXwtImage(fileMissing);
+ _xwtFolder = ToXwtImage(folder);
+ _xwtFolderMissing = ToXwtImage(folderMissing);
if (Gtk.Global.MajorVersion >= 3 && Gtk.Global.MinorVersion >= 16)
{
- _app = new Gtk.Application(null, GLib.ApplicationFlags.None);
+ _app = new Application(null, GLib.ApplicationFlags.None);
_app.Register(GLib.Cancellable.Current);
UseHeaderBar = Gtk3Wrapper.gtk_application_prefers_app_menu(_app.Handle);
@@ -62,7 +68,7 @@ private static void PlatformInit()
private static void PlatformShowOpenWithDialog(string filePath)
{
- var adialoghandle = Gtk3Wrapper.gtk_app_chooser_dialog_new(((Gtk.Window)MainWindow.Instance.ControlObject).Handle,
+ var adialoghandle = Gtk3Wrapper.gtk_app_chooser_dialog_new(((Window)MainWindow.Instance.ControlObject).Handle,
4 + (int)DialogFlags.Modal,
Gtk3Wrapper.g_file_new_for_path(filePath));
var adialog = new AppChooserDialog(adialoghandle);
@@ -73,50 +79,26 @@ private static void PlatformShowOpenWithDialog(string filePath)
adialog.Destroy();
}
- private static Gdk.Pixbuf PlatformGetDirectoryIcon(bool exists)
- {
- var icon = _theme.LoadIcon("folder", 16, 0);
-
- if (!exists)
- {
- icon = icon.Copy();
- _iconMissing.Composite(icon, 8, 8, 8, 8, 8, 8, 0.5, 0.5, Gdk.InterpType.Tiles, 255);
- }
-
- return icon;
- }
-
- private static Gdk.Pixbuf PlatformGetFileIcon(string path, bool exists)
+ private static Gdk.Pixbuf PlatformGetFileIcon(string path)
{
Gdk.Pixbuf icon = null;
- try
- {
- var info = new GLib.FileInfo(Gtk3Wrapper.g_file_query_info(Gtk3Wrapper.g_file_new_for_path(path), "standard::*", 0, new IntPtr(), new IntPtr()));
- var sicon = info.Icon.ToString().Split(' ');
+ var info = new GLib.FileInfo(Gtk3Wrapper.g_file_query_info(Gtk3Wrapper.g_file_new_for_path(path), "standard::*", 0, new IntPtr(), new IntPtr()));
+ var sicon = info.Icon.ToString().Split(' ');
- for (int i = sicon.Length - 1; i >= 1; i--)
+ for (int i = sicon.Length - 1; i >= 1; i--)
+ {
+ try
{
- try
- {
- icon = _theme.LoadIcon(sicon[i], 16, 0);
- if (icon != null)
- break;
- }
- catch { }
+ icon = _theme.LoadIcon(sicon[i], 16, 0);
+ if (icon != null)
+ break;
}
+ catch { }
}
- catch { }
if (icon == null)
- icon = _theme.LoadIcon("text-x-generic", 16, 0);
-
-
- if (!exists)
- {
- icon = icon.Copy();
- _iconMissing.Composite(icon, 8, 8, 8, 8, 8, 8, 0.5, 0.5, Gdk.InterpType.Tiles, 255);
- }
+ throw new Exception();
return icon;
}
diff --git a/Tools/Pipeline/Global.Mac.cs b/Tools/Pipeline/Global.Mac.cs
index 7ff1548c097..fd9e9c3146f 100644
--- a/Tools/Pipeline/Global.Mac.cs
+++ b/Tools/Pipeline/Global.Mac.cs
@@ -14,13 +14,18 @@ private static void PlatformInit()
{
}
-
- private static Image PlatformGetDirectoryIcon(bool exists)
+
+ private static Image PlatformGetFileIcon(string path)
+ {
+ throw new NotImplementedException();
+ }
+
+ private static Bitmap ToEtoImage(Image image)
{
throw new NotImplementedException();
}
- private static Image PlatformGetFileIcon(string path, bool exists)
+ private static Xwt.Drawing.Image ToXwtImage(Image image)
{
throw new NotImplementedException();
}
diff --git a/Tools/Pipeline/Global.Windows.cs b/Tools/Pipeline/Global.Windows.cs
index c5789e4f34a..9f0e57bffbc 100755
--- a/Tools/Pipeline/Global.Windows.cs
+++ b/Tools/Pipeline/Global.Windows.cs
@@ -26,6 +26,21 @@ private static void PlatformInit()
{
var reg = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion");
IsWindows10 = (reg.GetValue("ProductName") as string).StartsWith("Windows 10");
+
+ var file = ExtractIcon(0).ToBitmap();
+ var fileMissing = ExtractIcon(271).ToBitmap();
+ var folder = ExtractIcon(4).ToBitmap();
+ var folderMissing = ExtractIcon(234).ToBitmap();
+
+ _files["."] = ToEtoImage(file);
+ _fileMissing = ToEtoImage(fileMissing);
+ _folder = ToEtoImage(folder);
+ _folderMissing = ToEtoImage(folderMissing);
+
+ _xwtFiles["."] = ToXwtImage(file);
+ _xwtFileMissing = ToXwtImage(fileMissing);
+ _xwtFolder = ToXwtImage(folderMissing);
+ _xwtFolderMissing = ToXwtImage(folderMissing);
}
public static System.Drawing.Icon ExtractIcon(int number)
@@ -37,37 +52,9 @@ public static System.Drawing.Icon ExtractIcon(int number)
return System.Drawing.Icon.FromHandle(large);
}
- private static System.Drawing.Bitmap PlatformGetDirectoryIcon(bool exists)
- {
- System.Drawing.Bitmap icon;
-
- if (exists)
- icon = ExtractIcon(4).ToBitmap();
- else
- icon = ExtractIcon(234).ToBitmap();
-
- return icon;
- }
-
- private static System.Drawing.Bitmap PlatformGetFileIcon(string path, bool exists)
+ private static System.Drawing.Bitmap PlatformGetFileIcon(string path)
{
- System.Drawing.Bitmap icon;
-
- if (exists)
- {
- try
- {
- icon = System.Drawing.Icon.ExtractAssociatedIcon(path).ToBitmap();
- }
- catch
- {
- icon = ExtractIcon(0).ToBitmap();
- }
- }
- else
- icon = ExtractIcon(271).ToBitmap();
-
- return icon;
+ return System.Drawing.Icon.ExtractAssociatedIcon(path).ToBitmap();
}
private static Bitmap ToEtoImage(System.Drawing.Bitmap bitmap)
diff --git a/Tools/Pipeline/Global.cs b/Tools/Pipeline/Global.cs
index 73cef196580..02e8b6f0574 100644
--- a/Tools/Pipeline/Global.cs
+++ b/Tools/Pipeline/Global.cs
@@ -3,34 +3,52 @@
// file 'LICENSE.txt', which is part of this source code package.
using System;
+using System.Collections.Generic;
using System.IO;
using Eto.Drawing;
-using Eto.Forms;
namespace MonoGame.Tools.Pipeline
{
static partial class Global
{
+ public static string NotAllowedCharacters
+ {
+ get
+ {
+ if (Unix)
+ return Linux ? "/" : ":";
+
+ return "/?<>\\:*|\"";
+ }
+ }
+
public static bool Linux { get; private set; }
public static bool UseHeaderBar { get; private set; }
public static bool Unix { get; private set; }
+ private static Dictionary _files;
+ private static Image _fileMissing, _folder, _folderMissing;
+
+ private static Dictionary _xwtFiles;
+ private static Xwt.Drawing.Image _xwtFileMissing, _xwtFolder, _xwtFolderMissing;
+
static Global()
{
Unix = Environment.OSVersion.Platform == PlatformID.Unix || Environment.OSVersion.Platform == PlatformID.MacOSX;
- PlatformInit();
- }
+ _files = new Dictionary();
+ _files.Add(".", Bitmap.FromResource("TreeView.File.png"));
+ _fileMissing = Bitmap.FromResource("TreeView.FileMissing.png");
+ _folder = Bitmap.FromResource("TreeView.Folder.png");
+ _folderMissing = Bitmap.FromResource("TreeView.FolderMissing.png");
- public static string NotAllowedCharacters
- {
- get
- {
- if (Global.Unix)
- return Global.Linux ? "/" : ":";
+ _xwtFiles = new Dictionary();
+ _xwtFiles.Add(".", Xwt.Drawing.Image.FromResource("TreeView.File.png"));
+ _xwtFileMissing = Xwt.Drawing.Image.FromResource("TreeView.FileMissing.png");
+ _xwtFolder = Xwt.Drawing.Image.FromResource("TreeView.Folder.png");
+ _xwtFolderMissing = Xwt.Drawing.Image.FromResource("TreeView.FolderMissing.png");
- return "/?<>\\:*|\"";
- }
+ PlatformInit();
}
public static bool CheckString(string s)
@@ -58,54 +76,60 @@ public static void ShowOpenWithDialog(string filePath)
public static Image GetEtoDirectoryIcon(bool exists)
{
-#if WINDOWS || LINUX
- try
- {
- return ToEtoImage(PlatformGetDirectoryIcon(exists));
- }
- catch { }
-#endif
-
- return exists ? Bitmap.FromResource("TreeView.Folder.png") : Bitmap.FromResource("TreeView.FolderMissing.png");
+ return exists ? _folder : _folderMissing;
}
public static Image GetEtoFileIcon(string path, bool exists)
{
-#if WINDOWS || LINUX
+ if (!exists)
+ return _fileMissing;
+
+ var ext = Path.GetExtension(path);
+ if (_files.ContainsKey(ext))
+ return _files[ext];
+
+ Image icon;
+
try
{
- return ToEtoImage(PlatformGetFileIcon(path, exists));
+ icon = ToEtoImage(PlatformGetFileIcon(path));
+ }
+ catch
+ {
+ icon = _files["."];
}
- catch { }
-#endif
- return exists ? Bitmap.FromResource("TreeView.File.png") : Bitmap.FromResource("TreeView.FileMissing.png");
+ _files.Add(ext, icon);
+ return icon;
}
public static Xwt.Drawing.Image GetXwtDirectoryIcon(bool exists)
{
-#if WINDOWS || LINUX
- try
- {
- return ToXwtImage(PlatformGetDirectoryIcon(exists));
- }
- catch { }
-#endif
-
- return exists ? Xwt.Drawing.Image.FromResource("TreeView.Folder.png") : Xwt.Drawing.Image.FromResource("TreeView.FolderMissing.png");
+ return exists ? _xwtFolder : _xwtFolderMissing;
}
public static Xwt.Drawing.Image GetXwtFileIcon(string path, bool exists)
{
-#if WINDOWS || LINUX
+ if (!exists)
+ return _xwtFileMissing;
+
+ var ext = Path.GetExtension(path);
+ if (_xwtFiles.ContainsKey(ext))
+ return _xwtFiles[ext];
+
+ Xwt.Drawing.Image icon;
+
try
{
- return ToXwtImage(PlatformGetFileIcon(path, exists));
+ icon = ToXwtImage(PlatformGetFileIcon(path));
+ }
+ catch
+ {
+ icon = _xwtFiles["."];
}
- catch { }
-#endif
- return exists ? Xwt.Drawing.Image.FromResource("TreeView.File.png") : Xwt.Drawing.Image.FromResource("TreeView.FileMissing.png");
+ _xwtFiles.Add(ext, icon);
+ return icon;
}
public static Image GetEtoIcon(string resource)
From bba47979e84462f9c5d9a81dc830b9e4eb7f72f9 Mon Sep 17 00:00:00 2001
From: cra0zy
Date: Fri, 28 Oct 2016 23:30:09 +0200
Subject: [PATCH 031/128] [Pipeline Tool] New FilterView
---
Build/Projects/Pipeline.definition | 2 +
Tools/Pipeline/Common/PipelineSettings.cs | 6 +-
Tools/Pipeline/Controls/BuildItem.cs | 115 ++++++++
Tools/Pipeline/Controls/BuildOutput.cs | 274 ++++++++++++++----
Tools/Pipeline/Controls/BuildOutput.eto.cs | 18 +-
Tools/Pipeline/Controls/DrawInfo.cs | 36 +++
.../Controls/PropertyCells/CellBase.cs | 8 +-
Tools/Pipeline/Controls/PropertyGridTable.cs | 55 +---
.../Controls/PropertyGridTable.eto.cs | 4 +-
Tools/Pipeline/Global.Linux.cs | 6 +-
Tools/Pipeline/Styles.Linux.cs | 32 ++
11 files changed, 435 insertions(+), 121 deletions(-)
create mode 100644 Tools/Pipeline/Controls/BuildItem.cs
create mode 100644 Tools/Pipeline/Controls/DrawInfo.cs
diff --git a/Build/Projects/Pipeline.definition b/Build/Projects/Pipeline.definition
index cf48255d380..007a4b1756d 100644
--- a/Build/Projects/Pipeline.definition
+++ b/Build/Projects/Pipeline.definition
@@ -122,6 +122,8 @@
+
+
Pad.cs
diff --git a/Tools/Pipeline/Common/PipelineSettings.cs b/Tools/Pipeline/Common/PipelineSettings.cs
index 59a3f0c33c5..7d6b68ac92f 100644
--- a/Tools/Pipeline/Common/PipelineSettings.cs
+++ b/Tools/Pipeline/Common/PipelineSettings.cs
@@ -21,7 +21,8 @@ public class PipelineSettings
public string StartupProject;
public Microsoft.Xna.Framework.Point Size;
public int HSeparator, VSeparator;
- public bool Maximized, FilterOutput, AutoScrollBuildOutput, DebugMode, PropertyGroupSort;
+ public bool Maximized, DebugMode, PropertyGroupSort;
+ public bool FilterOutput, FilterShowSkipped, FilterShowSuccessful, FilterShowCleaned, AutoScrollBuildOutput;
static PipelineSettings()
{
@@ -34,6 +35,9 @@ public PipelineSettings()
PropertyGroupSort = true;
FilterOutput = true;
+ FilterShowSkipped = true;
+ FilterShowSuccessful = true;
+ FilterShowCleaned = true;
AutoScrollBuildOutput = true;
try
diff --git a/Tools/Pipeline/Controls/BuildItem.cs b/Tools/Pipeline/Controls/BuildItem.cs
new file mode 100644
index 00000000000..d8307c01df0
--- /dev/null
+++ b/Tools/Pipeline/Controls/BuildItem.cs
@@ -0,0 +1,115 @@
+using System;
+using System.Collections.Generic;
+using Eto.Drawing;
+
+namespace MonoGame.Tools.Pipeline
+{
+ class BuildItem
+ {
+ private const int CellHeight = 32;
+ private const int Spacing = 10;
+ private const int Margin = 10;
+ private const string ArrowCollapse = "â–²";
+ private const string ArrowExpand = "â–¼";
+ private const int ButtonSpacing = 3;
+
+ public string Text { get; set; }
+ public Image Icon { get; set; }
+ public int Height { get; set; }
+ public int RequestedWidth { get; set; }
+
+ public string Description
+ {
+ set
+ {
+ _description.Clear();
+ _description.Add(value);
+ }
+ }
+
+ private readonly float _arrowWidth;
+ private readonly float _textOffset;
+ private readonly float _imageOffset;
+ private readonly float _descSize;
+
+ private List _description;
+ private float _descriptionOffset;
+ private bool _expanded;
+ private bool _selected;
+
+ public BuildItem()
+ {
+ _arrowWidth = SystemFonts.Default().MeasureString(ArrowExpand).Width;
+ _textOffset = (CellHeight - DrawInfo.TextHeight) / 2;
+ _imageOffset = (CellHeight - 16) / 2;
+ _descSize = SystemFonts.Default().LineHeight + 4;
+
+ _description = new List();
+
+ Height = CellHeight;
+ RequestedWidth = 0;
+ }
+
+ public void AddDescription(string text)
+ {
+ _description.Add(text);
+ }
+
+ public void OnClick()
+ {
+ if (_selected && _description.Count != 0)
+ {
+ _expanded = !_expanded;
+
+ if (_expanded)
+ {
+ _descriptionOffset = (_descSize - DrawInfo.TextHeight) / 2;
+ Height = (int)(CellHeight + _descSize * _description.Count);
+
+ foreach (var des in _description)
+ {
+ var width = SystemFonts.Default().MeasureString(des).Width + 4 * Spacing + 16;
+ if (width > RequestedWidth)
+ RequestedWidth = (int)width;
+ }
+ }
+ else
+ {
+ Height = CellHeight;
+ RequestedWidth = 0;
+ }
+ }
+ }
+
+ public void Draw(Graphics g, int y, int width)
+ {
+ var x = Margin;
+ _selected = BuildOutput.MouseLocation.Y > y && BuildOutput.MouseLocation.Y < y + CellHeight;
+
+ // Draw Background
+ g.FillRectangle(DrawInfo.BorderColor, 0, y, width, Height);
+ g.FillRectangle(_selected ? DrawInfo.HoverBackColor : DrawInfo.BorderColor, 0, y, width, CellHeight);
+
+ // Draw Icon
+ g.DrawImage(Icon, x, y + _imageOffset);
+ x += 16 + Spacing;
+
+ // Draw Text
+ g.DrawText(SystemFonts.Default(), DrawInfo.GetTextColor(_selected, false), x, y + _textOffset, Text);
+
+ // Draw Expander
+ if (_description.Count != 0)
+ {
+ //g.FillRectangle(_expandSelected ? DrawInfo.HoverBackColor : DrawInfo.BorderColor, rectangle);
+ g.DrawText(SystemFonts.Default(), DrawInfo.GetTextColor(_selected, false), width - Margin - _arrowWidth, y + _textOffset, _expanded ? ArrowCollapse : ArrowExpand);
+ }
+
+ // Draw Description
+ if (_expanded)
+ {
+ for (int i = 0; i < _description.Count; i++)
+ g.DrawText(SystemFonts.Default(), DrawInfo.DisabledTextColor, x + Spacing, y + CellHeight + _descriptionOffset + _descSize * i, _description[i]);
+ }
+ }
+ }
+}
diff --git a/Tools/Pipeline/Controls/BuildOutput.cs b/Tools/Pipeline/Controls/BuildOutput.cs
index 1625c11d4e7..342cb113d2e 100644
--- a/Tools/Pipeline/Controls/BuildOutput.cs
+++ b/Tools/Pipeline/Controls/BuildOutput.cs
@@ -3,66 +3,116 @@
// file 'LICENSE.txt', which is part of this source code package.
using System;
-using Xwt;
-using Xwt.Drawing;
+using System.Collections.Generic;
+using Eto.Drawing;
+using Eto.Forms;
namespace MonoGame.Tools.Pipeline
{
public partial class BuildOutput
{
+ public static Point MouseLocation;
+ public static int Count;
+ public static int ReqWidth;
+
private OutputParser _output;
- private TreeStore _treeStore;
- private readonly DataField _dataImage;
- private readonly DataField _dataText;
- private TreePosition _last;
+ private List _items;
+ private CheckCommand _cmdFilterOutput, _cmdAutoScroll, _cmdShowSkipped, _cmdShowSuccessful, _cmdShowCleaned;
private Image _iconInformation, _iconFail, _iconProcessing, _iconSkip, _iconSucceed, _iconSucceedWithWarnings, _iconStart, _iconEndSucceed, _iconEndFailed;
- private Eto.Forms.CheckCommand _cmdFilterOutput, _cmdAutoScroll;
+ private BuildItem _selectedItem;
public BuildOutput()
{
InitializeComponent();
-
+ scrollable1.Style = "BuildOutput";
+
_output = new OutputParser();
- _iconInformation = Global.GetXwtIcon("Build.Information.png");
- _iconFail = Global.GetXwtIcon("Build.Fail.png");
- _iconProcessing = Global.GetXwtIcon("Build.Processing.png");
- _iconSkip = Global.GetXwtIcon("Build.Skip.png");
- _iconStart = Global.GetXwtIcon("Build.Start.png");
- _iconEndSucceed = Global.GetXwtIcon("Build.EndSucceed.png");
- _iconEndFailed = Global.GetXwtIcon("Build.EndFailed.png");
- _iconSucceed = Global.GetXwtIcon("Build.Succeed.png");
- _iconSucceedWithWarnings = Global.GetXwtIcon("Build.SucceedWithWarnings.png");
+ _iconInformation = Global.GetEtoIcon("Build.Information.png");
+ _iconFail = Global.GetEtoIcon("Build.Fail.png");
+ _iconProcessing = Global.GetEtoIcon("Build.Processing.png");
+ _iconSkip = Global.GetEtoIcon("Build.Skip.png");
+ _iconStart = Global.GetEtoIcon("Build.Start.png");
+ _iconEndSucceed = Global.GetEtoIcon("Build.EndSucceed.png");
+ _iconEndFailed = Global.GetEtoIcon("Build.EndFailed.png");
+ _iconSucceed = Global.GetEtoIcon("Build.Succeed.png");
+ _iconSucceedWithWarnings = Global.GetEtoIcon("Build.SucceedWithWarnings.png");
- _dataImage = new DataField();
- _dataText = new DataField();
+ _items = new List();
- _treeStore = new TreeStore(_dataImage, _dataText);
-
- _cmdFilterOutput = new Eto.Forms.CheckCommand();
+ _cmdFilterOutput = new CheckCommand();
_cmdFilterOutput.MenuText = "Filter Output";
_cmdFilterOutput.CheckedChanged += CmdFilterOutput_CheckedChanged;
AddCommand(_cmdFilterOutput);
- _cmdAutoScroll = new Eto.Forms.CheckCommand();
+ _cmdShowSkipped = new CheckCommand();
+ _cmdShowSkipped.MenuText = "Show Skipped Files";
+ _cmdShowSkipped.CheckedChanged += CmdShowSkipped_CheckedChanged;
+ AddCommand(_cmdShowSkipped);
+
+ _cmdShowSuccessful = new CheckCommand();
+ _cmdShowSuccessful.MenuText = "Show Successfully Built Files";
+ _cmdShowSuccessful.CheckedChanged += CmdShowSuccessful_CheckedChanged;
+ AddCommand(_cmdShowSuccessful);
+
+ _cmdShowCleaned = new CheckCommand();
+ _cmdShowCleaned.MenuText = "Show Cleaned Files";
+ _cmdShowCleaned.CheckedChanged += CmdShowCleaned_CheckedChanged;
+ AddCommand(_cmdShowCleaned);
+
+ _cmdAutoScroll = new CheckCommand();
_cmdAutoScroll.MenuText = "Auto Scroll";
_cmdAutoScroll.CheckedChanged += CmdAutoScroll_CheckedChanged;
AddCommand(_cmdAutoScroll);
- treeView.DataSource = _treeStore;
- treeView.Columns.Add("", _dataImage, _dataText);
+ MouseLocation = new Point(-1, -1);
+
+#if LINUX
+ var scrollView = scrollable1.ControlObject as Gtk.ScrolledWindow;
+ scrollView.Vadjustment.ValueChanged += Scrollable1_Scroll;
+ scrollView.Hadjustment.ValueChanged += Scrollable1_Scroll;
+#endif
}
public override void LoadSettings()
{
_cmdFilterOutput.Checked = PipelineSettings.Default.FilterOutput;
+ _cmdShowSkipped.Checked = PipelineSettings.Default.FilterShowSkipped;
+ _cmdShowSuccessful.Checked = PipelineSettings.Default.FilterShowSuccessful;
+ _cmdShowCleaned.Checked = PipelineSettings.Default.FilterShowCleaned;
_cmdAutoScroll.Checked = PipelineSettings.Default.AutoScrollBuildOutput;
}
private void CmdFilterOutput_CheckedChanged(object sender, EventArgs e)
{
- panel.Content = _cmdFilterOutput.Checked ? treeView.ToEto() : textArea;
+ if (_cmdFilterOutput.Checked)
+ drawable.Paint -= Drawable_Paint;
+
+ panel.Content = _cmdFilterOutput.Checked ? (Control)scrollable1 : textArea;
PipelineSettings.Default.FilterOutput = _cmdFilterOutput.Checked;
+
+ if (_cmdFilterOutput.Checked)
+ drawable.Paint += Drawable_Paint;
+
+ drawable.Invalidate();
+ }
+
+ private void CmdShowSkipped_CheckedChanged(object sender, EventArgs e)
+ {
+ PipelineSettings.Default.FilterShowSkipped = _cmdShowSkipped.Checked;
+ drawable.Invalidate();
+ }
+
+ private void CmdShowSuccessful_CheckedChanged(object sender, EventArgs e)
+ {
+ PipelineSettings.Default.FilterShowSuccessful = _cmdShowSuccessful.Checked;
+ drawable.Invalidate();
+ }
+
+ private void CmdShowCleaned_CheckedChanged(object sender, EventArgs e)
+ {
+ PipelineSettings.Default.FilterShowCleaned = _cmdShowCleaned.Checked;
+ drawable.Invalidate();
}
private void CmdAutoScroll_CheckedChanged(object sender, EventArgs e)
@@ -73,7 +123,8 @@ private void CmdAutoScroll_CheckedChanged(object sender, EventArgs e)
public void ClearOutput()
{
textArea.Text = "";
- _treeStore.Clear();
+ _items.Clear();
+ drawable.Invalidate();
}
public void WriteLine(string line)
@@ -89,67 +140,168 @@ public void WriteLine(string line)
switch (_output.State)
{
case OutputState.BuildBegin:
- AddItem(_iconStart, line);
+ _items.Add(new BuildItem { Text = line, Icon = _iconStart });
+ Count = -1;
+ ReqWidth = 0;
break;
case OutputState.Cleaning:
- AddItem(_iconInformation, "Cleaning " + PipelineController.Instance.GetRelativePath(_output.Filename));
- AddItem(line);
+ _items.Add(new BuildItem
+ {
+ Text = "Cleaning " + PipelineController.Instance.GetRelativePath(_output.Filename),
+ Icon = _iconInformation,
+ Description = line
+ });
break;
case OutputState.Skipping:
- AddItem(_iconSkip, "Skipping " + PipelineController.Instance.GetRelativePath(_output.Filename));
- AddItem(line);
+ _items.Add(new BuildItem
+ {
+ Text = "Skipping " + PipelineController.Instance.GetRelativePath(_output.Filename),
+ Icon = _iconSkip,
+ Description = _output.Filename
+ });
break;
case OutputState.BuildAsset:
- AddItem(_iconProcessing, "Building " + PipelineController.Instance.GetRelativePath(_output.Filename));
- AddItem(line);
+ if (_items[_items.Count - 1].Icon == _iconProcessing)
+ _items[_items.Count - 1].Icon = _iconSucceed;
+
+ _items.Add(new BuildItem
+ {
+ Text = "Building " + PipelineController.Instance.GetRelativePath(_output.Filename),
+ Icon = _iconProcessing,
+ Description = _output.Filename
+ });
break;
case OutputState.BuildError:
- _treeStore.GetNavigatorAt(_last).SetValue(_dataImage, _iconFail);
- AddItem(_output.ErrorMessage);
+ _items[_items.Count - 1].Icon = _iconFail;
+ _items[_items.Count - 1].AddDescription(_output.ErrorMessage);
break;
case OutputState.BuildErrorContinue:
- AddItem(_output.ErrorMessage);
+ _items[_items.Count - 1].AddDescription(_output.ErrorMessage);
break;
case OutputState.BuildWarning:
- if (_treeStore.GetNavigatorAt(_last).GetValue(_dataImage) == _iconProcessing)
- _treeStore.GetNavigatorAt(_last).SetValue(_dataImage, _iconSucceedWithWarnings);
- AddItem(_output.ErrorMessage);
+ if (_items[_items.Count - 1].Icon == _iconProcessing)
+ _items[_items.Count - 1].Icon = _iconSucceedWithWarnings;
+ _items[_items.Count - 1].AddDescription(_output.ErrorMessage);
break;
case OutputState.BuildEnd:
- if (line.Contains("0 failed"))
- AddItem(_iconEndSucceed, line);
- else
- AddItem(_iconEndFailed, line);
+ if (_items[_items.Count - 1].Icon == _iconProcessing)
+ _items[_items.Count - 1].Icon = _iconSucceed;
+
+ _items.Add(new BuildItem
+ {
+ Text = line,
+ Icon = line.Contains("0 failed") ? _iconEndSucceed : _iconEndFailed
+ });
break;
case OutputState.BuildTime:
- var node = _treeStore.GetNavigatorAt(_last);
- var text = node.GetValue(_dataText);
-
- AddItem(node.GetValue(_dataImage), text.TrimEnd(new[] { '.', ' ' }) + ", " + line);
- node.Remove();
+ var text = _items[_items.Count - 1].Text.TrimEnd(new[] { '.', ' ' }) + ", " + line;
+ _items[_items.Count - 1].Text = text;
+ Count = _items.Count * 35 - 3;
break;
}
+
+ drawable.Invalidate();
}
- private void AddItem(Image image, string text)
+ private void Drawable_MouseMove(object sender, MouseEventArgs e)
{
- var item = _treeStore.AddNode();
- item.SetValue(_dataImage, image);
- item.SetValue(_dataText, text);
+ MouseLocation = new Point((int)e.Location.X, (int)e.Location.Y);
+ drawable.Invalidate();
+ }
- if (_last != null && _treeStore.GetNavigatorAt(_last).GetValue(_dataImage) == _iconProcessing)
- _treeStore.GetNavigatorAt(_last).SetValue(_dataImage, _iconSucceed);
+ private void Drawable_MouseLeave(object sender, MouseEventArgs e)
+ {
+ _selectedItem = null;
+ MouseLocation = new Point(-1, -1);
+ drawable.Invalidate();
+ }
- if (_cmdAutoScroll.Checked)
- treeView.ScrollToRow(item.CurrentPosition);
+ private void Drawable_MouseDown(object sender, MouseEventArgs e)
+ {
+ if (_selectedItem != null)
+ _selectedItem.OnClick();
- _last = item.CurrentPosition;
+ ReqWidth = 0;
+ foreach (var item in _items)
+ if (item.RequestedWidth > ReqWidth)
+ ReqWidth = item.RequestedWidth;
+
+ SetWidth();
+ drawable.Invalidate();
}
- private void AddItem(string text)
+ private void Scrollable1_SizeChanged(object sender, EventArgs e)
{
- _treeStore.GetNavigatorAt(_last).AddChild().SetValue(_dataText, text);
+ SetWidth();
+ drawable.Invalidate();
+ }
+
+
+ private void Scrollable1_Scroll(object sender, EventArgs e)
+ {
+ drawable.Invalidate();
+ }
+
+ private void SetWidth()
+ {
+#if WINDOWS
+ var scrollsize = (drawable.Height >= scrollable1.Height) ? System.Windows.SystemParameters.VerticalScrollBarWidth : 0.0;
+ var width = (int)(Width - scrollsize - System.Windows.SystemParameters.BorderWidth * 2);
+
+ if (ReqWidth > width)
+ width = ReqWidth;
+
+ if (drawable.Width != width)
+ drawable.Width = width;
+#endif
+ }
+
+ private void Drawable_Paint(object sender, PaintEventArgs e)
+ {
+ var g = e.Graphics;
+ var count = _items.Count;
+ var y = 0;
+
+ g.Clear(DrawInfo.BackColor);
+
+ for (int i = 0; i < _items.Count; i++)
+ {
+ var item = _items[i];
+
+ // Skip Skipped items
+ if (!PipelineSettings.Default.FilterShowSkipped && item.Icon == _iconSkip)
+ continue;
+
+ // Skip Successful items
+ if (!PipelineSettings.Default.FilterShowSuccessful && item.Icon == _iconSucceed)
+ continue;
+
+ // Skip Cleaned items
+ if (!PipelineSettings.Default.FilterShowCleaned && item.Icon == _iconInformation)
+ continue;
+
+ // Check if the item is in the visible rectangle
+ if (y + item.Height >= scrollable1.ScrollPosition.Y && y < scrollable1.ScrollPosition.Y + scrollable1.Height)
+ {
+ // Check if the item is selected
+ if (MouseLocation.Y > y && MouseLocation.Y < y + item.Height)
+ _selectedItem = item;
+
+ // Draw item
+ item.Draw(g, y, drawable.Width);
+ }
+
+ // Add border
+ y += item.Height + 3;
+ }
+
+ drawable.Height = Math.Max(y - 3, 1);
+ SetWidth();
+
+#if WINDOWS
+ if (Count == -1 && PipelineSettings.Default.AutoScrollBuildOutput)
+ scrollable1.ScrollPosition = new Point(0, y - scrollable1.Height);
+#endif
}
}
}
-
diff --git a/Tools/Pipeline/Controls/BuildOutput.eto.cs b/Tools/Pipeline/Controls/BuildOutput.eto.cs
index 3751feea7d6..d5230dec24f 100644
--- a/Tools/Pipeline/Controls/BuildOutput.eto.cs
+++ b/Tools/Pipeline/Controls/BuildOutput.eto.cs
@@ -2,6 +2,7 @@
// This file is subject to the terms and conditions defined in
// file 'LICENSE.txt', which is part of this source code package.
+using System;
using Eto.Forms;
namespace MonoGame.Tools.Pipeline
@@ -10,8 +11,8 @@ public partial class BuildOutput : Pad
{
Panel panel;
TextArea textArea;
-
- Xwt.TreeView treeView;
+ Scrollable scrollable1;
+ Drawable drawable;
private void InitializeComponent()
{
@@ -23,11 +24,20 @@ private void InitializeComponent()
textArea.Wrap = false;
textArea.ReadOnly = true;
- treeView = new Xwt.TreeView();
- treeView.HeadersVisible = false;
+ scrollable1 = new Scrollable();
+ scrollable1.BackgroundColor = DrawInfo.BackColor;
+ drawable = new Drawable();
+ scrollable1.Content = drawable;
panel.Content = textArea;
CreateContent(panel);
+
+ drawable.MouseDown += Drawable_MouseDown;
+ drawable.MouseMove += Drawable_MouseMove;
+ drawable.MouseLeave += Drawable_MouseLeave;
+ drawable.Paint += Drawable_Paint;
+ scrollable1.SizeChanged += Scrollable1_SizeChanged;
+ scrollable1.Scroll += Scrollable1_Scroll;
}
}
}
diff --git a/Tools/Pipeline/Controls/DrawInfo.cs b/Tools/Pipeline/Controls/DrawInfo.cs
new file mode 100644
index 00000000000..75ddc12f3d9
--- /dev/null
+++ b/Tools/Pipeline/Controls/DrawInfo.cs
@@ -0,0 +1,36 @@
+using System;
+using Eto.Drawing;
+
+namespace MonoGame.Tools.Pipeline
+{
+ static class DrawInfo
+ {
+ public static int TextHeight;
+ public static Color TextColor, BackColor, HoverTextColor, HoverBackColor, DisabledTextColor, BorderColor;
+
+ static DrawInfo()
+ {
+ TextHeight = (int)SystemFonts.Default().LineHeight;
+ TextColor = SystemColors.ControlText;
+ BackColor = SystemColors.ControlBackground;
+ HoverTextColor = SystemColors.HighlightText;
+ HoverBackColor = SystemColors.Highlight;
+ DisabledTextColor = SystemColors.ControlText;
+ DisabledTextColor.A = 0.4f;
+ BorderColor = Global.Unix ? SystemColors.WindowBackground : SystemColors.Control;
+ }
+
+ public static Color GetTextColor(bool selected, bool disabled)
+ {
+ if (disabled)
+ return DisabledTextColor;
+
+ return selected ? HoverTextColor : TextColor;
+ }
+
+ public static Color GetBackgroundColor(bool selected)
+ {
+ return selected ? HoverBackColor : BackColor;
+ }
+ }
+}
diff --git a/Tools/Pipeline/Controls/PropertyCells/CellBase.cs b/Tools/Pipeline/Controls/PropertyCells/CellBase.cs
index 12054e38ae1..8496995ff45 100644
--- a/Tools/Pipeline/Controls/PropertyCells/CellBase.cs
+++ b/Tools/Pipeline/Controls/PropertyCells/CellBase.cs
@@ -41,7 +41,7 @@ public void Create(string category, string name, object value, Type type, EventH
DisplayValue = (value == null) ? "" : value.ToString();
Text = name;
Editable = true;
- Height = PropInfo.TextHeight;
+ Height = DrawInfo.TextHeight;
_eventHandler = eventHandler;
_type = type;
@@ -64,8 +64,8 @@ public virtual void Draw(Graphics g, Rectangle rec, int separatorPos, bool selec
if (selected)
g.FillRectangle(SystemColors.Highlight, rec);
- g.DrawText(SystemFonts.Default(), PropInfo.GetTextColor(selected, false), rec.X + 5, rec.Y + (rec.Height - Height) / 2, Text);
- g.FillRectangle(PropInfo.GetBackgroundColor(selected), separatorPos - 6, rec.Y, rec.Width, rec.Height);
+ g.DrawText(SystemFonts.Default(), DrawInfo.GetTextColor(selected, false), rec.X + 5, rec.Y + (rec.Height - Height) / 2, Text);
+ g.FillRectangle(DrawInfo.GetBackgroundColor(selected), separatorPos - 6, rec.Y, rec.Width, rec.Height);
DrawCell(g, rec, separatorPos, selected);
}
@@ -75,7 +75,7 @@ public virtual void DrawCell(Graphics g, Rectangle rec, int separatorPos, bool s
_lastRec.X += separatorPos;
_lastRec.Width -= separatorPos - 1;
- g.DrawText(SystemFonts.Default(), PropInfo.GetTextColor(selected, !Editable), separatorPos + 5, rec.Y + (rec.Height - Height) / 2, DisplayValue);
+ g.DrawText(SystemFonts.Default(), DrawInfo.GetTextColor(selected, !Editable), separatorPos + 5, rec.Y + (rec.Height - Height) / 2, DisplayValue);
}
}
}
diff --git a/Tools/Pipeline/Controls/PropertyGridTable.cs b/Tools/Pipeline/Controls/PropertyGridTable.cs
index 4ad9d7d747b..519a88bd5d1 100755
--- a/Tools/Pipeline/Controls/PropertyGridTable.cs
+++ b/Tools/Pipeline/Controls/PropertyGridTable.cs
@@ -3,7 +3,6 @@
// file 'LICENSE.txt', which is part of this source code package.
using System;
-using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
@@ -12,42 +11,6 @@
namespace MonoGame.Tools.Pipeline
{
- static class PropInfo
- {
- public static int TextHeight;
- public static Color TextColor;
- public static Color BackColor;
- public static Color HoverTextColor;
- public static Color HoverBackColor;
- public static Color DisabledTextColor;
- public static Color BorderColor;
-
- static PropInfo()
- {
- TextHeight = (int)SystemFonts.Default().LineHeight;
- TextColor = SystemColors.ControlText;
- BackColor = SystemColors.ControlBackground;
- HoverTextColor = SystemColors.HighlightText;
- HoverBackColor = SystemColors.Highlight;
- DisabledTextColor = SystemColors.ControlText;
- DisabledTextColor.A = 0.4f;
- BorderColor = Global.Unix ? SystemColors.WindowBackground : SystemColors.Control;
- }
-
- public static Color GetTextColor(bool selected, bool disabled)
- {
- if (disabled)
- return DisabledTextColor;
-
- return selected ? HoverTextColor : TextColor;
- }
-
- public static Color GetBackgroundColor(bool selected)
- {
- return selected ? HoverBackColor : BackColor;
- }
- }
-
public partial class PropertyGridTable
{
private const int _spacing = 12;
@@ -167,21 +130,21 @@ private void DrawGroup(Graphics g, Rectangle rec, string text)
var font = SystemFonts.Default();
font = new Font(font.Family, font.Size, FontStyle.Bold);
- g.FillRectangle(PropInfo.BorderColor, rec);
- g.DrawText(SystemFonts.Default(), PropInfo.TextColor, rec.X + 1, rec.Y + (rec.Height - font.LineHeight) / 2, text);
+ g.FillRectangle(DrawInfo.BorderColor, rec);
+ g.DrawText(SystemFonts.Default(), DrawInfo.TextColor, rec.X + 1, rec.Y + (rec.Height - font.LineHeight) / 2, text);
}
private void Drawable_Paint(object sender, PaintEventArgs e)
{
var g = e.Graphics;
- var rec = new Rectangle(0, 0, drawable.Width - 1, PropInfo.TextHeight + _spacing);
+ var rec = new Rectangle(0, 0, drawable.Width - 1, DrawInfo.TextHeight + _spacing);
var overGroup = false;
string prevCategory = null;
_separatorPos = Math.Min(Width - _separatorSafeDistance, Math.Max(_separatorSafeDistance, _separatorPos));
_selectedCell = null;
- g.Clear(PropInfo.BackColor);
+ g.Clear(DrawInfo.BackColor);
if (_cells.Count == 0)
{
@@ -190,7 +153,7 @@ private void Drawable_Paint(object sender, PaintEventArgs e)
}
// Draw separator for not filled rows
- g.FillRectangle(PropInfo.BorderColor, _separatorPos - 1, 0, 1, Height);
+ g.FillRectangle(DrawInfo.BorderColor, _separatorPos - 1, 0, 1, Height);
foreach (var c in _cells)
{
@@ -204,7 +167,7 @@ private void Drawable_Paint(object sender, PaintEventArgs e)
DrawGroup(g, rec, c.Category);
prevCategory = c.Category;
overGroup |= rec.Contains(_mouseLocation);
- rec.Y += PropInfo.TextHeight + _spacing;
+ rec.Y += DrawInfo.TextHeight + _spacing;
}
}
@@ -215,7 +178,7 @@ private void Drawable_Paint(object sender, PaintEventArgs e)
c.Draw(g, rec, _separatorPos, selected);
// Draw separator for the current row
- g.FillRectangle(PropInfo.BorderColor, _separatorPos - 1, rec.Y, 1, rec.Height);
+ g.FillRectangle(DrawInfo.BorderColor, _separatorPos - 1, rec.Y, 1, rec.Height);
rec.Y += c.Height + _spacing;
}
@@ -300,8 +263,8 @@ private void SetWidth()
var scrollsize = (_height >= Height) ? System.Windows.SystemParameters.VerticalScrollBarWidth : 0.0;
drawable.Width = (int)(Width - scrollsize - System.Windows.SystemParameters.BorderWidth * 2);
- foreach (var child in pixel1.Children)
- if (child != drawable)
+ foreach (var child in pixel1.Children)
+ if (child != drawable)
child.Width = drawable.Width - _separatorPos;
});
diff --git a/Tools/Pipeline/Controls/PropertyGridTable.eto.cs b/Tools/Pipeline/Controls/PropertyGridTable.eto.cs
index 3cecede1171..4f9fe8cfd01 100644
--- a/Tools/Pipeline/Controls/PropertyGridTable.eto.cs
+++ b/Tools/Pipeline/Controls/PropertyGridTable.eto.cs
@@ -14,10 +14,10 @@ public partial class PropertyGridTable : Scrollable
private void InitializeComponent()
{
- BackgroundColor = PropInfo.BackColor;
+ BackgroundColor = DrawInfo.BackColor;
pixel1 = new PixelLayout();
- pixel1.BackgroundColor = PropInfo.BackColor;
+ pixel1.BackgroundColor = DrawInfo.BackColor;
drawable = new Drawable();
drawable.Height = 100;
diff --git a/Tools/Pipeline/Global.Linux.cs b/Tools/Pipeline/Global.Linux.cs
index be3209d822e..d9f25360125 100644
--- a/Tools/Pipeline/Global.Linux.cs
+++ b/Tools/Pipeline/Global.Linux.cs
@@ -217,13 +217,13 @@ private static Gdk.Pixbuf PlatformGetIcon(string resource)
iconInfo = _theme.LookupIcon("gtk-yes", 16, 0);
break;
case "Build.Start.png":
- iconInfo = _theme.LookupIcon("info", 16, 0);
+ iconInfo = _theme.LookupIcon("system-run", 16, 0);
break;
case "Build.EndSucceed.png":
- iconInfo = _theme.LookupIcon("info", 16, 0);
+ iconInfo = _theme.LookupIcon("system-run", 16, 0);
break;
case "Build.EndFailed.png":
- iconInfo = _theme.LookupIcon("info", 16, 0);
+ iconInfo = _theme.LookupIcon("system-run", 16, 0);
break;
case "Build.Succeed.png":
iconInfo = _theme.LookupIcon("gtk-yes", 16, 0);
diff --git a/Tools/Pipeline/Styles.Linux.cs b/Tools/Pipeline/Styles.Linux.cs
index 392635a28c5..8bd7c198d41 100644
--- a/Tools/Pipeline/Styles.Linux.cs
+++ b/Tools/Pipeline/Styles.Linux.cs
@@ -282,6 +282,38 @@ public static void Load()
{
h.Control.WidthChars = 0;
});
+
+ Style.Add("BuildOutput", h =>
+ {
+ var child = ((((h.Control.Child as Gtk.Viewport).Child as Gtk.VBox).Children[0] as Gtk.HBox).Children[0] as Gtk.Alignment).Child;
+ var ok = false;
+
+ h.Control.SizeAllocated += delegate
+ {
+ // Set Width of the Drawable
+ var al = child.Allocation;
+ al.Width = h.Control.AllocatedWidth - 2;
+ if (BuildOutput.ReqWidth > al.Width)
+ al.Width = BuildOutput.ReqWidth;
+ child.SetAllocation(al);
+
+ if (PipelineSettings.Default.AutoScrollBuildOutput)
+ {
+ // Scroll to bottom
+ if (BuildOutput.Count == -1)
+ ok = false;
+
+ if (!ok)
+ {
+ var adj = h.Control.Vadjustment;
+ adj.Value = adj.Upper - adj.PageSize;
+
+ if (adj.Upper >= BuildOutput.Count && BuildOutput.Count != -1)
+ ok = true;
+ }
+ }
+ };
+ });
}
}
}
From c082bf79dca55a3e2b8a7cebeb1c867709f76221 Mon Sep 17 00:00:00 2001
From: cra0zy
Date: Mon, 31 Oct 2016 00:14:00 +0100
Subject: [PATCH 032/128] [Pipeline Tool] Fix ProjectView folder icon
---
Tools/Pipeline/Global.Windows.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Tools/Pipeline/Global.Windows.cs b/Tools/Pipeline/Global.Windows.cs
index 9f0e57bffbc..13295a0b425 100755
--- a/Tools/Pipeline/Global.Windows.cs
+++ b/Tools/Pipeline/Global.Windows.cs
@@ -39,7 +39,7 @@ private static void PlatformInit()
_xwtFiles["."] = ToXwtImage(file);
_xwtFileMissing = ToXwtImage(fileMissing);
- _xwtFolder = ToXwtImage(folderMissing);
+ _xwtFolder = ToXwtImage(folder);
_xwtFolderMissing = ToXwtImage(folderMissing);
}
From 985f366affee14b6db7a0079bcbad990003ba6ce Mon Sep 17 00:00:00 2001
From: cra0zy
Date: Mon, 31 Oct 2016 11:52:12 +0100
Subject: [PATCH 033/128] [Pipeline Tool] FilterView fixes
---
Tools/Pipeline/Controls/BuildOutput.cs | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Tools/Pipeline/Controls/BuildOutput.cs b/Tools/Pipeline/Controls/BuildOutput.cs
index 342cb113d2e..4516e14faa0 100644
--- a/Tools/Pipeline/Controls/BuildOutput.cs
+++ b/Tools/Pipeline/Controls/BuildOutput.cs
@@ -122,6 +122,7 @@ private void CmdAutoScroll_CheckedChanged(object sender, EventArgs e)
public void ClearOutput()
{
+ scrollable1.ScrollPosition = new Point(0, 0);
textArea.Text = "";
_items.Clear();
drawable.Invalidate();
@@ -153,6 +154,9 @@ public void WriteLine(string line)
});
break;
case OutputState.Skipping:
+ if (_items[_items.Count - 1].Icon == _iconProcessing)
+ _items[_items.Count - 1].Icon = _iconSucceed;
+
_items.Add(new BuildItem
{
Text = "Skipping " + PipelineController.Instance.GetRelativePath(_output.Filename),
From f4c48eb494646e72a17776055b006cf936154cef Mon Sep 17 00:00:00 2001
From: cra0zy
Date: Tue, 1 Nov 2016 21:43:59 +0100
Subject: [PATCH 034/128] Delete FontHelper.cs
---
.../Graphics/FontHelper.cs | 228 ------------------
1 file changed, 228 deletions(-)
delete mode 100644 MonoGame.Framework.Content.Pipeline/Graphics/FontHelper.cs
diff --git a/MonoGame.Framework.Content.Pipeline/Graphics/FontHelper.cs b/MonoGame.Framework.Content.Pipeline/Graphics/FontHelper.cs
deleted file mode 100644
index f4c230a3ea3..00000000000
--- a/MonoGame.Framework.Content.Pipeline/Graphics/FontHelper.cs
+++ /dev/null
@@ -1,228 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Runtime.InteropServices;
-using System.Drawing;
-
-#if MACOS
-using MonoMac.CoreGraphics;
-using MonoMac.AppKit;
-using MonoMac.Foundation;
-using MonoMac.CoreText;
-using MonoMac.ImageIO;
-#endif
-
-namespace Microsoft.Xna.Framework.Content.Pipeline.Graphics
-{
-
- static class FontHelper
- {
- [StructLayout(LayoutKind.Sequential)]
- public struct ABC
- {
- public int abcA;
- public uint abcB;
- public int abcC;
- }
-
-#if WINDOWS
- [DllImport("gdi32.dll", ExactSpelling = true)]
- public static extern IntPtr SelectObject(IntPtr hDC, IntPtr hObj);
-
- [DllImport("gdi32.dll", ExactSpelling = true, SetLastError = true)]
- public static extern int DeleteObject(IntPtr hObj);
-
- [DllImport("gdi32.dll", ExactSpelling = true, CharSet = CharSet.Unicode, SetLastError = true)]
- public static extern bool GetCharABCWidthsW(IntPtr hdc, uint uFirstChar, uint uLastChar, [Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPStruct, SizeConst = 1)] ABC[] lpabc);
-
- public static ABC GetCharWidthABC(char ch, Font font, System.Drawing.Graphics gr)
- {
- ABC[] _temp = new ABC[1];
- IntPtr hDC = gr.GetHdc();
- Font ft = (Font)font.Clone();
- IntPtr hFt = ft.ToHfont();
- SelectObject(hDC, hFt);
- GetCharABCWidthsW(hDC, ch, ch, _temp);
- DeleteObject(hFt);
- gr.ReleaseHdc();
-
- return _temp[0];
- }
-
-#elif MACOS
-
- static CTFont nativeFont;
-
- public static ABC GetCharWidthABC(char ch, Font font, System.Drawing.Graphics gr)
- {
- ABC[] _temp = new ABC[1];
- var nativFont = CreateFont (font.Name, font.Size, font.Style, font.GdiCharSet, font.GdiVerticalFont);
- var atts = buildAttributedString(ch.ToString(), nativFont);
- // for now just a line not sure if this is going to work
- CTLine line = new CTLine(atts);
-
- float ascent;
- float descent;
- float leading;
- _temp[0].abcB = (uint)line.GetTypographicBounds(out ascent, out descent, out leading);
-
-
- return _temp[0];
- }
-
- const byte DefaultCharSet = 1;
- static bool underLine = false;
- static bool strikeThrough = false;
-
- static float dpiScale = 96f / 72f;
-
-
- static internal CTFont CreateFont (string familyName, float emSize)
- {
- return CreateFont (familyName, emSize, FontStyle.Regular, DefaultCharSet, false);
- }
-
- static internal CTFont CreateFont (string familyName, float emSize, FontStyle style)
- {
- return CreateFont (familyName, emSize, style, DefaultCharSet, false);
- }
-
- static internal CTFont CreateFont (string familyName, float emSize, FontStyle style, byte gdiCharSet)
- {
- return CreateFont (familyName, emSize, style, gdiCharSet, false);
- }
-
- static internal CTFont CreateFont (string familyName, float emSize, FontStyle style,
- byte gdiCharSet, bool gdiVerticalFont )
- {
- if (emSize <= 0)
- throw new ArgumentException("emSize is less than or equal to 0, evaluates to infinity, or is not a valid number.","emSize");
-
- CTFont nativeFont;
-
- // convert to 96 Dpi to be consistent with Windows
- var dpiSize = emSize * dpiScale;
-
- try {
- nativeFont = new CTFont(familyName,dpiSize);
- }
- catch
- {
- nativeFont = new CTFont("Helvetica",dpiSize);
- }
-
- CTFontSymbolicTraits tMask = CTFontSymbolicTraits.None;
-
- if ((style & FontStyle.Bold) == FontStyle.Bold)
- tMask |= CTFontSymbolicTraits.Bold;
- if ((style & FontStyle.Italic) == FontStyle.Italic)
- tMask |= CTFontSymbolicTraits.Italic;
- strikeThrough = (style & FontStyle.Strikeout) == FontStyle.Strikeout;
- underLine = (style & FontStyle.Underline) == FontStyle.Underline;
-
- var nativeFont2 = nativeFont.WithSymbolicTraits(dpiSize,tMask,tMask);
-
- if (nativeFont2 != null)
- nativeFont = nativeFont2;
-
- return nativeFont;
- }
-
- static NSString FontAttributedName = (NSString)"NSFont";
- static NSString ForegroundColorAttributedName = (NSString)"NSColor";
- static NSString UnderlineStyleAttributeName = (NSString)"NSUnderline";
- static NSString ParagraphStyleAttributeName = (NSString)"NSParagraphStyle";
- //NSAttributedString.ParagraphStyleAttributeName
- static NSString StrikethroughStyleAttributeName = (NSString)"NSStrikethrough";
-
- private static NSMutableAttributedString buildAttributedString(string text, CTFont font,
- Color? fontColor=null)
- {
-
-
- // Create a new attributed string from text
- NSMutableAttributedString atts =
- new NSMutableAttributedString(text);
-
- var attRange = new NSRange(0, atts.Length);
- var attsDic = new NSMutableDictionary();
-
- // Font attribute
- NSObject fontObject = new NSObject(font.Handle);
- attsDic.Add(FontAttributedName, fontObject);
- // -- end font
-
- if (fontColor.HasValue) {
-
- // Font color
- var fc = fontColor.Value;
- NSColor color = NSColor.FromDeviceRgba(fc.R / 255f,
- fc.G / 255f,
- fc.B / 255f,
- fc.A / 255f);
- NSObject colorObject = new NSObject(color.Handle);
- attsDic.Add(ForegroundColorAttributedName, colorObject);
- // -- end font Color
- }
-
- if (underLine) {
- // Underline
- int single = (int)MonoMac.AppKit.NSUnderlineStyle.Single;
- int solid = (int)MonoMac.AppKit.NSUnderlinePattern.Solid;
- var attss = single | solid;
- var underlineObject = NSNumber.FromInt32(attss);
- //var under = NSAttributedString.UnderlineStyleAttributeName.ToString();
- attsDic.Add(UnderlineStyleAttributeName, underlineObject);
- // --- end underline
- }
-
-
- if (strikeThrough) {
- // StrikeThrough
- // NSColor bcolor = NSColor.Blue;
- // NSObject bcolorObject = new NSObject(bcolor.Handle);
- // attsDic.Add(NSAttributedString.StrikethroughColorAttributeName, bcolorObject);
- int stsingle = (int)MonoMac.AppKit.NSUnderlineStyle.Single;
- int stsolid = (int)MonoMac.AppKit.NSUnderlinePattern.Solid;
- var stattss = stsingle | stsolid;
- var stunderlineObject = NSNumber.FromInt32(stattss);
-
- attsDic.Add(StrikethroughStyleAttributeName, stunderlineObject);
- // --- end underline
- }
-
-
- // Text alignment
- var alignment = CTTextAlignment.Left;
- var alignmentSettings = new CTParagraphStyleSettings();
- alignmentSettings.Alignment = alignment;
- var paragraphStyle = new CTParagraphStyle(alignmentSettings);
- NSObject psObject = new NSObject(paragraphStyle.Handle);
-
- // end text alignment
-
- attsDic.Add(ParagraphStyleAttributeName, psObject);
-
- atts.SetAttributes(attsDic, attRange);
-
- return atts;
-
- }
-
-#elif LINUX
- public static ABC GetCharWidthABC(char ch, Font font, System.Drawing.Graphics gr)
- {
- var sf = StringFormat.GenericTypographic;
- sf.Trimming = StringTrimming.None;
- sf.FormatFlags = StringFormatFlags.MeasureTrailingSpaces;
- return new ABC
- {
- abcA = 0,
- abcB = (uint)gr.MeasureString(ch.ToString(), font, new PointF(0, 0), sf).Width,
- abcC = 0
- };
- }
-#endif
- }
-}
From 4eaab648807cefb0c8150c91343fc310f618f162 Mon Sep 17 00:00:00 2001
From: lozzajp
Date: Thu, 3 Nov 2016 15:50:10 +0000
Subject: [PATCH 035/128] adding_fonts.md changed to adding_ttf_fonts.md
---
Documentation/content_intro.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/content_intro.md b/Documentation/content_intro.md
index e1a862a8b23..dce6e337783 100644
--- a/Documentation/content_intro.md
+++ b/Documentation/content_intro.md
@@ -6,7 +6,7 @@ This section will cover the following topics:
- What is Game Content
- [Using The Pipeline Tool](using_pipeline_tool.md)
- - [Using TrueType Fonts](adding_fonts.md)
+ - [Using TrueType Fonts](adding_ttf_fonts.md)
- [Custom Effects](custom_effects.md)
- Custom Content Types
From 31eb1b4252394483a2afde0def07a48930efffa9 Mon Sep 17 00:00:00 2001
From: Simon Jackson
Date: Sun, 6 Nov 2016 21:59:31 +0000
Subject: [PATCH 036/128] Updated NuSpec as final Nuget failed to add SharpDX
to project.
---
NuGetPackages/MonoGame.Framework.WindowsUniversal.nuspec | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/NuGetPackages/MonoGame.Framework.WindowsUniversal.nuspec b/NuGetPackages/MonoGame.Framework.WindowsUniversal.nuspec
index 829a38c8f53..a790c89b979 100644
--- a/NuGetPackages/MonoGame.Framework.WindowsUniversal.nuspec
+++ b/NuGetPackages/MonoGame.Framework.WindowsUniversal.nuspec
@@ -1,5 +1,5 @@

-
+
MonoGame.Framework.WindowsUniversal
0.0.0.0
@@ -16,9 +16,6 @@
Copyright 2016
en-US
-
-
-
@@ -34,4 +31,4 @@
-
+
\ No newline at end of file
From 3a0944ad0b5ca9e9aaf436be2214117f541bf344 Mon Sep 17 00:00:00 2001
From: Simon Jackson
Date: Sun, 6 Nov 2016 22:08:50 +0000
Subject: [PATCH 037/128] Update UWP project template to target Anniversary
edition Add Xbox related code to disable cursor Updated .NETCore NuGet
reference to 5.2.2 (latest)
---
.../WindowsUniversal/App.xaml.cs | 134 ++++++++++--------
.../WindowsUniversal/Application.csproj | 4 +-
.../WindowsUniversal/project.json | 2 +-
3 files changed, 77 insertions(+), 63 deletions(-)
diff --git a/ProjectTemplates/VisualStudio2015/WindowsUniversal/App.xaml.cs b/ProjectTemplates/VisualStudio2015/WindowsUniversal/App.xaml.cs
index 2045acc1d4d..2c6d2105e9b 100644
--- a/ProjectTemplates/VisualStudio2015/WindowsUniversal/App.xaml.cs
+++ b/ProjectTemplates/VisualStudio2015/WindowsUniversal/App.xaml.cs
@@ -24,26 +24,40 @@ namespace $safeprojectname$
/// Provides application-specific behavior to supplement the default Application class.
///
sealed partial class App : Application
+{
+ static string deviceFamily;
+
+ ///
+ /// Initializes the singleton application object. This is the first line of authored code
+ /// executed, and as such is the logical equivalent of main() or WinMain().
+ ///
+ public App()
{
- ///
- /// Initializes the singleton application object. This is the first line of authored code
- /// executed, and as such is the logical equivalent of main() or WinMain().
- ///
- public App()
+ this.InitializeComponent();
+ this.Suspending += OnSuspending;
+ if (IsXbox())
{
- this.InitializeComponent();
- this.Suspending += OnSuspending;
+ Application.Current.RequiresPointerMode = ApplicationRequiresPointerMode.WhenRequested;
}
+ }
- ///
- /// Invoked when the application is launched normally by the end user. Other entry points
- /// will be used such as when the application is launched to open a specific file.
- ///
- /// Details about the launch request and process.
- protected override void OnLaunched(LaunchActivatedEventArgs e)
- {
- // By default we want to fill the entire core window.
- ApplicationView.GetForCurrentView().SetDesiredBoundsMode(ApplicationViewBoundsMode.UseCoreWindow);
+ public static bool IsXbox()
+ {
+ if (deviceFamily == null)
+ deviceFamily = Windows.System.Profile.AnalyticsInfo.VersionInfo.DeviceFamily;
+
+ return deviceFamily == "Windows.Xbox";
+ }
+
+ ///
+ /// Invoked when the application is launched normally by the end user. Other entry points
+ /// will be used such as when the application is launched to open a specific file.
+ ///
+ /// Details about the launch request and process.
+ protected override void OnLaunched(LaunchActivatedEventArgs e)
+ {
+ // By default we want to fill the entire core window.
+ ApplicationView.GetForCurrentView().SetDesiredBoundsMode(ApplicationViewBoundsMode.UseCoreWindow);
#if DEBUG
if (System.Diagnostics.Debugger.IsAttached)
@@ -52,59 +66,59 @@ protected override void OnLaunched(LaunchActivatedEventArgs e)
}
#endif
- Frame rootFrame = Window.Current.Content as Frame;
-
- // Do not repeat app initialization when the Window already has content,
- // just ensure that the window is active
- if (rootFrame == null)
- {
- // Create a Frame to act as the navigation context and navigate to the first page
- rootFrame = new Frame();
-
- rootFrame.NavigationFailed += OnNavigationFailed;
+ Frame rootFrame = Window.Current.Content as Frame;
- if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
- {
- //TODO: Load state from previously suspended application
- }
+ // Do not repeat app initialization when the Window already has content,
+ // just ensure that the window is active
+ if (rootFrame == null)
+ {
+ // Create a Frame to act as the navigation context and navigate to the first page
+ rootFrame = new Frame();
- // Place the frame in the current Window
- Window.Current.Content = rootFrame;
- }
+ rootFrame.NavigationFailed += OnNavigationFailed;
- if (rootFrame.Content == null)
+ if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
- // When the navigation stack isn't restored navigate to the first page,
- // configuring the new page by passing required information as a navigation
- // parameter
- rootFrame.Navigate(typeof(GamePage), e.Arguments);
+ //TODO: Load state from previously suspended application
}
- // Ensure the current window is active
- Window.Current.Activate();
- }
- ///
- /// Invoked when Navigation to a certain page fails
- ///
- /// The Frame which failed navigation
- /// Details about the navigation failure
- void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
- {
- throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
+ // Place the frame in the current Window
+ Window.Current.Content = rootFrame;
}
- ///
- /// Invoked when application execution is being suspended. Application state is saved
- /// without knowing whether the application will be terminated or resumed with the contents
- /// of memory still intact.
- ///
- /// The source of the suspend request.
- /// Details about the suspend request.
- private void OnSuspending(object sender, SuspendingEventArgs e)
+ if (rootFrame.Content == null)
{
- var deferral = e.SuspendingOperation.GetDeferral();
- //TODO: Save application state and stop any background activity
- deferral.Complete();
+ // When the navigation stack isn't restored navigate to the first page,
+ // configuring the new page by passing required information as a navigation
+ // parameter
+ rootFrame.Navigate(typeof(GamePage), e.Arguments);
}
+ // Ensure the current window is active
+ Window.Current.Activate();
+ }
+
+ ///
+ /// Invoked when Navigation to a certain page fails
+ ///
+ /// The Frame which failed navigation
+ /// Details about the navigation failure
+ void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
+ {
+ throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
+ }
+
+ ///
+ /// Invoked when application execution is being suspended. Application state is saved
+ /// without knowing whether the application will be terminated or resumed with the contents
+ /// of memory still intact.
+ ///
+ /// The source of the suspend request.
+ /// Details about the suspend request.
+ private void OnSuspending(object sender, SuspendingEventArgs e)
+ {
+ var deferral = e.SuspendingOperation.GetDeferral();
+ //TODO: Save application state and stop any background activity
+ deferral.Complete();
}
}
+}
\ No newline at end of file
diff --git a/ProjectTemplates/VisualStudio2015/WindowsUniversal/Application.csproj b/ProjectTemplates/VisualStudio2015/WindowsUniversal/Application.csproj
index 7b0fdf8691a..54afdfe4c11 100644
--- a/ProjectTemplates/VisualStudio2015/WindowsUniversal/Application.csproj
+++ b/ProjectTemplates/VisualStudio2015/WindowsUniversal/Application.csproj
@@ -12,8 +12,8 @@
$projectname$
$currentuiculturename$
UAP
- 10.0.10586.0
- 10.0.10240.0
+ 10.0.14393.0
+ 10.0.10586.0
14
true
512
diff --git a/ProjectTemplates/VisualStudio2015/WindowsUniversal/project.json b/ProjectTemplates/VisualStudio2015/WindowsUniversal/project.json
index c5949392705..32d927479d9 100644
--- a/ProjectTemplates/VisualStudio2015/WindowsUniversal/project.json
+++ b/ProjectTemplates/VisualStudio2015/WindowsUniversal/project.json
@@ -1,6 +1,6 @@
{
"dependencies": {
- "Microsoft.NETCore.UniversalWindowsPlatform": "5.0.0"
+ "Microsoft.NETCore.UniversalWindowsPlatform": "5.2.2"
},
"frameworks": {
"uap10.0": {}
From e9368c49e7a2ec6aa3e29cb9f33247ecedfc8555 Mon Sep 17 00:00:00 2001
From: cra0zy
Date: Mon, 7 Nov 2016 18:35:09 +0100
Subject: [PATCH 038/128] [SDL] Remove uneeded hacks and update SDL to 2.0.5
---
MonoGame.Framework/SDL/SDLGamePlatform.cs | 15 +--
MonoGame.Framework/SDL/SDLGameWindow.cs | 106 +++++++++-------------
ThirdParty/Dependencies | 2 +-
3 files changed, 47 insertions(+), 76 deletions(-)
diff --git a/MonoGame.Framework/SDL/SDLGamePlatform.cs b/MonoGame.Framework/SDL/SDLGamePlatform.cs
index 51a62c0110e..310ae9291b5 100644
--- a/MonoGame.Framework/SDL/SDLGamePlatform.cs
+++ b/MonoGame.Framework/SDL/SDLGamePlatform.cs
@@ -46,17 +46,6 @@ public SdlGamePlatform(Game game)
Sdl.Minor = sversion.Minor;
Sdl.Patch = sversion.Patch;
- try
- {
- // HACK: The current development version of SDL
- // returns 2.0.4, to check SDL version we simply
- // need to try and execute a function that's only
- // available in the newer version of it.
- Sdl.Window.SetResizable(IntPtr.Zero, false);
- Sdl.Patch = 5;
- }
- catch { }
-
var version = 100 * Sdl.Major + 10 * Sdl.Minor + Sdl.Patch;
if (version <= 204)
@@ -71,6 +60,7 @@ public SdlGamePlatform(Game game)
Sdl.DisableScreenSaver();
+ GamePad.InitDatabase();
Window = _view = new SdlGameWindow(_game);
try
@@ -85,8 +75,7 @@ public SdlGamePlatform(Game game)
public override void BeforeInitialize ()
{
- GamePad.InitDatabase();
- _view.CreateWindow();
+ _view.InitGraphics();
SdlRunLoop();
base.BeforeInitialize ();
diff --git a/MonoGame.Framework/SDL/SDLGameWindow.cs b/MonoGame.Framework/SDL/SDLGameWindow.cs
index f930040997e..1aa6aad9ae0 100644
--- a/MonoGame.Framework/SDL/SDLGameWindow.cs
+++ b/MonoGame.Framework/SDL/SDLGameWindow.cs
@@ -17,13 +17,10 @@ public override bool AllowUserResizing
get { return !IsBorderless && _resizable; }
set
{
- if (_init)
- {
- if (Sdl.Patch > 4)
- Sdl.Window.SetResizable(_handle, value);
- else
- throw new Exception("SDL does not support changing resizable parameter of the window after it's already been created.");
- }
+ if (Sdl.Patch > 4)
+ Sdl.Window.SetResizable(_handle, value);
+ else
+ throw new Exception("SDL 2.0.4 does not support changing resizable parameter of the window after it's already been created, please use a newer version of it.");
_resizable = value;
}
@@ -83,7 +80,7 @@ public override bool IsBorderless
internal readonly Game _game;
private IntPtr _handle;
- private bool _init, _disposed;
+ private bool _disposed;
private bool _resizable, _borderless, _willBeFullScreen, _mouseVisible, _hardwareSwitch;
private string _screenDeviceName;
private int _winx, _winy, _width, _height;
@@ -97,6 +94,8 @@ public SdlGameWindow(Game game)
_winx = Sdl.Window.PosUndefined;
_winy = Sdl.Window.PosUndefined;
+ _width = GraphicsDeviceManager.DefaultBackBufferWidth;
+ _height = GraphicsDeviceManager.DefaultBackBufferHeight;
if (Sdl.Patch >= 4)
{
@@ -105,71 +104,19 @@ public SdlGameWindow(Game game)
_winy = display.Y + display.Height / 2;
}
- // We need a dummy handle for GraphicDevice until our window gets created
- _handle = Sdl.Window.Create("", _winx, _winy,
- GraphicsDeviceManager.DefaultBackBufferWidth, GraphicsDeviceManager.DefaultBackBufferHeight,
- Sdl.Window.State.Hidden);
- }
-
- internal void CreateWindow()
- {
- _width = GraphicsDeviceManager.DefaultBackBufferWidth;
- _height = GraphicsDeviceManager.DefaultBackBufferHeight;
- var title = MonoGame.Utilities.AssemblyHelper.GetDefaultWindowTitle();
-
var initflags =
Sdl.Window.State.OpenGL |
Sdl.Window.State.Hidden |
Sdl.Window.State.InputFocus |
Sdl.Window.State.MouseFocus;
- if (_resizable)
- initflags |= Sdl.Window.State.Resizable;
-
- if (_borderless)
- initflags |= Sdl.Window.State.Borderless;
-
- Sdl.Window.Destroy(_handle);
-
- var surfaceFormat = _game.graphicsDeviceManager.PreferredBackBufferFormat.GetColorFormat ();
- var depthStencilFormat = _game.graphicsDeviceManager.PreferredDepthStencilFormat;
- // TODO Need to get this data from the Presentation Parameters
- Sdl.GL.SetAttribute (Sdl.GL.Attribute.RedSize, surfaceFormat.R);
- Sdl.GL.SetAttribute (Sdl.GL.Attribute.GreenSize, surfaceFormat.G);
- Sdl.GL.SetAttribute (Sdl.GL.Attribute.BlueSize, surfaceFormat.B);
- Sdl.GL.SetAttribute (Sdl.GL.Attribute.AlphaSize, surfaceFormat.A);
- switch (depthStencilFormat)
- {
- case DepthFormat.None:
- Sdl.GL.SetAttribute (Sdl.GL.Attribute.DepthSize, 0);
- Sdl.GL.SetAttribute (Sdl.GL.Attribute.StencilSize, 0);
- break;
- case DepthFormat.Depth16:
- Sdl.GL.SetAttribute (Sdl.GL.Attribute.DepthSize, 16);
- Sdl.GL.SetAttribute (Sdl.GL.Attribute.StencilSize, 0);
- break;
- case DepthFormat.Depth24:
- Sdl.GL.SetAttribute (Sdl.GL.Attribute.DepthSize, 24);
- Sdl.GL.SetAttribute (Sdl.GL.Attribute.StencilSize, 0);
- break;
- case DepthFormat.Depth24Stencil8:
- Sdl.GL.SetAttribute (Sdl.GL.Attribute.DepthSize, 24);
- Sdl.GL.SetAttribute (Sdl.GL.Attribute.StencilSize, 8);
- break;
- }
- Sdl.GL.SetAttribute (Sdl.GL.Attribute.DoubleBuffer, 1);
- Sdl.GL.SetAttribute (Sdl.GL.Attribute.ContextMajorVersion, 2);
- Sdl.GL.SetAttribute (Sdl.GL.Attribute.ContextMinorVersion, 1);
-
- _handle = Sdl.Window.Create (title,
+ _handle = Sdl.Window.Create(MonoGame.Utilities.AssemblyHelper.GetDefaultWindowTitle(),
_winx - _width / 2, _winy - _height / 2,
_width, _height, initflags);
Sdl.SetHint("SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS", "0");
Sdl.SetHint("SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS", "1");
- Sdl.Window.SetTitle(Handle, title);
-
using (
var stream =
Assembly.GetEntryAssembly().GetManifestResourceStream(Assembly.GetEntryAssembly().EntryPoint.DeclaringType.Namespace + ".Icon.bmp") ??
@@ -191,8 +138,43 @@ internal void CreateWindow()
}
SetCursorVisible(_mouseVisible);
+ }
+
+ // TODO Move this to GraphicsDeviceManager
+ internal void InitGraphics()
+ {
+ var surfaceFormat = _game.graphicsDeviceManager.PreferredBackBufferFormat.GetColorFormat();
+ var depthStencilFormat = _game.graphicsDeviceManager.PreferredDepthStencilFormat;
+
+ // TODO Need to get this data from the Presentation Parameters
+ Sdl.GL.SetAttribute(Sdl.GL.Attribute.RedSize, surfaceFormat.R);
+ Sdl.GL.SetAttribute(Sdl.GL.Attribute.GreenSize, surfaceFormat.G);
+ Sdl.GL.SetAttribute(Sdl.GL.Attribute.BlueSize, surfaceFormat.B);
+ Sdl.GL.SetAttribute(Sdl.GL.Attribute.AlphaSize, surfaceFormat.A);
+
+ switch (depthStencilFormat)
+ {
+ case DepthFormat.None:
+ Sdl.GL.SetAttribute(Sdl.GL.Attribute.DepthSize, 0);
+ Sdl.GL.SetAttribute(Sdl.GL.Attribute.StencilSize, 0);
+ break;
+ case DepthFormat.Depth16:
+ Sdl.GL.SetAttribute(Sdl.GL.Attribute.DepthSize, 16);
+ Sdl.GL.SetAttribute(Sdl.GL.Attribute.StencilSize, 0);
+ break;
+ case DepthFormat.Depth24:
+ Sdl.GL.SetAttribute(Sdl.GL.Attribute.DepthSize, 24);
+ Sdl.GL.SetAttribute(Sdl.GL.Attribute.StencilSize, 0);
+ break;
+ case DepthFormat.Depth24Stencil8:
+ Sdl.GL.SetAttribute(Sdl.GL.Attribute.DepthSize, 24);
+ Sdl.GL.SetAttribute(Sdl.GL.Attribute.StencilSize, 8);
+ break;
+ }
- _init = true;
+ Sdl.GL.SetAttribute(Sdl.GL.Attribute.DoubleBuffer, 1);
+ Sdl.GL.SetAttribute(Sdl.GL.Attribute.ContextMajorVersion, 2);
+ Sdl.GL.SetAttribute(Sdl.GL.Attribute.ContextMinorVersion, 1);
}
~SdlGameWindow()
diff --git a/ThirdParty/Dependencies b/ThirdParty/Dependencies
index 177c3be65f9..2344ab54b5a 160000
--- a/ThirdParty/Dependencies
+++ b/ThirdParty/Dependencies
@@ -1 +1 @@
-Subproject commit 177c3be65f9f8bf8daaf11a7d84cd6edb3d96415
+Subproject commit 2344ab54b5a09e256e5e29d3bd116edfc485f740
From ad422ef1c6061e51e425d31602a492c7629ae418 Mon Sep 17 00:00:00 2001
From: cra0zy
Date: Wed, 9 Nov 2016 16:14:12 +0100
Subject: [PATCH 039/128] [Pipeline Tool] PathDialog Improvements
---
Tools/Pipeline/Dialogs/PathDialog.eto.cs | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/Tools/Pipeline/Dialogs/PathDialog.eto.cs b/Tools/Pipeline/Dialogs/PathDialog.eto.cs
index 5ddfd56a21f..21f9477c722 100644
--- a/Tools/Pipeline/Dialogs/PathDialog.eto.cs
+++ b/Tools/Pipeline/Dialogs/PathDialog.eto.cs
@@ -11,7 +11,7 @@ partial class PathDialog : DialogBase
{
DynamicLayout layout1;
StackLayout stack1, stack2;
- Label label1;
+ Label label1, label2;
TextBox textBox1;
Button buttonBrowse;
@@ -35,15 +35,19 @@ private void InitializeComponent()
stack1.Orientation = Orientation.Horizontal;
textBox1 = new TextBox();
- stack1.Items.Add(new StackLayoutItem(textBox1, true));
+ stack1.Items.Add(new StackLayoutItem(textBox1, VerticalAlignment.Center, true));
buttonBrowse = new Button();
buttonBrowse.Text = "...";
buttonBrowse.MinimumSize = new Size(1, 1);
- stack1.Items.Add(new StackLayoutItem(buttonBrowse, false));
+ stack1.Items.Add(new StackLayoutItem(buttonBrowse, VerticalAlignment.Center, false));
layout1.Add(stack1);
+ label2 = new Label();
+ label2.Text = "Macros:";
+ layout1.Add(label2);
+
stack2 = new StackLayout();
stack2.Spacing = 4;
stack2.Orientation = Orientation.Horizontal;
From 19ba7d33864e1b7eb187ced05290e3633ab703f0 Mon Sep 17 00:00:00 2001
From: Nikos Kastellanos
Date: Thu, 10 Nov 2016 10:10:41 +0200
Subject: [PATCH 040/128] Texture Validation
---
MonoGame.Framework/Graphics/Texture2D.cs | 6 ++++--
MonoGame.Framework/Graphics/Texture3D.cs | 9 +++++++--
MonoGame.Framework/Graphics/TextureCube.cs | 5 +++--
3 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/MonoGame.Framework/Graphics/Texture2D.cs b/MonoGame.Framework/Graphics/Texture2D.cs
index 805f21616dc..a0a00bb31d4 100644
--- a/MonoGame.Framework/Graphics/Texture2D.cs
+++ b/MonoGame.Framework/Graphics/Texture2D.cs
@@ -84,9 +84,11 @@ internal Texture2D(GraphicsDevice graphicsDevice, int width, int height, bool mi
protected Texture2D(GraphicsDevice graphicsDevice, int width, int height, bool mipmap, SurfaceFormat format, SurfaceType type, bool shared, int arraySize)
{
if (graphicsDevice == null)
- {
throw new ArgumentNullException("graphicsDevice", FrameworkResources.ResourceCreationWhenDeviceIsNull);
- }
+ if (width <= 0)
+ throw new ArgumentOutOfRangeException("width","Texture width must be greater than zero");
+ if (height <= 0)
+ throw new ArgumentOutOfRangeException("height","Texture height must be greater than zero");
if (arraySize > 1 && !graphicsDevice.GraphicsCapabilities.SupportsTextureArrays)
throw new ArgumentException("Texture arrays are not supported on this graphics device", "arraySize");
diff --git a/MonoGame.Framework/Graphics/Texture3D.cs b/MonoGame.Framework/Graphics/Texture3D.cs
index 0f29f8f1ec0..f5fb9d39ff5 100644
--- a/MonoGame.Framework/Graphics/Texture3D.cs
+++ b/MonoGame.Framework/Graphics/Texture3D.cs
@@ -37,9 +37,14 @@ public Texture3D(GraphicsDevice graphicsDevice, int width, int height, int depth
protected Texture3D (GraphicsDevice graphicsDevice, int width, int height, int depth, bool mipMap, SurfaceFormat format, bool renderTarget)
{
if (graphicsDevice == null)
- {
throw new ArgumentNullException("graphicsDevice", FrameworkResources.ResourceCreationWhenDeviceIsNull);
- }
+ if (width <= 0)
+ throw new ArgumentOutOfRangeException("width","Texture width must be greater than zero");
+ if (height <= 0)
+ throw new ArgumentOutOfRangeException("height","Texture height must be greater than zero");
+ if (depth <= 0)
+ throw new ArgumentOutOfRangeException("depth","Texture depth must be greater than zero");
+
this.GraphicsDevice = graphicsDevice;
this._width = width;
this._height = height;
diff --git a/MonoGame.Framework/Graphics/TextureCube.cs b/MonoGame.Framework/Graphics/TextureCube.cs
index e3852824a44..2a6ee31808b 100644
--- a/MonoGame.Framework/Graphics/TextureCube.cs
+++ b/MonoGame.Framework/Graphics/TextureCube.cs
@@ -31,9 +31,10 @@ public TextureCube (GraphicsDevice graphicsDevice, int size, bool mipMap, Surfac
internal TextureCube(GraphicsDevice graphicsDevice, int size, bool mipMap, SurfaceFormat format, bool renderTarget)
{
if (graphicsDevice == null)
- {
throw new ArgumentNullException("graphicsDevice", FrameworkResources.ResourceCreationWhenDeviceIsNull);
- }
+ if (size <= 0)
+ throw new ArgumentOutOfRangeException("size","Cube size must be greater than zero");
+
this.GraphicsDevice = graphicsDevice;
this.size = size;
this._format = format;
From 345308156f265971f255ef98412e9645e38eaa8f Mon Sep 17 00:00:00 2001
From: Nikos Kastellanos
Date: Thu, 10 Nov 2016 11:16:38 +0200
Subject: [PATCH 041/128] Test Texture2D/3D/Cube & RenderTarget2D/Cube
arguments
---
Test/Framework/Graphics/RenderTarget2DTest.cs | 10 ++++++++++
Test/Framework/Graphics/RenderTargetCubeTest.cs | 8 ++++++++
Test/Framework/Graphics/Texture2DNonVisualTest.cs | 9 +++++++++
Test/Framework/Graphics/Texture3DNonVisualTest.cs | 15 +++++++++++++++
Test/Framework/Graphics/TextureCubeTest.cs | 8 ++++++++
5 files changed, 50 insertions(+)
diff --git a/Test/Framework/Graphics/RenderTarget2DTest.cs b/Test/Framework/Graphics/RenderTarget2DTest.cs
index 5cf7d478f6e..e54e6f03867 100644
--- a/Test/Framework/Graphics/RenderTarget2DTest.cs
+++ b/Test/Framework/Graphics/RenderTarget2DTest.cs
@@ -2,6 +2,7 @@
// This file is subject to the terms and conditions defined in
// file 'LICENSE.txt', which is part of this source code package.
+using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using NUnit.Framework;
@@ -12,6 +13,15 @@ namespace MonoGame.Tests.Graphics
class RenderTarget2DTest : GraphicsDeviceTestFixtureBase
{
[Test]
+ public void ZeroSizeShouldFailTest()
+ {
+ RenderTarget2D renderTarget;
+ Assert.Throws(() => renderTarget = new RenderTarget2D(gd, 0, 1));
+ Assert.Throws(() => renderTarget = new RenderTarget2D(gd, 1, 0));
+ Assert.Throws(() => renderTarget = new RenderTarget2D(gd, 0, 0));
+ }
+
+ [Test]
#if XNA
[Ignore]
#endif
diff --git a/Test/Framework/Graphics/RenderTargetCubeTest.cs b/Test/Framework/Graphics/RenderTargetCubeTest.cs
index 11ac39686a2..31a2c0a975c 100644
--- a/Test/Framework/Graphics/RenderTargetCubeTest.cs
+++ b/Test/Framework/Graphics/RenderTargetCubeTest.cs
@@ -2,6 +2,7 @@
// This file is subject to the terms and conditions defined in
// file 'LICENSE.txt', which is part of this source code package.
+using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using NUnit.Framework;
@@ -11,6 +12,13 @@ namespace MonoGame.Tests.Graphics
[TestFixture]
class RenderTargetCubeTest : GraphicsDeviceTestFixtureBase
{
+ [Test]
+ public void ZeroSizeShouldFailTest()
+ {
+ RenderTargetCube renderTarget;
+ Assert.Throws(() => renderTarget = new RenderTargetCube(gd, 0, false, SurfaceFormat.Color, DepthFormat.None));
+ }
+
[TestCase(1)]
[TestCase(8)]
[TestCase(31)]
diff --git a/Test/Framework/Graphics/Texture2DNonVisualTest.cs b/Test/Framework/Graphics/Texture2DNonVisualTest.cs
index 39eb1809e41..611ed81aef3 100644
--- a/Test/Framework/Graphics/Texture2DNonVisualTest.cs
+++ b/Test/Framework/Graphics/Texture2DNonVisualTest.cs
@@ -73,6 +73,15 @@ public void FromStreamArgumentNullTest()
#endif
}
+ [Test]
+ public void ZeroSizeShouldFailTest()
+ {
+ Texture2D texture;
+ Assert.Throws(() => texture = new Texture2D(gd, 0, 1));
+ Assert.Throws(() => texture = new Texture2D(gd, 1, 0));
+ Assert.Throws(() => texture = new Texture2D(gd, 0, 0));
+ }
+
[TestCase(25, 23, 1, 1, 0, 1)]
[TestCase(25, 23, 1, 1, 1, 1)]
[TestCase(25, 23, 2, 1, 0, 2)]
diff --git a/Test/Framework/Graphics/Texture3DNonVisualTest.cs b/Test/Framework/Graphics/Texture3DNonVisualTest.cs
index cea9f4f2e49..30982e90c5c 100644
--- a/Test/Framework/Graphics/Texture3DNonVisualTest.cs
+++ b/Test/Framework/Graphics/Texture3DNonVisualTest.cs
@@ -52,6 +52,21 @@ public void TestSetUp()
{
t.SetData(reference);
}
+
+ [Test]
+ public void ZeroSizeShouldFailTest()
+ {
+ Texture3D texture;
+ var gd = _game.GraphicsDevice;
+ Assert.Throws(() => texture = new Texture3D(gd, 0, 1, 1, false, SurfaceFormat.Color));
+ Assert.Throws(() => texture = new Texture3D(gd, 1, 0, 1, false, SurfaceFormat.Color));
+ Assert.Throws(() => texture = new Texture3D(gd, 1, 1, 0, false, SurfaceFormat.Color));
+ Assert.Throws(() => texture = new Texture3D(gd, 0, 0, 1, false, SurfaceFormat.Color));
+ Assert.Throws(() => texture = new Texture3D(gd, 1, 0, 0, false, SurfaceFormat.Color));
+ Assert.Throws(() => texture = new Texture3D(gd, 0, 1, 0, false, SurfaceFormat.Color));
+ Assert.Throws(() => texture = new Texture3D(gd, 0, 0, 0, false, SurfaceFormat.Color));
+ }
+
[Test]
public void SetData1ParameterTest()
{
diff --git a/Test/Framework/Graphics/TextureCubeTest.cs b/Test/Framework/Graphics/TextureCubeTest.cs
index e7997ff3a5e..0bb9069264b 100644
--- a/Test/Framework/Graphics/TextureCubeTest.cs
+++ b/Test/Framework/Graphics/TextureCubeTest.cs
@@ -2,6 +2,7 @@
// This file is subject to the terms and conditions defined in
// file 'LICENSE.txt', which is part of this source code package.
+using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using NUnit.Framework;
@@ -11,6 +12,13 @@ namespace MonoGame.Tests.Graphics
[TestFixture]
class TextureCubeTest : GraphicsDeviceTestFixtureBase
{
+ [Test]
+ public void ZeroSizeShouldFailTest()
+ {
+ TextureCube texture;
+ Assert.Throws(() => texture = new TextureCube(gd, 0, false, SurfaceFormat.Color));
+ }
+
[TestCase(1)]
[TestCase(8)]
[TestCase(31)]
From 49729adf6d3b8598ee76420f0fc160937bc5f2d1 Mon Sep 17 00:00:00 2001
From: cra0zy
Date: Wed, 9 Nov 2016 17:31:55 +0100
Subject: [PATCH 042/128] [Pipeline Tool] Drag and Drop from file manager
---
Tools/Pipeline/Controls/ProjectControl.cs | 75 ++++++++++++++++++++---
Tools/Pipeline/MainWindow.cs | 10 ++-
2 files changed, 69 insertions(+), 16 deletions(-)
diff --git a/Tools/Pipeline/Controls/ProjectControl.cs b/Tools/Pipeline/Controls/ProjectControl.cs
index 72863be446f..9dcf384a328 100644
--- a/Tools/Pipeline/Controls/ProjectControl.cs
+++ b/Tools/Pipeline/Controls/ProjectControl.cs
@@ -2,6 +2,7 @@
// This file is subject to the terms and conditions defined in
// file 'LICENSE.txt', which is part of this source code package.
+using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@@ -45,27 +46,81 @@ public ProjectControl()
TreeView.ButtonReleased += Handle_ButtonReleased;
TreeView.SelectionChanged += ProjectControl_SelectionChanged;
+
+ TreeView.SetDragDropTarget(TransferDataType.Text, TransferDataType.Uri);
+ TreeView.DragOver += TreeView_DragOver;
+ TreeView.DragDrop += TreeView_DragDrop;
+ }
+
+ private void TreeView_DragOver(object sender, DragOverEventArgs e)
+ {
+ if (!PipelineController.Instance.ProjectOpen)
+ return;
+
+ e.AllowedAction = DragDropAction.Copy;
+
+ RowDropPosition rowpos;
+ TreePosition pos;
+
+ if (TreeView.GetDropTargetRow(e.Position.X, e.Position.Y, out rowpos, out pos))
+ if (rowpos == RowDropPosition.Into && _treeStore.GetNavigatorAt(pos).GetValue(_dataTag) is ContentItem)
+ e.AllowedAction = DragDropAction.None;
+ }
+
+ private void TreeView_DragDrop(object sender, DragEventArgs e)
+ {
+ var initialDirectory = PipelineController.Instance.ProjectLocation;
+ var folders = new List();
+ var files = new List();
+ RowDropPosition rowpos;
+ TreePosition pos;
+
+ foreach (var u in e.Data.Uris)
+ {
+ if (Directory.Exists(u.LocalPath))
+ folders.Add(u.LocalPath);
+ else
+ files.Add(u.LocalPath);
+ }
+
+ if (TreeView.GetDropTargetRow(e.Position.X, e.Position.Y, out rowpos, out pos))
+ {
+ var item = _treeStore.GetNavigatorAt(pos).GetValue(_dataTag);
+
+ if (!(item is DirectoryItem && rowpos == RowDropPosition.Into))
+ {
+ var nav = _treeStore.GetNavigatorAt(pos);
+ if (nav.MoveToParent())
+ item = nav.GetValue(_dataTag);
+ }
+
+ if (!(item is PipelineProject))
+ initialDirectory = Path.Combine(initialDirectory, item.OriginalPath);
+ }
+
+ PipelineController.Instance.DragDrop(initialDirectory, folders.ToArray(), files.ToArray());
+ e.Success = true;
}
private void Handle_ButtonReleased(object sender, ButtonEventArgs e)
{
if (e.Button == PointerButton.Right)
{
-#if WINDOWS
+#if WINDOWS
var crow = TreeView.GetRowAtPosition(e.X, e.Y);
if (crow == null)
return;
-
- if (!TreeView.SelectedRows.ToList().Contains(crow))
- {
- TreeView.UnselectAll();
+
+ if (!TreeView.SelectedRows.ToList().Contains(crow))
+ {
+ TreeView.UnselectAll();
TreeView.SelectRow(crow);
- TreeView.FocusedRow = crow;
+ TreeView.FocusedRow = crow;
}
-#endif
-
- if (_showContextMenu && _contextMenu.Items.Count > 0)
+#endif
+
+ if (_showContextMenu && _contextMenu.Items.Count > 0)
_contextMenu.Show(TreeView.ToEto());
}
}
@@ -98,7 +153,7 @@ public void SetRoot(IProjectItem item)
_treeStore.Clear();
_rootExists = false;
- _showContextMenu = false;
+ _showContextMenu = false;
PipelineController.Instance.SelectionChanged(new List());
return;
diff --git a/Tools/Pipeline/MainWindow.cs b/Tools/Pipeline/MainWindow.cs
index a1900b36f22..3c3549f35d2 100644
--- a/Tools/Pipeline/MainWindow.cs
+++ b/Tools/Pipeline/MainWindow.cs
@@ -62,13 +62,11 @@ public MainWindow()
protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
{
e.Cancel = !PipelineController.Instance.Exit();
- base.OnClosing(e);
- }
- public override void Close()
- {
- Application.Instance.Quit();
- base.Close();
+ if (!e.Cancel)
+ Xwt.Application.Exit();
+
+ base.OnClosing(e);
}
public void ShowContextMenu()
From 2e4853c3e2f4d11dd7b10ea6b9c3dab428418769 Mon Sep 17 00:00:00 2001
From: Nikos Kastellanos
Date: Sat, 29 Oct 2016 07:12:04 +0300
Subject: [PATCH 043/128] Draw_with_viewport_changing
---
Build/Projects/MonoGame.Tests.definition | 6 ++
.../Draw_with_viewport_changing_Deferred_.png | Bin 0 -> 40482 bytes
...Draw_with_viewport_changing_Immediate_.png | Bin 0 -> 48029 bytes
Test/Framework/Graphics/SpriteBatchTest.cs | 93 ++++++++++++++++++
Test/MonoGame.Tests.XNA.csproj | 6 ++
5 files changed, 105 insertions(+)
create mode 100644 Test/Assets/ReferenceImages/SpriteBatch/Draw_with_viewport_changing_Deferred_.png
create mode 100644 Test/Assets/ReferenceImages/SpriteBatch/Draw_with_viewport_changing_Immediate_.png
diff --git a/Build/Projects/MonoGame.Tests.definition b/Build/Projects/MonoGame.Tests.definition
index d0b3ce48c9d..e038869ae06 100644
--- a/Build/Projects/MonoGame.Tests.definition
+++ b/Build/Projects/MonoGame.Tests.definition
@@ -640,6 +640,12 @@
PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
PreserveNewest
diff --git a/Test/Assets/ReferenceImages/SpriteBatch/Draw_with_viewport_changing_Deferred_.png b/Test/Assets/ReferenceImages/SpriteBatch/Draw_with_viewport_changing_Deferred_.png
new file mode 100644
index 0000000000000000000000000000000000000000..63a6e0a3f819cf4f8d72fb01531d6066de868bed
GIT binary patch
literal 40482
zcmdqJXE@wl+qbO*F%m=y6>bN8
zhk}w;`&v>=-Ccis*3F%0Wlq?B?l67ca(932(R!L6-F*-UKq7eZAtC>0F5-wo0aYw!
z?q%RTf{!sVF=&?Y_Xr5k0_Pg4a;T(Gk8gzL{h7_R(_23V_J8r(b@3^kO-uVc>+vh&
zGX3)``=Hr02L7YF*H<*0`~SRo@PFw|W~SJ*#{!S~@zq?8a4Z)YmT~#K>zW%qK94@Artt_||)Rt0=q-5t|`C
zo+i~%G%D}7Iz^ju9Z7O0uxt6;9T7dzQR_1FgcdcPyNa}xC7
z%8A>H>&Z^~wVKs=ndDSI!}*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