0
0
Fork 0
mirror of https://github.com/GreemDev/Ryujinx.git synced 2025-01-08 06:01:58 +00:00

misc: Small cleanups

This commit is contained in:
Evan Husted 2024-12-30 00:14:55 -06:00
parent 7f9dccb293
commit da8ea06074
2 changed files with 6 additions and 5 deletions

View file

@ -17,7 +17,7 @@ namespace Ryujinx.Common.Configuration
public ulong Pack() => BitTricks.PackBitFields([(uint)Hack, (uint)Value], PackedFormat);
public static EnabledDirtyHack FromPacked(ulong packedHack)
public static EnabledDirtyHack Unpack(ulong packedHack)
{
var unpackedFields = BitTricks.UnpackBitFields(packedHack, PackedFormat);
if (unpackedFields is not [var hack, var value])
@ -39,7 +39,7 @@ namespace Ryujinx.Common.Configuration
public DirtyHackCollection(ulong[] packedHacks)
{
foreach ((DirtyHacks dirtyHacks, int value) in packedHacks.Select(EnabledDirtyHack.FromPacked))
foreach ((DirtyHacks dirtyHacks, int value) in packedHacks.Select(EnabledDirtyHack.Unpack))
{
Add(dirtyHacks, value);
}

View file

@ -752,11 +752,12 @@ namespace Ryujinx.Ava.Utilities.Configuration
Hacks.ShowDirtyHacks.Value = configurationFileFormat.ShowDirtyHacks;
{
EnabledDirtyHack[] hacks = (configurationFileFormat.DirtyHacks ?? []).Select(EnabledDirtyHack.FromPacked).ToArray();
EnabledDirtyHack[] hacks = (configurationFileFormat.DirtyHacks ?? []).Select(EnabledDirtyHack.Unpack).ToArray();
Hacks.Xc2MenuSoftlockFix.Value = hacks.Any(it => it.Hack == DirtyHacks.Xc2MenuSoftlockFix);
var shaderCompilationThreadSleep = hacks.FirstOrDefault(it => it.Hack == DirtyHacks.ShaderCompilationThreadSleep);
var shaderCompilationThreadSleep = hacks.FirstOrDefault(it =>
it.Hack == DirtyHacks.ShaderCompilationThreadSleep);
Hacks.EnableShaderCompilationThreadSleep.Value = shaderCompilationThreadSleep != null;
Hacks.ShaderCompilationThreadSleepDelay.Value = shaderCompilationThreadSleep?.Value ?? 0;
}