Misc cleanup (#708)

* Fix typos

* Remove unneeded using statements

* Enforce var style more

* Remove redundant qualifiers

* Fix some indentation

* Disable naming warnings on files with external enum names

* Fix build

* Mass find & replace for comments with no spacing

* Standardize todo capitalization and for/if spacing
This commit is contained in:
Alex Barney
2019-07-01 21:39:22 -05:00
committed by Ac_K
parent 10c74182ba
commit b2b736abc2
205 changed files with 1020 additions and 1041 deletions

View File

@@ -4,19 +4,19 @@
// Dump shaders in local directory (e.g. `C:\ShaderDumps`)
"graphics_shaders_dump_path": "",
// Enable print debug logs
// Enable printing debug logs
"logging_enable_debug": false,
// Enable print stubbed calls logs
// Enable printing stubbed calls logs
"logging_enable_stub": true,
// Enable print informations logs
// Enable printing information logs
"logging_enable_info": true,
// Enable print warning logs
// Enable printing warning logs
"logging_enable_warn": true,
// Enable print error logs
// Enable printing error logs
"logging_enable_error": true,
// Enable printing guest logs
@@ -38,8 +38,8 @@
// Enable or disable Docked Mode
"docked_mode": false,
// Enable or disable Discord Rich Presense
"enable_discord_intergration": true,
// Enable or disable Discord Rich Presence
"enable_discord_integration": true,
// Enable or disable Game Vsync
"enable_vsync": true,

View File

@@ -83,9 +83,9 @@ namespace Ryujinx
public bool DockedMode { get; private set; }
/// <summary>
/// Enables or disables Discord Rich Presense
/// Enables or disables Discord Rich Presence
/// </summary>
public bool EnableDiscordIntergration { get; private set; }
public bool EnableDiscordIntegration { get; private set; }
/// <summary>
/// Enables or disables Vertical Sync
@@ -220,7 +220,7 @@ namespace Ryujinx
}
}
device.System.State.DiscordIntergrationEnabled = Instance.EnableDiscordIntergration;
device.System.State.DiscordIntegrationEnabled = Instance.EnableDiscordIntegration;
device.EnableDeviceVsync = Instance.EnableVsync;
@@ -246,7 +246,7 @@ namespace Ryujinx
ServiceConfiguration.IgnoreMissingServices = Instance.IgnoreMissingServices;
if(Instance.GamepadControls.Enabled)
if (Instance.GamepadControls.Enabled)
{
if (GamePad.GetName(Instance.GamepadControls.Index) == "Unmapped Controller")
{
@@ -254,8 +254,8 @@ namespace Ryujinx
}
}
device.Hid.InitilizePrimaryController(Instance.ControllerType);
device.Hid.InitilizeKeyboard();
device.Hid.InitializePrimaryController(Instance.ControllerType);
device.Hid.InitializeKeyboard();
}
private class ConfigurationEnumFormatter<T> : IJsonFormatter<T>
@@ -274,10 +274,10 @@ namespace Ryujinx
return default(T);
}
var enumName = formatterResolver.GetFormatterWithVerify<string>()
.Deserialize(ref reader, formatterResolver);
string enumName = formatterResolver.GetFormatterWithVerify<string>()
.Deserialize(ref reader, formatterResolver);
if(Enum.TryParse<T>(enumName, out T result))
if (Enum.TryParse<T>(enumName, out T result))
{
return result;
}

View File

