Skip to content

Commit

Permalink
misc: chore: code cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
GreemDev committed Jan 23, 2025
1 parent f81cb09 commit 3307942
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Ryujinx.Common/TitleIDs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Ryujinx.Common
{
public static class TitleIDs
{
public static ReactiveObject<Optional<string>> CurrentApplication { get; set; } = new();
public static ReactiveObject<Optional<string>> CurrentApplication { get; } = new();

public static GraphicsBackend SelectGraphicsBackend(string titleId, GraphicsBackend currentBackend)
{
Expand Down
15 changes: 15 additions & 0 deletions src/Ryujinx.HLE/PerformanceStatistics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,5 +161,20 @@ public double GetGameFrameTime()
{
return 1000 / _frameRate[FrameTypeGame];
}

public string FormatGameFrameRate()
{
double frameRate = GetGameFrameRate();
double frameTime = GetGameFrameTime();

return $"{frameRate:00.00} FPS ({frameTime:00.00}ms)";
}

public string FormatFifoPercent()
{
double fifoPercent = GetFifoPercent();

return $"FIFO: {fifoPercent:00.00}%";
}
}
}
4 changes: 2 additions & 2 deletions src/Ryujinx.HLE/Switch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ public class Switch : IDisposable

public int CpuCoresCount = 4; //Switch 1 has 4 cores

public VSyncMode VSyncMode { get; set; } = VSyncMode.Switch;
public bool CustomVSyncIntervalEnabled { get; set; } = false;
public VSyncMode VSyncMode { get; set; }
public bool CustomVSyncIntervalEnabled { get; set; }
public int CustomVSyncInterval { get; set; }

public long TargetVSyncInterval { get; set; } = 60;
Expand Down
4 changes: 2 additions & 2 deletions src/Ryujinx/AppHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1151,8 +1151,8 @@ public void UpdateStatus()
LocaleManager.Instance[LocaleKeys.VolumeShort] + $": {(int)(Device.GetVolume() * 100)}%",
dockedMode,
ConfigurationState.Instance.Graphics.AspectRatio.Value.ToText(),
$"{Device.Statistics.GetGameFrameRate():00.00} FPS ({Device.Statistics.GetGameFrameTime():00.00} ms)",
$"FIFO: {Device.Statistics.GetFifoPercent():00.00} %",
Device.Statistics.FormatGameFrameRate(),
Device.Statistics.FormatFifoPercent(),
_displayCount));
}

Expand Down
2 changes: 1 addition & 1 deletion src/Ryujinx/Assets/locales.json
Original file line number Diff line number Diff line change
Expand Up @@ -22998,4 +22998,4 @@
}
}
]
}
}

0 comments on commit 3307942

Please sign in to comment.