mirror of
https://github.com/Ryubing/Ryujinx.git
synced 2025-11-19 18:31:08 -05:00
Compare commits
2 Commits
Canary-1.2
...
Canary-1.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9c82d98ec4 | ||
|
|
4aae82bad1 |
@@ -13,6 +13,7 @@ using System.Collections.Generic;
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.IO.Compression;
|
using System.IO.Compression;
|
||||||
|
using System.Linq;
|
||||||
using System.Runtime;
|
using System.Runtime;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
@@ -848,18 +849,15 @@ namespace ARMeilleure.Translation.PTC
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Thread> threads = new();
|
|
||||||
|
|
||||||
for (int i = 0; i < degreeOfParallelism; i++)
|
List<Thread> threads = Enumerable.Range(0, degreeOfParallelism)
|
||||||
{
|
.Select(idx =>
|
||||||
Thread thread = new(TranslateFuncs)
|
new Thread(TranslateFuncs)
|
||||||
{
|
{
|
||||||
IsBackground = true,
|
IsBackground = true,
|
||||||
Name = "Ptc.TranslateThread." + i
|
Name = "Ptc.TranslateThread." + idx
|
||||||
};
|
}
|
||||||
|
).ToList();
|
||||||
threads.Add(thread);
|
|
||||||
}
|
|
||||||
|
|
||||||
Stopwatch sw = Stopwatch.StartNew();
|
Stopwatch sw = Stopwatch.StartNew();
|
||||||
|
|
||||||
|
|||||||
@@ -30,10 +30,10 @@ namespace Ryujinx.Common.Logging.Targets
|
|||||||
string ILogTarget.Name { get => _target.Name; }
|
string ILogTarget.Name { get => _target.Name; }
|
||||||
|
|
||||||
public AsyncLogTargetWrapper(ILogTarget target)
|
public AsyncLogTargetWrapper(ILogTarget target)
|
||||||
: this(target, -1, AsyncLogTargetOverflowAction.Block)
|
: this(target, -1)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
public AsyncLogTargetWrapper(ILogTarget target, int queueLimit, AsyncLogTargetOverflowAction overflowAction)
|
public AsyncLogTargetWrapper(ILogTarget target, int queueLimit = -1, AsyncLogTargetOverflowAction overflowAction = AsyncLogTargetOverflowAction.Block)
|
||||||
{
|
{
|
||||||
_target = target;
|
_target = target;
|
||||||
_messageQueue = new BlockingCollection<LogEventArgs>(queueLimit);
|
_messageQueue = new BlockingCollection<LogEventArgs>(queueLimit);
|
||||||
|
|||||||
@@ -117,8 +117,9 @@ namespace Ryujinx.Headless.SDL2.OpenGL
|
|||||||
GraphicsDebugLevel glLogLevel,
|
GraphicsDebugLevel glLogLevel,
|
||||||
AspectRatio aspectRatio,
|
AspectRatio aspectRatio,
|
||||||
bool enableMouse,
|
bool enableMouse,
|
||||||
HideCursorMode hideCursorMode)
|
HideCursorMode hideCursorMode,
|
||||||
: base(inputManager, glLogLevel, aspectRatio, enableMouse, hideCursorMode)
|
bool ignoreControllerApplet)
|
||||||
|
: base(inputManager, glLogLevel, aspectRatio, enableMouse, hideCursorMode, ignoreControllerApplet)
|
||||||
{
|
{
|
||||||
_glLogLevel = glLogLevel;
|
_glLogLevel = glLogLevel;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -226,6 +226,9 @@ namespace Ryujinx.Headless.SDL2
|
|||||||
[Option("ignore-missing-services", Required = false, Default = false, HelpText = "Enable ignoring missing services.")]
|
[Option("ignore-missing-services", Required = false, Default = false, HelpText = "Enable ignoring missing services.")]
|
||||||
public bool IgnoreMissingServices { get; set; }
|
public bool IgnoreMissingServices { get; set; }
|
||||||
|
|
||||||
|
[Option("ignore-controller-applet", Required = false, Default = false, HelpText = "Enable ignoring the controller applet when your game loses connection to your controller.")]
|
||||||
|
public bool IgnoreControllerApplet { get; set; }
|
||||||
|
|
||||||
// Values
|
// Values
|
||||||
|
|
||||||
[Value(0, MetaName = "input", HelpText = "Input to load.", Required = true)]
|
[Value(0, MetaName = "input", HelpText = "Input to load.", Required = true)]
|
||||||
|
|||||||
@@ -444,8 +444,7 @@ namespace Ryujinx.Headless.SDL2
|
|||||||
{
|
{
|
||||||
Logger.AddTarget(new AsyncLogTargetWrapper(
|
Logger.AddTarget(new AsyncLogTargetWrapper(
|
||||||
new FileLogTarget("file", logFile),
|
new FileLogTarget("file", logFile),
|
||||||
1000,
|
1000
|
||||||
AsyncLogTargetOverflowAction.Block
|
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -506,8 +505,8 @@ namespace Ryujinx.Headless.SDL2
|
|||||||
private static WindowBase CreateWindow(Options options)
|
private static WindowBase CreateWindow(Options options)
|
||||||
{
|
{
|
||||||
return options.GraphicsBackend == GraphicsBackend.Vulkan
|
return options.GraphicsBackend == GraphicsBackend.Vulkan
|
||||||
? new VulkanWindow(_inputManager, options.LoggingGraphicsDebugLevel, options.AspectRatio, options.EnableMouse, options.HideCursorMode)
|
? new VulkanWindow(_inputManager, options.LoggingGraphicsDebugLevel, options.AspectRatio, options.EnableMouse, options.HideCursorMode, options.IgnoreControllerApplet)
|
||||||
: new OpenGLWindow(_inputManager, options.LoggingGraphicsDebugLevel, options.AspectRatio, options.EnableMouse, options.HideCursorMode);
|
: new OpenGLWindow(_inputManager, options.LoggingGraphicsDebugLevel, options.AspectRatio, options.EnableMouse, options.HideCursorMode, options.IgnoreControllerApplet);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static IRenderer CreateRenderer(Options options, WindowBase window)
|
private static IRenderer CreateRenderer(Options options, WindowBase window)
|
||||||
|
|||||||
@@ -17,8 +17,9 @@ namespace Ryujinx.Headless.SDL2.Vulkan
|
|||||||
GraphicsDebugLevel glLogLevel,
|
GraphicsDebugLevel glLogLevel,
|
||||||
AspectRatio aspectRatio,
|
AspectRatio aspectRatio,
|
||||||
bool enableMouse,
|
bool enableMouse,
|
||||||
HideCursorMode hideCursorMode)
|
HideCursorMode hideCursorMode,
|
||||||
: base(inputManager, glLogLevel, aspectRatio, enableMouse, hideCursorMode)
|
bool ignoreControllerApplet)
|
||||||
|
: base(inputManager, glLogLevel, aspectRatio, enableMouse, hideCursorMode, ignoreControllerApplet)
|
||||||
{
|
{
|
||||||
_glLogLevel = glLogLevel;
|
_glLogLevel = glLogLevel;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,13 +86,15 @@ namespace Ryujinx.Headless.SDL2
|
|||||||
|
|
||||||
private readonly AspectRatio _aspectRatio;
|
private readonly AspectRatio _aspectRatio;
|
||||||
private readonly bool _enableMouse;
|
private readonly bool _enableMouse;
|
||||||
|
private readonly bool _ignoreControllerApplet;
|
||||||
|
|
||||||
public WindowBase(
|
public WindowBase(
|
||||||
InputManager inputManager,
|
InputManager inputManager,
|
||||||
GraphicsDebugLevel glLogLevel,
|
GraphicsDebugLevel glLogLevel,
|
||||||
AspectRatio aspectRatio,
|
AspectRatio aspectRatio,
|
||||||
bool enableMouse,
|
bool enableMouse,
|
||||||
HideCursorMode hideCursorMode)
|
HideCursorMode hideCursorMode,
|
||||||
|
bool ignoreControllerApplet)
|
||||||
{
|
{
|
||||||
MouseDriver = new SDL2MouseDriver(hideCursorMode);
|
MouseDriver = new SDL2MouseDriver(hideCursorMode);
|
||||||
_inputManager = inputManager;
|
_inputManager = inputManager;
|
||||||
@@ -108,6 +110,7 @@ namespace Ryujinx.Headless.SDL2
|
|||||||
_gpuDoneEvent = new ManualResetEvent(false);
|
_gpuDoneEvent = new ManualResetEvent(false);
|
||||||
_aspectRatio = aspectRatio;
|
_aspectRatio = aspectRatio;
|
||||||
_enableMouse = enableMouse;
|
_enableMouse = enableMouse;
|
||||||
|
_ignoreControllerApplet = ignoreControllerApplet;
|
||||||
HostUITheme = new HeadlessHostUiTheme();
|
HostUITheme = new HeadlessHostUiTheme();
|
||||||
|
|
||||||
SDL2Driver.Instance.Initialize();
|
SDL2Driver.Instance.Initialize();
|
||||||
@@ -484,6 +487,8 @@ namespace Ryujinx.Headless.SDL2
|
|||||||
|
|
||||||
public bool DisplayMessageDialog(ControllerAppletUIArgs args)
|
public bool DisplayMessageDialog(ControllerAppletUIArgs args)
|
||||||
{
|
{
|
||||||
|
if (_ignoreControllerApplet) return false;
|
||||||
|
|
||||||
string playerCount = args.PlayerCountMin == args.PlayerCountMax ? $"exactly {args.PlayerCountMin}" : $"{args.PlayerCountMin}-{args.PlayerCountMax}";
|
string playerCount = args.PlayerCountMin == args.PlayerCountMax ? $"exactly {args.PlayerCountMin}" : $"{args.PlayerCountMin}-{args.PlayerCountMax}";
|
||||||
|
|
||||||
string message = $"Application requests {playerCount} {"player".ToQuantity(args.PlayerCountMin + args.PlayerCountMax, ShowQuantityAs.None)} with:\n\n"
|
string message = $"Application requests {playerCount} {"player".ToQuantity(args.PlayerCountMin + args.PlayerCountMax, ShowQuantityAs.None)} with:\n\n"
|
||||||
|
|||||||
Reference in New Issue
Block a user