@@ -32,12 +32,12 @@ namespace Ryujinx
Configuration.Load(Path.Combine(ApplicationDirectory, "Config.jsonc"));
Configuration.Configure(device);
Profile.Initalize();
Profile.Initialize();
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
AppDomain.CurrentDomain.ProcessExit += CurrentDomain_ProcessExit;
if (device.System.State.DiscordIntergrationEnabled == true)
if (device.System.State.DiscordIntegrationEnabled == true)
{
DiscordClient = new DiscordRpcClient("568815339807309834");
DiscordPresence = new RichPresence
@@ -108,7 +108,7 @@ namespace Ryujinx
Logger.PrintWarning(LogClass.Application, "Please specify the folder with the NSOs/IStorage or a NSO/NRO.");
}
if (device.System.State.DiscordIntergrationEnabled == true)
if (device.System.State.DiscordIntegrationEnabled == true)
{
if (File.ReadAllLines(Path.Combine(ApplicationDirectory, "RPsupported.dat")).Contains(device.System.TitleID))
{

View File

@@ -4,7 +4,6 @@ using OpenTK.Input;
using Ryujinx.Graphics.Gal;
using Ryujinx.HLE;
using Ryujinx.HLE.Input;
using Ryujinx.Profiler;
using Ryujinx.Profiler.UI;
using System;
using System.Threading;
@@ -97,7 +96,7 @@ namespace Ryujinx
{
RenderFrame();
//Queue max. 1 vsync
// Queue max. 1 vsync
ticks = Math.Min(ticks - ticksPerFrame, ticksPerFrame);
}
}
@@ -113,7 +112,7 @@ namespace Ryujinx
Context.MakeCurrent(null);
//OpenTK doesn't like sleeps in its thread, to avoid this a renderer thread is created
// OpenTK doesn't like sleeps in its thread, to avoid this a renderer thread is created
_renderThread = new Thread(RenderLoop);
_renderThread.Start();
@@ -134,7 +133,7 @@ namespace Ryujinx
}
}
//Polling becomes expensive if it's not slept
// Polling becomes expensive if it's not slept
Thread.Sleep(1);
}
}
@@ -152,7 +151,7 @@ namespace Ryujinx
int rightJoystickDx = 0;
int rightJoystickDy = 0;
//Keyboard Input
// Keyboard Input
if (_keyboard.HasValue)
{
KeyboardState keyboard = _keyboard.Value;
@@ -186,7 +185,7 @@ namespace Ryujinx
currentButton |= Configuration.Instance.GamepadControls.GetButtons();
//Keyboard has priority stick-wise
// Keyboard has priority stick-wise
if (leftJoystickDx == 0 && leftJoystickDy == 0)
{
(leftJoystickDx, leftJoystickDy) = Configuration.Instance.GamepadControls.GetLeftStick();
@@ -213,8 +212,8 @@ namespace Ryujinx
bool hasTouch = false;
//Get screen touch position from left mouse click
//OpenTK always captures mouse events, even if out of focus, so check if window is focused.
// Get screen touch position from left mouse click
// OpenTK always captures mouse events, even if out of focus, so check if window is focused.
if (Focused && _mouse?.LeftButton == ButtonState.Pressed)
{
MouseState mouse = _mouse.Value;
@@ -253,7 +252,7 @@ namespace Ryujinx
X = mX,
Y = mY,
//Placeholder values till more data is acquired
// Placeholder values till more data is acquired
DiameterX = 10,
DiameterY = 10,
Angle = 90

View File

@@ -216,7 +216,7 @@ namespace Ryujinx.UI.Input
case ControllerInputId.LTrigger: return gpState.Triggers.Left >= TriggerThreshold;
case ControllerInputId.RTrigger: return gpState.Triggers.Right >= TriggerThreshold;
//Using thumbsticks as buttons is not common, but it would be nice not to ignore them
// Using thumbsticks as buttons is not common, but it would be nice not to ignore them
case ControllerInputId.LJoystick:
return gpState.ThumbSticks.Left.X >= Deadzone ||
gpState.ThumbSticks.Left.Y >= Deadzone;

View File

@@ -1,6 +1,5 @@
using OpenTK.Input;
using Ryujinx.HLE.Input;
using Ryujinx.Common.Logging;
namespace Ryujinx.UI.Input
{

View File

@@ -393,11 +393,11 @@
false
]
},
"enable_discord_intergration": {
"$id": "#/properties/enable_discord_intergration",
"enable_discord_integration": {
"$id": "#/properties/enable_discord_integration",
"type": "boolean",
"title": "Enable Discord Rich Presense",
"description": "Enable or disable Discord Rich Presense",
"title": "Enable Discord Rich Presence",
"description": "Enable or disable Discord Rich Presence",
"default": true,
"examples": [
true,