Some useless cleanup

This commit is contained in:
adelikat 2014-07-03 18:17:09 +00:00
parent e058e08c35
commit a5fadb8e0b
5 changed files with 28 additions and 39 deletions

View File

@ -244,11 +244,9 @@ namespace BizHawk.Client.Common
var a = (Global.Emulator.Frame - _buttonStarts[button]) % (On + Off); var a = (Global.Emulator.Frame - _buttonStarts[button]) % (On + Off);
return a < On && _buttons[button]; return a < On && _buttons[button];
} }
else
{
return _buttons[button]; return _buttons[button];
} }
}
public float GetFloat(string name) { throw new NotImplementedException(); } public float GetFloat(string name) { throw new NotImplementedException(); }

View File

@ -48,8 +48,7 @@ namespace BizHawk.Client.Common
"Couldn't find required firmware \"{0}:{1}\". This is fatal{2}", sysID, firmwareID, msg != null ? ": " + msg : "."); "Couldn't find required firmware \"{0}:{1}\". This is fatal{2}", sysID, firmwareID, msg != null ? ": " + msg : ".");
throw new Exception(fullmsg); throw new Exception(fullmsg);
} }
else
{
if (msg != null) if (msg != null)
{ {
var fullmsg = String.Format( var fullmsg = String.Format(
@ -57,7 +56,6 @@ namespace BizHawk.Client.Common
_showWarning(fullmsg); _showWarning(fullmsg);
} }
} }
}
public string GetFirmwarePath(string sysID, string firmwareID, bool required, string msg = null) public string GetFirmwarePath(string sysID, string firmwareID, bool required, string msg = null)
{ {

View File

@ -15,16 +15,16 @@ namespace BizHawk.Client.Common
public ContextRef CreateGLContext() 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; return ret;
} }
public ContextRef GetContextForGraphicsControl(GraphicsControl gc) public ContextRef GetContextForGraphicsControl(GraphicsControl gc)
{ {
return new ContextRef() return new ContextRef
{ {
gc = gc gc = gc
}; };
@ -35,7 +35,7 @@ namespace BizHawk.Client.Common
/// </summary> /// </summary>
public ContextRef GetContextForIGL(IGL gl) public ContextRef GetContextForIGL(IGL gl)
{ {
return new ContextRef() return new ContextRef
{ {
gl = gl gl = gl
}; };

View File

@ -7,8 +7,6 @@ namespace BizHawk.Client.Common
{ {
public class PathEntry public class PathEntry
{ {
public PathEntry() { }
public string SystemDisplayName; public string SystemDisplayName;
public string Type; public string Type;
public string Path; public string Path;
@ -21,12 +19,10 @@ namespace BizHawk.Client.Common
{ {
return true; return true;
} }
else
{
return System.Split('_').Contains(systemID); return System.Split('_').Contains(systemID);
} }
} }
}
[Newtonsoft.Json.JsonObject] [Newtonsoft.Json.JsonObject]
public class PathEntryCollection : IEnumerable<PathEntry> public class PathEntryCollection : IEnumerable<PathEntry>
@ -75,12 +71,10 @@ namespace BizHawk.Client.Common
// we have the system, but not the type. don't attempt to add an unknown type // we have the system, but not the type. don't attempt to add an unknown type
return null; return null;
} }
else
{
// we don't have anything for the system in question. add a set of stock paths
string systempath = PathManager.RemoveInvalidFileSystemChars(system) + "_INTERIM"; // we don't have anything for the system in question. add a set of stock paths
string systemdisp = system + " (INTERIM)"; var systempath = PathManager.RemoveInvalidFileSystemChars(system) + "_INTERIM";
var systemdisp = system + " (INTERIM)";
Paths.AddRange(new[] Paths.AddRange(new[]
{ {
@ -89,12 +83,11 @@ namespace BizHawk.Client.Common
new PathEntry { System = system, SystemDisplayName=systemdisp, Type = "Savestates", Path= Path.Combine(".", "State"), Ordinal = 2 }, 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 = "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 = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 },
new PathEntry { System = system, SystemDisplayName=systemdisp, Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 }, 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() public void ResolveWithDefaults()
{ {

View File

@ -52,7 +52,7 @@ namespace BizHawk.Client.Common
get get
{ {
// TODO // TODO
return new Dictionary<string, string>() return new Dictionary<string, string>
{ {
{ "A", "A" }, { "A", "A" },
{ "B", "B" } { "B", "B" }