diff options
| author | Thog <me@thog.eu> | 2020-01-21 23:23:11 +0100 |
|---|---|---|
| committer | Ac_K <Acoustik666@gmail.com> | 2020-01-21 23:23:11 +0100 |
| commit | d6b9babe1d73a78e963455a5a6ea3e7431a44ece (patch) | |
| tree | 625db9119d8ecc2a9a1858f357b597fb216dfef7 /Ryujinx.HLE/HOS/Font | |
| parent | b4b2b8b162cd942d399f3420ea064bee14f5411e (diff) | |
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
Diffstat (limited to 'Ryujinx.HLE/HOS/Font')
| -rw-r--r-- | Ryujinx.HLE/HOS/Font/SharedFontManager.cs | 16 |
1 files changed, 7 insertions, 9 deletions
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<SharedFontType, FontInfo> @@ -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; } |
