diff --git a/Makefile b/Makefile index 13ab5d1b09..99f3ed67bf 100644 --- a/Makefile +++ b/Makefile @@ -191,6 +191,16 @@ check: @mono --debug OpenRA.Utility.exe cnc --check-code-style OpenRA.Mods.D2k @echo "Checking for code style violations in OpenRA.Mods.TS..." @mono --debug OpenRA.Utility.exe cnc --check-code-style OpenRA.Mods.TS + @echo "Checking for code style violations in OpenRA.Editor..." + @mono --debug OpenRA.Utility.exe cnc --check-code-style OpenRA.Editor + @echo "Checking for code style violations in OpenRA.Renderer.Sdl2..." + @mono --debug OpenRA.Utility.exe cnc --check-code-style OpenRA.Renderer.Sdl2 + @echo "Checking for code style violations in OpenRA.Utility..." + @mono --debug OpenRA.Utility.exe cnc --check-code-style OpenRA.Utility + @echo "Checking for code style violations in OpenRA.Test..." + @mono --debug OpenRA.Utility.exe cnc --check-code-style OpenRA.Test + @echo "Checking for code style violations in OpenRA.TilesetBuilder..." + @mono --debug OpenRA.Utility.exe cnc --check-code-style OpenRA.TilesetBuilder # Builds and exports tilesets from a bitmap tsbuild_SRCS := $(shell find OpenRA.TilesetBuilder/ -iname '*.cs') diff --git a/OpenRA.Editor/Form1.cs b/OpenRA.Editor/Form1.cs index 10920b9019..1cfef73fbb 100644 --- a/OpenRA.Editor/Form1.cs +++ b/OpenRA.Editor/Form1.cs @@ -426,7 +426,7 @@ namespace OpenRA.Editor pd.TitleBox.Text = surface1.Map.Title; pd.DescBox.Text = surface1.Map.Description; pd.AuthorBox.Text = surface1.Map.Author; - pd.mapVisibilityComboBox.SelectedIndex = pd.mapVisibilityComboBox.FindStringExact(Enum.GetName(typeof(MapVisibility), surface1.Map.Visibility)); + pd.MapVisibilityComboBox.SelectedIndex = pd.MapVisibilityComboBox.FindStringExact(Enum.GetName(typeof(MapVisibility), surface1.Map.Visibility)); if (DialogResult.OK != pd.ShowDialog()) return; @@ -434,7 +434,7 @@ namespace OpenRA.Editor surface1.Map.Title = pd.TitleBox.Text; surface1.Map.Description = pd.DescBox.Text; surface1.Map.Author = pd.AuthorBox.Text; - surface1.Map.Visibility = (MapVisibility)Enum.Parse(typeof(MapVisibility), pd.mapVisibilityComboBox.SelectedItem.ToString()); + surface1.Map.Visibility = (MapVisibility)Enum.Parse(typeof(MapVisibility), pd.MapVisibilityComboBox.SelectedItem.ToString()); } } diff --git a/OpenRA.Editor/PropertiesDialog.Designer.cs b/OpenRA.Editor/PropertiesDialog.Designer.cs index 9841c4edae..9db7f75d35 100644 --- a/OpenRA.Editor/PropertiesDialog.Designer.cs +++ b/OpenRA.Editor/PropertiesDialog.Designer.cs @@ -45,7 +45,7 @@ namespace OpenRA.Editor this.DescBox = new System.Windows.Forms.TextBox(); this.label3 = new System.Windows.Forms.Label(); this.AuthorBox = new System.Windows.Forms.TextBox(); - this.mapVisibilityComboBox = new System.Windows.Forms.ComboBox(); + this.MapVisibilityComboBox = new System.Windows.Forms.ComboBox(); this.label4 = new System.Windows.Forms.Label(); this.SuspendLayout(); // @@ -122,15 +122,15 @@ namespace OpenRA.Editor // // mapVisibilityComboBox // - this.mapVisibilityComboBox.FormattingEnabled = true; - this.mapVisibilityComboBox.Items.AddRange(new object[] { + this.MapVisibilityComboBox.FormattingEnabled = true; + this.MapVisibilityComboBox.Items.AddRange(new object[] { "Lobby", "Shellmap", "MissionSelector"}); - this.mapVisibilityComboBox.Location = new System.Drawing.Point(150, 137); - this.mapVisibilityComboBox.Name = "mapVisibilityComboBox"; - this.mapVisibilityComboBox.Size = new System.Drawing.Size(121, 21); - this.mapVisibilityComboBox.TabIndex = 19; + this.MapVisibilityComboBox.Location = new System.Drawing.Point(150, 137); + this.MapVisibilityComboBox.Name = "mapVisibilityComboBox"; + this.MapVisibilityComboBox.Size = new System.Drawing.Size(121, 21); + this.MapVisibilityComboBox.TabIndex = 19; // // label4 // @@ -148,7 +148,7 @@ namespace OpenRA.Editor this.CancelButton = this.button1; this.ClientSize = new System.Drawing.Size(370, 228); this.Controls.Add(this.label4); - this.Controls.Add(this.mapVisibilityComboBox); + this.Controls.Add(this.MapVisibilityComboBox); this.Controls.Add(this.AuthorBox); this.Controls.Add(this.label3); this.Controls.Add(this.DescBox); @@ -176,7 +176,7 @@ namespace OpenRA.Editor public System.Windows.Forms.TextBox DescBox; private System.Windows.Forms.Label label3; public System.Windows.Forms.TextBox AuthorBox; - public System.Windows.Forms.ComboBox mapVisibilityComboBox; + public System.Windows.Forms.ComboBox MapVisibilityComboBox; private System.Windows.Forms.Label label4; } } diff --git a/OpenRA.Editor/Surface.cs b/OpenRA.Editor/Surface.cs index cfb22b35d8..6ec1c46f5d 100644 --- a/OpenRA.Editor/Surface.cs +++ b/OpenRA.Editor/Surface.cs @@ -319,6 +319,7 @@ namespace OpenRA.Editor ControlPaint.DrawGrid(g, rect, new Size(ts.Width, ts.Height), Color.Red); } } + return bitmap; } diff --git a/OpenRA.Renderer.Sdl2/ErrorHandler.cs b/OpenRA.Renderer.Sdl2/ErrorHandler.cs index e3c1b49f7e..6af34a7762 100644 --- a/OpenRA.Renderer.Sdl2/ErrorHandler.cs +++ b/OpenRA.Renderer.Sdl2/ErrorHandler.cs @@ -56,9 +56,12 @@ namespace OpenRA.Renderer.Sdl2 Log.Write("graphics", "Vendor: {0}", GL.GetString(StringName.Vendor)); if (GL.GetString(StringName.Vendor).Contains("Microsoft")) { - Log.Write("graphics", "Note: The default driver provided by Microsoft does not include full OpenGL support.\n" - + "Please install the latest drivers from your graphics card manufacturer's website.\n"); + var msg = ""; + msg += "Note: The default driver provided by Microsoft does not include full OpenGL support.\n"; + msg += "Please install the latest drivers from your graphics card manufacturer's website.\n"; + Log.Write("graphics", msg); } + Log.Write("graphics", "Renderer: {0}", GL.GetString(StringName.Renderer)); Log.Write("graphics", "GL Version: {0}", GL.GetString(StringName.Version)); Log.Write("graphics", "Shader Version: {0}", GL.GetString(StringName.ShadingLanguageVersion)); diff --git a/OpenRA.Renderer.Sdl2/Sdl2GraphicsDevice.cs b/OpenRA.Renderer.Sdl2/Sdl2GraphicsDevice.cs index 084e10073c..dc8ac14999 100755 --- a/OpenRA.Renderer.Sdl2/Sdl2GraphicsDevice.cs +++ b/OpenRA.Renderer.Sdl2/Sdl2GraphicsDevice.cs @@ -157,11 +157,13 @@ namespace OpenRA.Renderer.Sdl2 SDL.SDL_GL_DeleteContext(context); context = IntPtr.Zero; } + if (window != IntPtr.Zero) { SDL.SDL_DestroyWindow(window); window = IntPtr.Zero; } + SDL.SDL_Quit(); } diff --git a/OpenRA.Renderer.Sdl2/Texture.cs b/OpenRA.Renderer.Sdl2/Texture.cs index 3e3ae2bd7a..6daf52db84 100644 --- a/OpenRA.Renderer.Sdl2/Texture.cs +++ b/OpenRA.Renderer.Sdl2/Texture.cs @@ -34,6 +34,7 @@ namespace OpenRA.Renderer.Sdl2 { return scaleFilter; } + set { if (scaleFilter == value) diff --git a/OpenRA.Test/OpenRA.Game/ActorInfoTest.cs b/OpenRA.Test/OpenRA.Game/ActorInfoTest.cs index 9346de58e1..926c2424c6 100644 --- a/OpenRA.Test/OpenRA.Game/ActorInfoTest.cs +++ b/OpenRA.Test/OpenRA.Game/ActorInfoTest.cs @@ -10,11 +10,11 @@ using System; using System.Collections.Generic; -using System.Text.RegularExpressions; using System.Linq; +using System.Text.RegularExpressions; +using NUnit.Framework; using OpenRA.GameRules; using OpenRA.Traits; -using NUnit.Framework; namespace OpenRA.Test { @@ -48,7 +48,7 @@ namespace OpenRA.Test actorInfo.Traits.Add(new MockB()); actorInfo.Traits.Add(new MockA()); - var i = new List (actorInfo.TraitsInConstructOrder()); + var i = new List(actorInfo.TraitsInConstructOrder()); Assert.That(i[0], Is.InstanceOf()); Assert.That(i[1], Is.InstanceOf()); @@ -93,8 +93,7 @@ namespace OpenRA.Test var count = ( new Regex("MockD").Matches(e.Message).Count + new Regex("MockE").Matches(e.Message).Count + - new Regex("MockF").Matches(e.Message).Count - ) / 3.0; + new Regex("MockF").Matches(e.Message).Count) / 3.0; Assert.That(count, Is.EqualTo(Math.Floor(count)), "Should be symmetrical"); } diff --git a/OpenRA.Test/OpenRA.Game/MiniYamlTest.cs b/OpenRA.Test/OpenRA.Game/MiniYamlTest.cs index feb7bd2ed1..0f41361666 100644 --- a/OpenRA.Test/OpenRA.Game/MiniYamlTest.cs +++ b/OpenRA.Test/OpenRA.Game/MiniYamlTest.cs @@ -10,11 +10,11 @@ using System; using System.Collections.Generic; -using System.Text.RegularExpressions; using System.Linq; +using System.Text.RegularExpressions; +using NUnit.Framework; using OpenRA.GameRules; using OpenRA.Traits; -using NUnit.Framework; namespace OpenRA.Test { diff --git a/OpenRA.Utility/Program.cs b/OpenRA.Utility/Program.cs index 8b79d8f580..e15ee6f45a 100644 --- a/OpenRA.Utility/Program.cs +++ b/OpenRA.Utility/Program.cs @@ -50,7 +50,7 @@ namespace OpenRA.Utility try { - var action = Exts.WithDefault((a,b) => PrintUsage(actions), () => actions[args[0]]); + var action = Exts.WithDefault((a, b) => PrintUsage(actions), () => actions[args[0]]); action(modData, args); } catch (Exception e)