From 2b41a15941c472d3753d3ef029f89370ae903f76 Mon Sep 17 00:00:00 2001 From: Sour Date: Sun, 8 Jul 2018 20:22:21 -0400 Subject: [PATCH] UI: Fixed oversized font when starting emulator --- GUI.NET/Forms/frmMain.cs | 3 ++- GUI.NET/InteropEmu.cs | 1 + InteropDLL/ConsoleWrapper.cpp | 8 ++++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/GUI.NET/Forms/frmMain.cs b/GUI.NET/Forms/frmMain.cs index 8445f8de..c7222911 100644 --- a/GUI.NET/Forms/frmMain.cs +++ b/GUI.NET/Forms/frmMain.cs @@ -151,7 +151,7 @@ namespace Mesen.GUI.Forms #if HIDETESTMENU mnuTests.Visible = false; #endif - InitializeCore(); + InteropEmu.InitDll(); _notifListener = new InteropEmu.NotificationListener(InteropEmu.ConsoleId.Master); _notifListener.OnNotification += _notifListener_OnNotification; @@ -171,6 +171,7 @@ namespace Mesen.GUI.Forms UpdateVideoSettings(); + InitializeCore(); PerformUpgrade(); InitializeEmu(); diff --git a/GUI.NET/InteropEmu.cs b/GUI.NET/InteropEmu.cs index 74c145f9..39017925 100644 --- a/GUI.NET/InteropEmu.cs +++ b/GUI.NET/InteropEmu.cs @@ -16,6 +16,7 @@ namespace Mesen.GUI { private const string DLLPath = "MesenCore.dll"; [DllImport(DLLPath)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool TestDll(); + [DllImport(DLLPath)] public static extern void InitDll(); [DllImport(DLLPath, EntryPoint = "GetMesenVersion")] private static extern UInt32 GetMesenVersionWrapper(); diff --git a/InteropDLL/ConsoleWrapper.cpp b/InteropDLL/ConsoleWrapper.cpp index 89a62ad7..2a841227 100644 --- a/InteropDLL/ConsoleWrapper.cpp +++ b/InteropDLL/ConsoleWrapper.cpp @@ -114,11 +114,15 @@ namespace InteropEmu { DllExport uint32_t __stdcall GetMesenVersion() { return EmulationSettings::GetMesenVersion(); } + DllExport void __stdcall InitDll() + { + _console.reset(new Console()); + _console->Init(); + } + DllExport void __stdcall InitializeEmu(const char* homeFolder, void *windowHandle, void *viewerHandle, bool noAudio, bool noVideo, bool noInput) { FolderUtilities::SetHomeFolder(homeFolder); - _console.reset(new Console()); - _console->Init(); _shortcutKeyHandler.reset(new ShortcutKeyHandler(_console)); if(windowHandle != nullptr && viewerHandle != nullptr) {