From da8ea060742fce81d1767c595478c3700fe39f84 Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Mon, 30 Dec 2024 00:14:55 -0600 Subject: [PATCH] misc: Small cleanups --- src/Ryujinx.Common/Configuration/DirtyHacks.cs | 4 ++-- .../Configuration/ConfigurationState.Migration.cs | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Ryujinx.Common/Configuration/DirtyHacks.cs b/src/Ryujinx.Common/Configuration/DirtyHacks.cs index d874b226c..1015e95d1 100644 --- a/src/Ryujinx.Common/Configuration/DirtyHacks.cs +++ b/src/Ryujinx.Common/Configuration/DirtyHacks.cs @@ -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); } diff --git a/src/Ryujinx/Utilities/Configuration/ConfigurationState.Migration.cs b/src/Ryujinx/Utilities/Configuration/ConfigurationState.Migration.cs index 812092688..c16872a61 100644 --- a/src/Ryujinx/Utilities/Configuration/ConfigurationState.Migration.cs +++ b/src/Ryujinx/Utilities/Configuration/ConfigurationState.Migration.cs @@ -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; }