Skip to content

Commit

Permalink
Added --backend-threading arg for CommandLineState (#599)
Browse files Browse the repository at this point in the history
Added the `--backend-threading` arg so that you can launch games via
a shortcut with modifications to this setting.
Goodfeat authored Jan 29, 2025
1 parent 707c9ef commit e02ef52
Showing 2 changed files with 21 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Ryujinx/Program.cs
Original file line number Diff line number Diff line change
@@ -206,6 +206,16 @@ public static void ReloadConfig()
_ => ConfigurationState.Instance.Graphics.GraphicsBackend
};

// Check if backend threading was overridden
if (CommandLineState.OverrideBackendThreading is not null)
ConfigurationState.Instance.Graphics.BackendThreading.Value = CommandLineState.OverrideBackendThreading.ToLower() switch
{
"auto" => BackendThreading.Auto,
"off" => BackendThreading.Off,
"on" => BackendThreading.On,
_ => ConfigurationState.Instance.Graphics.BackendThreading
};

// Check if docked mode was overriden.
if (CommandLineState.OverrideDockedMode.HasValue)
ConfigurationState.Instance.System.EnableDockedMode.Value = CommandLineState.OverrideDockedMode.Value;
11 changes: 11 additions & 0 deletions src/Ryujinx/Utilities/CommandLineState.cs
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@ public static class CommandLineState
public static bool? OverrideDockedMode { get; private set; }
public static bool? OverrideHardwareAcceleration { get; private set; }
public static string OverrideGraphicsBackend { get; private set; }
public static string OverrideBackendThreading { get; private set; }
public static string OverrideHideCursor { get; private set; }
public static string BaseDirPathArg { get; private set; }
public static string Profile { get; private set; }
@@ -74,6 +75,16 @@ public static void ParseArguments(string[] args)

OverrideGraphicsBackend = args[++i];
break;
case "--backend-threading":
if (i + 1 >= args.Length)
{
Logger.Error?.Print(LogClass.Application, $"Invalid option '{arg}'");

continue;
}

OverrideBackendThreading = args[++i];
break;
case "-i":
case "--application-id":
LaunchApplicationId = args[++i];

0 comments on commit e02ef52

Please sign in to comment.