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

@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Ryujinx.Profiler.UI
{

View file

@ -98,7 +98,7 @@ namespace Ryujinx.Profiler.UI
private readonly object _profileDataLock = new object();
public ProfileWindow()
// Graphigs mode enables 2xAA
// Graphics mode enables 2xAA
: base(1280, 720, new GraphicsMode(new ColorFormat(8, 8, 8, 8), 1, 1, 2))
{
Title = "Profiler";
@ -108,7 +108,7 @@ namespace Ryujinx.Profiler.UI
if (Profile.UpdateRate <= 0)
{
// Perform step regardless of flag type
Profile.RegisterFlagReciever((t) =>
Profile.RegisterFlagReceiver((t) =>
{
if (!_paused)
{
@ -146,7 +146,7 @@ namespace Ryujinx.Profiler.UI
{
GL.ClearColor(Color.Black);
_fontService = new FontService();
_fontService.InitalizeTextures();
_fontService.InitializeTextures();
_fontService.UpdateScreenHeight(Height);
_buttons = new ProfileButton[(int)ButtonIndex.Count];

View file

@ -18,7 +18,7 @@ namespace Ryujinx.Profiler.UI
float barHeight = (LineHeight - LinePadding) / 3.0f;
// Get max values
var maxInstant = maxAverage = maxTotal = 0;
long maxInstant = maxAverage = maxTotal = 0;
foreach (KeyValuePair<ProfileConfig, TimingInfo> kvp in _sortedProfileData)
{
maxInstant = Math.Max(maxInstant, kvp.Value.Instant);

View file

@ -7,8 +7,8 @@ namespace Ryujinx.Profiler.UI
{
public partial class ProfileWindow
{
// Colour index equal to timing flag type as int
private Color[] _timingFlagColours = new[]
// Color index equal to timing flag type as int
private Color[] _timingFlagColors = new[]
{
new Color(150, 25, 25, 50), // FrameSwap = 0
new Color(25, 25, 150, 50), // SystemFrame = 1
@ -62,7 +62,7 @@ namespace Ryujinx.Profiler.UI
if (prevType != timingFlag.FlagType)
{
prevType = timingFlag.FlagType;
GL.Color4(_timingFlagColours[(int)prevType]);
GL.Color4(_timingFlagColors[(int)prevType]);
}
int x = (int)(graphRight - ((graphPositionTicks - timingFlag.Timestamp) / timeWidthTicks) * width);

View file

@ -1,5 +1,4 @@
using System.Diagnostics;
using System.Threading;
using System.Threading;
using OpenTK;
using OpenTK.Input;
using Ryujinx.Common;

View file

@ -36,7 +36,7 @@ namespace Ryujinx.Profiler.UI.SharpFontHelpers
private string GetFontPath()
{
string fontFolder = System.Environment.GetFolderPath(Environment.SpecialFolder.Fonts);
string fontFolder = Environment.GetFolderPath(Environment.SpecialFolder.Fonts);
// Only uses Arial, add more fonts here if wanted
string path = Path.Combine(fontFolder, "arial.ttf");
@ -48,7 +48,7 @@ namespace Ryujinx.Profiler.UI.SharpFontHelpers
throw new Exception($"Profiler exception. Required font Courier New or Arial not installed to {fontFolder}");
}
public void InitalizeTextures()
public void InitializeTextures()
{
// Create and init some vars
uint[] rawCharacterSheet = new uint[SheetWidth * SheetHeight];
@ -66,7 +66,7 @@ namespace Ryujinx.Profiler.UI.SharpFontHelpers
// Update raw data for each character
for (int i = 0; i < 94; i++)
{
var surface = RenderSurface((char)(i + 33), font, out var xBearing, out var yBearing, out var advance);
var surface = RenderSurface((char)(i + 33), font, out float xBearing, out float yBearing, out float advance);
characters[i] = UpdateTexture(surface, ref rawCharacterSheet, ref x, ref y, ref lineOffset);
characters[i].BearingX = xBearing;
@ -217,7 +217,7 @@ namespace Ryujinx.Profiler.UI.SharpFontHelpers
lineOffset = 0;
}
// Update lineoffset
// Update lineOffset
if (lineOffset < height)
{
lineOffset = height + 1;