From d6b9babe1d73a78e963455a5a6ea3e7431a44ece Mon Sep 17 00:00:00 2001 From: Thog Date: Tue, 21 Jan 2020 23:23:11 +0100 Subject: Keep the GUI alive when closing a game (#888) * Keep the GUI alive when closing a game Make HLE.Switch init when starting a game and dispose it when closing the GlScreen. This also make HLE in charge of disposing the audio and gpu backend. * Address Ac_k's comments * Make sure to dispose the Discord module and use GTK quit method Also update Discord Precense when closing a game. * Make sure to dispose MainWindow * Address gdk's comments --- Ryujinx.HLE/HOS/Font/SharedFontManager.cs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'Ryujinx.HLE/HOS/Font') diff --git a/Ryujinx.HLE/HOS/Font/SharedFontManager.cs b/Ryujinx.HLE/HOS/Font/SharedFontManager.cs index e126cd57..c54c8194 100644 --- a/Ryujinx.HLE/HOS/Font/SharedFontManager.cs +++ b/Ryujinx.HLE/HOS/Font/SharedFontManager.cs @@ -44,15 +44,15 @@ namespace Ryujinx.HLE.HOS.Font _fontsPath = Path.Combine(device.FileSystem.GetSystemPath(), "fonts"); } - public void Initialize(ContentManager contentManager, bool ignoreMissingFonts) + public void Initialize(ContentManager contentManager) { _fontData?.Clear(); _fontData = null; - EnsureInitialized(contentManager, ignoreMissingFonts); + EnsureInitialized(contentManager); } - public void EnsureInitialized(ContentManager contentManager, bool ignoreMissingFonts) + public void EnsureInitialized(ContentManager contentManager) { if (_fontData == null) { @@ -120,12 +120,10 @@ namespace Ryujinx.HLE.HOS.Font return info; } - else if (!ignoreMissingFonts) + else { throw new InvalidSystemResourceException($"Font \"{name}.ttf\" not found. Please provide it in \"{_fontsPath}\"."); } - - return new FontInfo(); } _fontData = new Dictionary @@ -138,7 +136,7 @@ namespace Ryujinx.HLE.HOS.Font { SharedFontType.NintendoEx, CreateFont("FontNintendoExtended") } }; - if (fontOffset > Horizon.FontSize && !ignoreMissingFonts) + if (fontOffset > Horizon.FontSize) { throw new InvalidSystemResourceException( $"The sum of all fonts size exceed the shared memory size. " + @@ -161,14 +159,14 @@ namespace Ryujinx.HLE.HOS.Font public int GetFontSize(SharedFontType fontType) { - EnsureInitialized(_device.System.ContentManager, false); + EnsureInitialized(_device.System.ContentManager); return _fontData[fontType].Size; } public int GetSharedMemoryAddressOffset(SharedFontType fontType) { - EnsureInitialized(_device.System.ContentManager, false); + EnsureInitialized(_device.System.ContentManager); return _fontData[fontType].Offset + 8; } -- cgit v1.2.3