Skip to content

Commit

Permalink
misc: cleanup applying the current dirty hacks to the config upon loa…
Browse files Browse the repository at this point in the history
…ding the json
  • Loading branch information
GreemDev committed Dec 31, 2024
1 parent b6f8851 commit 172869b
Showing 1 changed file with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Gommon;
using Ryujinx.Ava.Utilities.Configuration.System;
using Ryujinx.Ava.Utilities.Configuration.UI;
using Ryujinx.Common.Configuration;
Expand All @@ -9,7 +10,6 @@
using Ryujinx.HLE;
using System;
using System.Collections.Generic;
using System.Linq;

namespace Ryujinx.Ava.Utilities.Configuration
{
Expand Down Expand Up @@ -752,14 +752,12 @@ public void Load(ConfigurationFileFormat configurationFileFormat, string configu
Hacks.ShowDirtyHacks.Value = configurationFileFormat.ShowDirtyHacks;

{
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);
Hacks.EnableShaderTranslationDelay.Value = shaderCompilationThreadSleep != null;
Hacks.ShaderTranslationDelay.Value = shaderCompilationThreadSleep?.Value ?? 0;
DirtyHackCollection hacks = new (configurationFileFormat.DirtyHacks ?? []);

Hacks.Xc2MenuSoftlockFix.Value = hacks.IsEnabled(DirtyHacks.Xc2MenuSoftlockFix);

Hacks.EnableShaderTranslationDelay.Value = hacks.IsEnabled(DirtyHacks.ShaderCompilationThreadSleep);
Hacks.ShaderTranslationDelay.Value = hacks[DirtyHacks.ShaderCompilationThreadSleep].CoerceAtLeast(0);
}

if (configurationFileUpdated)
Expand Down

0 comments on commit 172869b

Please sign in to comment.