Compare commits

...

3 commits

Author SHA1 Message Date
Nicolas Abram eecdaabc49
Merge 551719fe37 into a23d8cb92f 2024-05-09 01:22:40 +02:00
Marco Carvalho a23d8cb92f
Replace "List.ForEach" for "foreach" (#6783)
* Replace "List.ForEach" for "foreach"

* dotnet format

* Update Ptc.cs

* Update GpuContext.cs
2024-05-08 13:53:25 +02:00
unknown 551719fe37 Don't prevent windows Display Sleep while paused 2024-04-22 11:51:03 -03:00
3 changed files with 34 additions and 6 deletions

View file

@ -857,8 +857,14 @@ namespace ARMeilleure.Translation.PTC
Stopwatch sw = Stopwatch.StartNew();
threads.ForEach((thread) => thread.Start());
threads.ForEach((thread) => thread.Join());
foreach (var thread in threads)
{
thread.Start();
}
foreach (var thread in threads)
{
thread.Join();
}
threads.Clear();

View file

@ -395,8 +395,14 @@ namespace Ryujinx.Graphics.Gpu
{
Renderer.CreateSync(SyncNumber, strict);
SyncActions.ForEach(action => action.SyncPreAction(syncpoint));
SyncpointActions.ForEach(action => action.SyncPreAction(syncpoint));
foreach (var action in SyncActions)
{
action.SyncPreAction(syncpoint);
}
foreach (var action in SyncpointActions)
{
action.SyncPreAction(syncpoint);
}
SyncNumber++;

View file

@ -403,7 +403,10 @@ namespace Ryujinx.Ava
_windowsMultimediaTimerResolution = new WindowsMultimediaTimerResolution(1);
}
DisplaySleep.Prevent();
Dispatcher.UIThread.Post(() =>
{
DisplaySleep.Prevent();
});
NpadManager.Initialize(Device, ConfigurationState.Instance.Hid.InputConfig, ConfigurationState.Instance.Hid.EnableKeyboard, ConfigurationState.Instance.Hid.EnableMouse);
TouchScreenManager.Initialize(Device);
@ -516,7 +519,10 @@ namespace Ryujinx.Ava
_gpuDoneEvent.WaitOne();
_gpuDoneEvent.Dispose();
DisplaySleep.Restore();
Dispatcher.UIThread.Post(() =>
{
DisplaySleep.Restore();
});
NpadManager.Dispose();
TouchScreenManager.Dispose();
@ -789,6 +795,11 @@ namespace Ryujinx.Ava
internal void Resume()
{
Dispatcher.UIThread.Post(() =>
{
DisplaySleep.Prevent();
});
Device?.System.TogglePauseEmulation(false);
_viewModel.IsPaused = false;
@ -798,6 +809,11 @@ namespace Ryujinx.Ava
internal void Pause()
{
Dispatcher.UIThread.Post(() =>
{
DisplaySleep.Restore();
});
Device?.System.TogglePauseEmulation(true);
_viewModel.IsPaused = true;