Make PPTC state non-static (#4157)
* Make PPTC state non-static * DiskCacheLoadState can be null
This commit is contained in:
parent
08831eecf7
commit
fc4b7cba2c
21 changed files with 434 additions and 230 deletions
|
@ -1,5 +1,4 @@
|
|||
using ARMeilleure.Translation;
|
||||
using ARMeilleure.Translation.PTC;
|
||||
using Gtk;
|
||||
using LibHac.Common;
|
||||
using LibHac.Common.Keys;
|
||||
|
@ -16,6 +15,7 @@ using Ryujinx.Common;
|
|||
using Ryujinx.Common.Configuration;
|
||||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.Common.SystemInterop;
|
||||
using Ryujinx.Cpu;
|
||||
using Ryujinx.Graphics.GAL;
|
||||
using Ryujinx.Graphics.GAL.Multithreading;
|
||||
using Ryujinx.Graphics.OpenGL;
|
||||
|
@ -46,7 +46,6 @@ using System.Threading;
|
|||
using System.Threading.Tasks;
|
||||
|
||||
using GUI = Gtk.Builder.ObjectAttribute;
|
||||
using PtcLoadingState = ARMeilleure.Translation.PTC.PtcLoadingState;
|
||||
using ShaderCacheLoadingState = Ryujinx.Graphics.Gpu.Shader.ShaderCacheState;
|
||||
|
||||
namespace Ryujinx.Ui
|
||||
|
@ -588,8 +587,11 @@ namespace Ryujinx.Ui
|
|||
|
||||
private void SetupProgressUiHandlers()
|
||||
{
|
||||
Ptc.PtcStateChanged -= ProgressHandler;
|
||||
Ptc.PtcStateChanged += ProgressHandler;
|
||||
if (_emulationContext.Application.DiskCacheLoadState != null)
|
||||
{
|
||||
_emulationContext.Application.DiskCacheLoadState.StateChanged -= ProgressHandler;
|
||||
_emulationContext.Application.DiskCacheLoadState.StateChanged += ProgressHandler;
|
||||
}
|
||||
|
||||
_emulationContext.Gpu.ShaderCacheStateChanged -= ProgressHandler;
|
||||
_emulationContext.Gpu.ShaderCacheStateChanged += ProgressHandler;
|
||||
|
@ -602,8 +604,8 @@ namespace Ryujinx.Ui
|
|||
|
||||
switch (state)
|
||||
{
|
||||
case PtcLoadingState ptcState:
|
||||
visible = ptcState != PtcLoadingState.Loaded;
|
||||
case LoadState ptcState:
|
||||
visible = ptcState != LoadState.Loaded;
|
||||
label = $"PTC : {current}/{total}";
|
||||
break;
|
||||
case ShaderCacheLoadingState shaderCacheState:
|
||||
|
@ -705,8 +707,6 @@ namespace Ryujinx.Ui
|
|||
|
||||
UpdateGraphicsConfig();
|
||||
|
||||
SetupProgressUiHandlers();
|
||||
|
||||
SystemVersion firmwareVersion = _contentManager.GetCurrentFirmwareVersion();
|
||||
|
||||
bool isDirectory = Directory.Exists(path);
|
||||
|
@ -841,6 +841,8 @@ namespace Ryujinx.Ui
|
|||
return;
|
||||
}
|
||||
|
||||
SetupProgressUiHandlers();
|
||||
|
||||
_currentEmulatedGamePath = path;
|
||||
|
||||
_deviceExitStatus.Reset();
|
||||
|
@ -967,9 +969,6 @@ namespace Ryujinx.Ui
|
|||
|
||||
RendererWidget.Start();
|
||||
|
||||
Ptc.Close();
|
||||
PtcProfiler.Stop();
|
||||
|
||||
_emulationContext.Dispose();
|
||||
_deviceExitStatus.Set();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue