diff --git a/Ryujinx.Ava/AppHost.cs b/Ryujinx.Ava/AppHost.cs index ce9ca594070c..915d42b2fdc5 100644 --- a/Ryujinx.Ava/AppHost.cs +++ b/Ryujinx.Ava/AppHost.cs @@ -2,7 +2,6 @@ using ARMeilleure.Translation.PTC; using Avalonia.Input; using Avalonia.Threading; -using LibHac.FsSystem; using LibHac.Tools.FsSystem; using OpenTK.Windowing.Common; using Ryujinx.Audio.Backends.Dummy; @@ -26,7 +25,6 @@ using Ryujinx.Graphics.Gpu; using Ryujinx.Graphics.OpenGL; using Ryujinx.HLE.FileSystem; -using Ryujinx.HLE.FileSystem.Content; using Ryujinx.HLE.HOS; using Ryujinx.HLE.HOS.Services.Account.Acc; using Ryujinx.HLE.HOS.SystemState; @@ -37,12 +35,9 @@ using SixLabors.ImageSharp.Formats.Png; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; -using SPB.Graphics.OpenGL; -using SPB.Platform.WGL; using System; using System.Diagnostics; using System.IO; -using System.Runtime.InteropServices; using System.Threading; using System.Threading.Tasks; diff --git a/Ryujinx.Ava/Common/SetupValidator.cs b/Ryujinx.Ava/Common/SetupValidator.cs index bc1c959b204d..3cd43a3a2bbc 100644 --- a/Ryujinx.Ava/Common/SetupValidator.cs +++ b/Ryujinx.Ava/Common/SetupValidator.cs @@ -1,5 +1,5 @@ using Ryujinx.Common.Logging; -using Ryujinx.HLE.FileSystem.Content; +using Ryujinx.HLE.FileSystem; using System; using System.IO; diff --git a/Ryujinx.Ava/Ui/Controls/ProfileImageSelectionDialog.axaml.cs b/Ryujinx.Ava/Ui/Controls/ProfileImageSelectionDialog.axaml.cs index a634e8b1b043..0891a51f499e 100644 --- a/Ryujinx.Ava/Ui/Controls/ProfileImageSelectionDialog.axaml.cs +++ b/Ryujinx.Ava/Ui/Controls/ProfileImageSelectionDialog.axaml.cs @@ -3,7 +3,7 @@ using Avalonia.Interactivity; using Avalonia.Markup.Xaml; using Ryujinx.Ava.Ui.Windows; -using Ryujinx.HLE.FileSystem.Content; +using Ryujinx.HLE.FileSystem; using SixLabors.ImageSharp; using SixLabors.ImageSharp.Processing; using System.IO; diff --git a/Ryujinx.Ava/Ui/ViewModels/AvatarProfileViewModel.cs b/Ryujinx.Ava/Ui/ViewModels/AvatarProfileViewModel.cs index ce2d5207772b..f7303392e262 100644 --- a/Ryujinx.Ava/Ui/ViewModels/AvatarProfileViewModel.cs +++ b/Ryujinx.Ava/Ui/ViewModels/AvatarProfileViewModel.cs @@ -4,22 +4,20 @@ using LibHac.Fs; using LibHac.Fs.Fsa; using LibHac.FsSystem; +using LibHac.Ncm; using LibHac.Tools.Fs; using LibHac.Tools.FsSystem; using LibHac.Tools.FsSystem.NcaUtils; using Ryujinx.Ava.Ui.Models; using Ryujinx.HLE.FileSystem; -using Ryujinx.HLE.FileSystem.Content; using SixLabors.ImageSharp; using SixLabors.ImageSharp.Formats.Png; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; -using System; using System.Buffers.Binary; using System.Collections.Generic; using System.Collections.ObjectModel; using System.IO; -using System.Linq; using System.Threading; using System.Threading.Tasks; using Color = Avalonia.Media.Color; @@ -182,7 +180,7 @@ public static void PreloadAvatars(ContentManager contentManager, VirtualFileSyst } string contentPath = - contentManager.GetInstalledContentPath(0x010000000000080A, StorageId.NandSystem, NcaContentType.Data); + contentManager.GetInstalledContentPath(0x010000000000080A, StorageId.BuiltInSystem, NcaContentType.Data); string avatarPath = virtualFileSystem.SwitchPathToSystemPath(contentPath); if (!string.IsNullOrWhiteSpace(avatarPath)) diff --git a/Ryujinx.Ava/Ui/ViewModels/MainWindowViewModel.cs b/Ryujinx.Ava/Ui/ViewModels/MainWindowViewModel.cs index 5c3d74083e80..d3ad3cc818c1 100644 --- a/Ryujinx.Ava/Ui/ViewModels/MainWindowViewModel.cs +++ b/Ryujinx.Ava/Ui/ViewModels/MainWindowViewModel.cs @@ -1,20 +1,17 @@ using ARMeilleure.Translation.PTC; using Avalonia; -using Avalonia.Collections; using Avalonia.Controls; using Avalonia.Input; using Avalonia.Media; using Avalonia.Threading; using DynamicData; using DynamicData.Binding; -using LibHac; using LibHac.Fs; using LibHac.FsSystem; -using LibHac.Tools.FsSystem.NcaUtils; +using LibHac.Ncm; using Ryujinx.Ava.Common; using Ryujinx.Ava.Common.Locale; using Ryujinx.Ava.Ui.Controls; -using Ryujinx.Ava.Ui.Models; using Ryujinx.Ava.Ui.Windows; using Ryujinx.Common; using Ryujinx.Common.Configuration; @@ -22,16 +19,12 @@ using Ryujinx.Configuration; using Ryujinx.HLE; using Ryujinx.HLE.FileSystem; -using Ryujinx.HLE.FileSystem.Content; -using Ryujinx.HLE.HOS; using Ryujinx.Modules; using System; -using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Globalization; using System.IO; -using System.Reactive.Linq; using System.Threading; using System.Threading.Tasks; using Path = System.IO.Path; @@ -869,7 +862,7 @@ public async void SetGridMode() public async void OpenMiiApplet() { - string contentPath = _owner.ContentManager.GetInstalledContentPath(0x0100000000001009, StorageId.NandSystem, NcaContentType.Program); + string contentPath = _owner.ContentManager.GetInstalledContentPath(0x0100000000001009, StorageId.BuiltInSystem, NcaContentType.Program); if (!string.IsNullOrWhiteSpace(contentPath)) { diff --git a/Ryujinx.Ava/Ui/ViewModels/SettingsViewModel.cs b/Ryujinx.Ava/Ui/ViewModels/SettingsViewModel.cs index 1c33d052dd22..b110d5938efb 100644 --- a/Ryujinx.Ava/Ui/ViewModels/SettingsViewModel.cs +++ b/Ryujinx.Ava/Ui/ViewModels/SettingsViewModel.cs @@ -1,7 +1,6 @@ using Avalonia.Collections; using Avalonia.Controls; using Avalonia.Threading; -using LibHac.FsSystem; using LibHac.Tools.FsSystem; using Ryujinx.Audio.Backends.OpenAL; using Ryujinx.Audio.Backends.SDL2; @@ -15,7 +14,6 @@ using Ryujinx.Configuration; using Ryujinx.Configuration.System; using Ryujinx.HLE.FileSystem; -using Ryujinx.HLE.FileSystem.Content; using Ryujinx.HLE.HOS.Services.Time.TimeZone; using System; using System.Collections.Generic; diff --git a/Ryujinx.Ava/Ui/Windows/AvatarWindow.axaml.cs b/Ryujinx.Ava/Ui/Windows/AvatarWindow.axaml.cs index 351de6e5601f..f2da8dd48108 100644 --- a/Ryujinx.Ava/Ui/Windows/AvatarWindow.axaml.cs +++ b/Ryujinx.Ava/Ui/Windows/AvatarWindow.axaml.cs @@ -1,12 +1,8 @@ using Avalonia; -using Avalonia.Controls; using Avalonia.Interactivity; using Avalonia.Markup.Xaml; -using Avalonia.Media; -using FluentAvalonia.UI.Controls; using Ryujinx.Ava.Ui.ViewModels; -using Ryujinx.HLE.FileSystem.Content; -using Ryujinx.HLE.HOS.Services.Account.Acc; +using Ryujinx.HLE.FileSystem; using System; namespace Ryujinx.Ava.Ui.Windows diff --git a/Ryujinx.Ava/Ui/Windows/MainWindow.axaml.cs b/Ryujinx.Ava/Ui/Windows/MainWindow.axaml.cs index 45f4c53b1330..d87e522da247 100644 --- a/Ryujinx.Ava/Ui/Windows/MainWindow.axaml.cs +++ b/Ryujinx.Ava/Ui/Windows/MainWindow.axaml.cs @@ -1,17 +1,11 @@ using Avalonia; -using Avalonia.Collections; using Avalonia.Controls; -using Avalonia.Data; using Avalonia.Input; using Avalonia.Interactivity; -using Avalonia.LogicalTree; using Avalonia.Markup.Xaml; using Avalonia.Media; using Avalonia.Threading; -using Avalonia.VisualTree; using FluentAvalonia.UI.Controls; -using LibHac; -using LibHac.Common; using Ryujinx.Ava.Common; using Ryujinx.Ava.Common.Locale; using Ryujinx.Ava.Ui.Applet; @@ -23,7 +17,6 @@ using Ryujinx.Configuration; using Ryujinx.Graphics.Gpu; using Ryujinx.HLE.FileSystem; -using Ryujinx.HLE.FileSystem.Content; using Ryujinx.HLE.HOS; using Ryujinx.HLE.HOS.Services.Account.Acc; using Ryujinx.Input.Avalonia; @@ -34,7 +27,6 @@ using System.ComponentModel; using System.Diagnostics; using System.IO; -using System.Linq; using System.Threading.Tasks; using InputManager = Ryujinx.Input.HLE.InputManager; using ProgressBar = Avalonia.Controls.ProgressBar; diff --git a/Ryujinx.Ava/Ui/Windows/SettingsWindow.axaml.cs b/Ryujinx.Ava/Ui/Windows/SettingsWindow.axaml.cs index 4e517fc9e8dd..7051d6235e48 100644 --- a/Ryujinx.Ava/Ui/Windows/SettingsWindow.axaml.cs +++ b/Ryujinx.Ava/Ui/Windows/SettingsWindow.axaml.cs @@ -9,7 +9,6 @@ using Ryujinx.Ava.Common.Locale; using Ryujinx.Ava.Ui.ViewModels; using Ryujinx.HLE.FileSystem; -using Ryujinx.HLE.FileSystem.Content; using System; using System.Collections.Generic; using System.Diagnostics; diff --git a/Ryujinx.Ava/Ui/Windows/UserProfileWindow.axaml.cs b/Ryujinx.Ava/Ui/Windows/UserProfileWindow.axaml.cs index a0ee9886925e..326fb4860bdc 100644 --- a/Ryujinx.Ava/Ui/Windows/UserProfileWindow.axaml.cs +++ b/Ryujinx.Ava/Ui/Windows/UserProfileWindow.axaml.cs @@ -4,7 +4,6 @@ using Avalonia.Markup.Xaml; using Ryujinx.Ava.Ui.ViewModels; using Ryujinx.HLE.FileSystem; -using Ryujinx.HLE.FileSystem.Content; using Ryujinx.HLE.HOS.Services.Account.Acc; using System.Threading.Tasks; using UserProfile = Ryujinx.Ava.Ui.Models.UserProfile; diff --git a/Ryujinx.Graphics.OpenGL/Window.cs b/Ryujinx.Graphics.OpenGL/Window.cs index 0bfa71d290bb..55ee68654704 100644 --- a/Ryujinx.Graphics.OpenGL/Window.cs +++ b/Ryujinx.Graphics.OpenGL/Window.cs @@ -46,18 +46,11 @@ public void Present(ITexture texture, ImageCrop crop, Func swapBuffer (int oldDrawFramebufferHandle, int oldReadFramebufferHandle) = ((Pipeline)_renderer.Pipeline).GetBoundFramebuffers(); - CopyTextureToFrameBufferRGB(0, GetCopyFramebufferHandleLazy(), (TextureView)texture, crop, swapBuffersCallback); - - GL.BindFramebuffer(FramebufferTarget.ReadFramebuffer, _stagingFrameBuffer); - - _currentTexture = swapBuffersCallback(_stagingTextures[_currentTexture]) ? ++_currentTexture % _stagingTextures.Length : _currentTexture; + CopyTextureToFrameBufferRGB(_stagingFrameBuffer, GetCopyFramebufferHandleLazy(), (TextureView)texture, crop, swapBuffersCallback); GL.BindFramebuffer(FramebufferTarget.ReadFramebuffer, oldReadFramebufferHandle); GL.BindFramebuffer(FramebufferTarget.DrawFramebuffer, oldDrawFramebufferHandle); - ((Pipeline)_renderer.Pipeline).RestoreScissor0Enable(); - ((Pipeline)_renderer.Pipeline).RestoreRasterizerDiscard(); - GL.Enable(EnableCap.FramebufferSrgb); GL.PixelStore(PixelStoreParameter.UnpackAlignment, 4); @@ -91,7 +84,7 @@ public void SetSize(int width, int height) _sizeChanged = true; } - private void CopyTextureToFrameBufferRGB(int drawFramebuffer, int readFramebuffer, TextureView view, ImageCrop crop, Action swapBuffersCallback) + private void CopyTextureToFrameBufferRGB(int drawFramebuffer, int readFramebuffer, TextureView view, ImageCrop crop, Func swapBuffersCallback) { GL.BindFramebuffer(FramebufferTarget.DrawFramebuffer, drawFramebuffer); GL.BindFramebuffer(FramebufferTarget.ReadFramebuffer, readFramebuffer); @@ -195,7 +188,9 @@ private void CopyTextureToFrameBufferRGB(int drawFramebuffer, int readFramebuffe GL.Viewport(0, 0, _width, _height); GL.BindFramebuffer(FramebufferTarget.Framebuffer, drawFramebuffer); - swapBuffersCallback(); + GL.BindFramebuffer(FramebufferTarget.ReadFramebuffer, _stagingFrameBuffer); + + _currentTexture = swapBuffersCallback(_stagingTextures[_currentTexture]) ? ++_currentTexture % _stagingTextures.Length : _currentTexture; ((Pipeline)_renderer.Pipeline).RestoreClipControl(); ((Pipeline)_renderer.Pipeline).RestoreScissor0Enable();