From a5fadb8e0b5091365f9f3b4cee5421b64c99aff5 Mon Sep 17 00:00:00 2001 From: adelikat Date: Thu, 3 Jul 2014 18:17:09 +0000 Subject: [PATCH] Some useless cleanup --- BizHawk.Client.Common/ControllerBinding.cs | 6 +-- BizHawk.Client.Common/CoreFileProvider.cs | 12 +++--- BizHawk.Client.Common/GLManager.cs | 8 ++-- BizHawk.Client.Common/config/PathEntry.cs | 39 ++++++++----------- .../movie/tasproj/TasMovie.cs | 2 +- 5 files changed, 28 insertions(+), 39 deletions(-) diff --git a/BizHawk.Client.Common/ControllerBinding.cs b/BizHawk.Client.Common/ControllerBinding.cs index 34e56cfc20..16e58dc971 100644 --- a/BizHawk.Client.Common/ControllerBinding.cs +++ b/BizHawk.Client.Common/ControllerBinding.cs @@ -244,10 +244,8 @@ namespace BizHawk.Client.Common var a = (Global.Emulator.Frame - _buttonStarts[button]) % (On + Off); return a < On && _buttons[button]; } - else - { - return _buttons[button]; - } + + return _buttons[button]; } public float GetFloat(string name) { throw new NotImplementedException(); } diff --git a/BizHawk.Client.Common/CoreFileProvider.cs b/BizHawk.Client.Common/CoreFileProvider.cs index be1252ecf0..c63fa2bc9b 100644 --- a/BizHawk.Client.Common/CoreFileProvider.cs +++ b/BizHawk.Client.Common/CoreFileProvider.cs @@ -48,14 +48,12 @@ namespace BizHawk.Client.Common "Couldn't find required firmware \"{0}:{1}\". This is fatal{2}", sysID, firmwareID, msg != null ? ": " + msg : "."); throw new Exception(fullmsg); } - else + + if (msg != null) { - if (msg != null) - { - var fullmsg = String.Format( - "Couldn't find firmware \"{0}:{1}\". Will attempt to continue: {2}", sysID, firmwareID, msg); - _showWarning(fullmsg); - } + var fullmsg = String.Format( + "Couldn't find firmware \"{0}:{1}\". Will attempt to continue: {2}", sysID, firmwareID, msg); + _showWarning(fullmsg); } } diff --git a/BizHawk.Client.Common/GLManager.cs b/BizHawk.Client.Common/GLManager.cs index 935d8944fc..2f502da874 100644 --- a/BizHawk.Client.Common/GLManager.cs +++ b/BizHawk.Client.Common/GLManager.cs @@ -15,16 +15,16 @@ namespace BizHawk.Client.Common public ContextRef CreateGLContext() { - var ret = new ContextRef() + var ret = new ContextRef { - gl = new BizHawk.Bizware.BizwareGL.Drivers.OpenTK.IGL_TK() + gl = new Bizware.BizwareGL.Drivers.OpenTK.IGL_TK() }; return ret; } public ContextRef GetContextForGraphicsControl(GraphicsControl gc) { - return new ContextRef() + return new ContextRef { gc = gc }; @@ -35,7 +35,7 @@ namespace BizHawk.Client.Common /// public ContextRef GetContextForIGL(IGL gl) { - return new ContextRef() + return new ContextRef { gl = gl }; diff --git a/BizHawk.Client.Common/config/PathEntry.cs b/BizHawk.Client.Common/config/PathEntry.cs index f95d42abc4..9680f547d6 100644 --- a/BizHawk.Client.Common/config/PathEntry.cs +++ b/BizHawk.Client.Common/config/PathEntry.cs @@ -7,8 +7,6 @@ namespace BizHawk.Client.Common { public class PathEntry { - public PathEntry() { } - public string SystemDisplayName; public string Type; public string Path; @@ -21,10 +19,8 @@ namespace BizHawk.Client.Common { return true; } - else - { - return System.Split('_').Contains(systemID); - } + + return System.Split('_').Contains(systemID); } } @@ -75,25 +71,22 @@ namespace BizHawk.Client.Common // we have the system, but not the type. don't attempt to add an unknown type return null; } - else + + // we don't have anything for the system in question. add a set of stock paths + var systempath = PathManager.RemoveInvalidFileSystemChars(system) + "_INTERIM"; + var systemdisp = system + " (INTERIM)"; + + Paths.AddRange(new[] { - // we don't have anything for the system in question. add a set of stock paths + new PathEntry { System = system, SystemDisplayName=systemdisp, Type = "Base", Path= Path.Combine(".", systempath), Ordinal = 0 }, + new PathEntry { System = system, SystemDisplayName=systemdisp, Type = "ROM", Path = ".", Ordinal = 1 }, + new PathEntry { System = system, SystemDisplayName=systemdisp, Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, + new PathEntry { System = system, SystemDisplayName=systemdisp, Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, + new PathEntry { System = system, SystemDisplayName=systemdisp, Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, + new PathEntry { System = system, SystemDisplayName=systemdisp, Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 } + }); - string systempath = PathManager.RemoveInvalidFileSystemChars(system) + "_INTERIM"; - string systemdisp = system + " (INTERIM)"; - - Paths.AddRange(new[] - { - new PathEntry { System = system, SystemDisplayName=systemdisp, Type = "Base", Path= Path.Combine(".", systempath), Ordinal = 0 }, - new PathEntry { System = system, SystemDisplayName=systemdisp, Type = "ROM", Path = ".", Ordinal = 1 }, - new PathEntry { System = system, SystemDisplayName=systemdisp, Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, - new PathEntry { System = system, SystemDisplayName=systemdisp, Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 }, - new PathEntry { System = system, SystemDisplayName=systemdisp, Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 }, - new PathEntry { System = system, SystemDisplayName=systemdisp, Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, - }); - - return this[system, type]; - } + return this[system, type]; } public void ResolveWithDefaults() diff --git a/BizHawk.Client.Common/movie/tasproj/TasMovie.cs b/BizHawk.Client.Common/movie/tasproj/TasMovie.cs index 66c30c9f0a..d224d77e87 100644 --- a/BizHawk.Client.Common/movie/tasproj/TasMovie.cs +++ b/BizHawk.Client.Common/movie/tasproj/TasMovie.cs @@ -52,7 +52,7 @@ namespace BizHawk.Client.Common get { // TODO - return new Dictionary() + return new Dictionary { { "A", "A" }, { "B", "B" }