From 6fca4492d04827df53a70984c43a1f29f8774423 Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Sat, 18 Jan 2025 15:15:08 -0600 Subject: [PATCH] misc: chore: Remove status update event stuff in Headless --- .../Headless/StatusUpdatedEventArgs.cs | 21 ------------------ src/Ryujinx/Headless/Windows/WindowBase.cs | 22 +++---------------- .../UI/Models/StatusUpdatedEventArgs.cs | 17 ++++++++++++++ 3 files changed, 20 insertions(+), 40 deletions(-) delete mode 100644 src/Ryujinx/Headless/StatusUpdatedEventArgs.cs diff --git a/src/Ryujinx/Headless/StatusUpdatedEventArgs.cs b/src/Ryujinx/Headless/StatusUpdatedEventArgs.cs deleted file mode 100644 index 6c76a43a1..000000000 --- a/src/Ryujinx/Headless/StatusUpdatedEventArgs.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; - -namespace Ryujinx.Headless -{ - class StatusUpdatedEventArgs( - string vSyncMode, - string dockedMode, - string aspectRatio, - string gameStatus, - string fifoStatus, - string gpuName) - : EventArgs - { - public string VSyncMode = vSyncMode; - public string DockedMode = dockedMode; - public string AspectRatio = aspectRatio; - public string GameStatus = gameStatus; - public string FifoStatus = fifoStatus; - public string GpuName = gpuName; - } -} diff --git a/src/Ryujinx/Headless/Windows/WindowBase.cs b/src/Ryujinx/Headless/Windows/WindowBase.cs index eea01763a..2ce8ad82b 100644 --- a/src/Ryujinx/Headless/Windows/WindowBase.cs +++ b/src/Ryujinx/Headless/Windows/WindowBase.cs @@ -1,13 +1,12 @@ using Humanizer; -using LibHac.Tools.Fs; using Ryujinx.Ava; +using Ryujinx.Ava.UI.Models; using Ryujinx.Common; using Ryujinx.Common.Configuration; using Ryujinx.Common.Configuration.Hid; using Ryujinx.Common.Logging; using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.GAL.Multithreading; -using Ryujinx.Graphics.Gpu; using Ryujinx.Graphics.OpenGL; using Ryujinx.HLE.HOS.Applets; using Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.ApplicationProxy.Types; @@ -54,8 +53,6 @@ namespace Ryujinx.Headless public Switch Device { get; private set; } public IRenderer Renderer { get; private set; } - public event EventHandler StatusUpdatedEvent; - protected nint WindowHandle { get; set; } public IHostUITheme HostUITheme { get; } @@ -164,6 +161,8 @@ namespace Ryujinx.Headless } } + private StatusUpdatedEventArgs _lastStatus; + private void InitializeWindow() { var activeProcess = Device.Processes.ActiveApplication; @@ -309,21 +308,6 @@ namespace Ryujinx.Headless if (_ticks >= _ticksPerFrame) { - string dockedMode = Device.System.State.DockedMode ? "Docked" : "Handheld"; - float scale = GraphicsConfig.ResScale; - if (scale != 1) - { - dockedMode += $" ({scale}x)"; - } - - StatusUpdatedEvent?.Invoke(this, new StatusUpdatedEventArgs( - Device.VSyncMode.ToString(), - dockedMode, - Device.Configuration.AspectRatio.ToText(), - $"{Device.Statistics.GetGameFrameRate():00.00} FPS ({Device.Statistics.GetGameFrameTime():00.00} ms)", - $"FIFO: {Device.Statistics.GetFifoPercent():0.00} %", - $"GPU: {_gpuDriverName}")); - _ticks = Math.Min(_ticks - _ticksPerFrame, _ticksPerFrame); } } diff --git a/src/Ryujinx/UI/Models/StatusUpdatedEventArgs.cs b/src/Ryujinx/UI/Models/StatusUpdatedEventArgs.cs index 6f0f5ab5d..9755aad46 100644 --- a/src/Ryujinx/UI/Models/StatusUpdatedEventArgs.cs +++ b/src/Ryujinx/UI/Models/StatusUpdatedEventArgs.cs @@ -22,5 +22,22 @@ namespace Ryujinx.Ava.UI.Models FifoStatus = fifoStatus; ShaderCount = shaderCount; } + + + public override bool Equals(object obj) + { + if (obj is not StatusUpdatedEventArgs suea) return false; + return + VSyncMode == suea.VSyncMode && + VolumeStatus == suea.VolumeStatus && + DockedMode == suea.DockedMode && + AspectRatio == suea.AspectRatio && + GameStatus == suea.GameStatus && + FifoStatus == suea.FifoStatus && + ShaderCount == suea.ShaderCount; + } + + public override int GetHashCode() + => HashCode.Combine(VSyncMode, VolumeStatus, AspectRatio, DockedMode, FifoStatus, GameStatus, ShaderCount); } }