mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Merge pull request #9667 from unknownbrackets/win-host
Windows: Initialize WindowsHost in EmuThread
This commit is contained in:
commit
032e21b707
5 changed files with 17 additions and 20 deletions
|
@ -20,7 +20,7 @@
|
||||||
#include "Core/Host.h"
|
#include "Core/Host.h"
|
||||||
#include "Core/Debugger/SymbolMap.h"
|
#include "Core/Debugger/SymbolMap.h"
|
||||||
|
|
||||||
Host *host;
|
Host *host = nullptr;
|
||||||
|
|
||||||
bool Host::AttemptLoadSymbolMap() {
|
bool Host::AttemptLoadSymbolMap() {
|
||||||
g_symbolMap->Clear();
|
g_symbolMap->Clear();
|
||||||
|
|
|
@ -330,7 +330,7 @@ void NativeInit(int argc, const char *argv[], const char *savegame_dir, const ch
|
||||||
VFSRegister("", new DirectoryAssetReader("assets/"));
|
VFSRegister("", new DirectoryAssetReader("assets/"));
|
||||||
VFSRegister("", new DirectoryAssetReader(savegame_dir));
|
VFSRegister("", new DirectoryAssetReader(savegame_dir));
|
||||||
|
|
||||||
#if (defined(MOBILE_DEVICE) || !defined(USING_QT_UI)) && !PPSSPP_PLATFORM(WINDOWS)
|
#if (defined(MOBILE_DEVICE) || !defined(USING_QT_UI)) && !PPSSPP_PLATFORM(UWP)
|
||||||
if (host == nullptr) {
|
if (host == nullptr) {
|
||||||
host = new NativeHost();
|
host = new NativeHost();
|
||||||
}
|
}
|
||||||
|
@ -1087,7 +1087,7 @@ void NativeShutdown() {
|
||||||
gl_lost_manager_shutdown();
|
gl_lost_manager_shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !PPSSPP_PLATFORM(WINDOWS)
|
#if !PPSSPP_PLATFORM(UWP)
|
||||||
delete host;
|
delete host;
|
||||||
host = nullptr;
|
host = nullptr;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -8,11 +8,12 @@
|
||||||
|
|
||||||
#include "Common/Log.h"
|
#include "Common/Log.h"
|
||||||
#include "Common/StringUtils.h"
|
#include "Common/StringUtils.h"
|
||||||
#include "../Globals.h"
|
#include "Globals.h"
|
||||||
#include "Windows/EmuThread.h"
|
#include "Windows/EmuThread.h"
|
||||||
#include "Windows/W32Util/Misc.h"
|
#include "Windows/W32Util/Misc.h"
|
||||||
#include "Windows/MainWindow.h"
|
#include "Windows/MainWindow.h"
|
||||||
#include "Windows/resource.h"
|
#include "Windows/resource.h"
|
||||||
|
#include "Windows/WindowsHost.h"
|
||||||
#include "Core/Reporting.h"
|
#include "Core/Reporting.h"
|
||||||
#include "Core/MemMap.h"
|
#include "Core/MemMap.h"
|
||||||
#include "Core/Core.h"
|
#include "Core/Core.h"
|
||||||
|
@ -91,6 +92,9 @@ unsigned int WINAPI TheThread(void *)
|
||||||
|
|
||||||
setCurrentThreadName("Emu"); // And graphics...
|
setCurrentThreadName("Emu"); // And graphics...
|
||||||
|
|
||||||
|
host = new WindowsHost(MainWindow::GetHInstance(), MainWindow::GetHWND(), MainWindow::GetDisplayHWND());
|
||||||
|
host->SetWindowTitle(nullptr);
|
||||||
|
|
||||||
// Convert the command-line arguments to Unicode, then to proper UTF-8
|
// Convert the command-line arguments to Unicode, then to proper UTF-8
|
||||||
// (the benefit being that we don't have to pollute the UI project with win32 ifdefs and lots of Convert<whatever>To<whatever>).
|
// (the benefit being that we don't have to pollute the UI project with win32 ifdefs and lots of Convert<whatever>To<whatever>).
|
||||||
// This avoids issues with PPSSPP inadvertently destroying paths with Unicode glyphs
|
// This avoids issues with PPSSPP inadvertently destroying paths with Unicode glyphs
|
||||||
|
|
|
@ -26,7 +26,8 @@
|
||||||
#include "Common/OSVersion.h"
|
#include "Common/OSVersion.h"
|
||||||
|
|
||||||
#include <Windowsx.h>
|
#include <Windowsx.h>
|
||||||
|
#include <shellapi.h>
|
||||||
|
#include <commctrl.h>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
@ -34,8 +35,6 @@
|
||||||
#include "base/NativeApp.h"
|
#include "base/NativeApp.h"
|
||||||
#include "Globals.h"
|
#include "Globals.h"
|
||||||
|
|
||||||
#include "shellapi.h"
|
|
||||||
#include "commctrl.h"
|
|
||||||
#include "base/timeutil.h"
|
#include "base/timeutil.h"
|
||||||
#include "i18n/i18n.h"
|
#include "i18n/i18n.h"
|
||||||
#include "input/input_state.h"
|
#include "input/input_state.h"
|
||||||
|
@ -43,25 +42,23 @@
|
||||||
#include "thread/threadutil.h"
|
#include "thread/threadutil.h"
|
||||||
#include "util/text/utf8.h"
|
#include "util/text/utf8.h"
|
||||||
|
|
||||||
|
#include "Core/Core.h"
|
||||||
#include "Core/Config.h"
|
#include "Core/Config.h"
|
||||||
#include "Core/Debugger/SymbolMap.h"
|
#include "Core/Debugger/SymbolMap.h"
|
||||||
|
#include "Core/MIPS/JitCommon/JitCommon.h"
|
||||||
|
#include "Core/MIPS/JitCommon/JitBlockCache.h"
|
||||||
#include "Windows/InputBox.h"
|
#include "Windows/InputBox.h"
|
||||||
|
#include "Windows/InputDevice.h"
|
||||||
#include "Windows/GPU/WindowsGLContext.h"
|
#include "Windows/GPU/WindowsGLContext.h"
|
||||||
#include "Windows/Debugger/Debugger_Disasm.h"
|
#include "Windows/Debugger/Debugger_Disasm.h"
|
||||||
#include "Windows/Debugger/Debugger_MemoryDlg.h"
|
#include "Windows/Debugger/Debugger_MemoryDlg.h"
|
||||||
#include "Windows/GEDebugger/GEDebugger.h"
|
#include "Windows/GEDebugger/GEDebugger.h"
|
||||||
#include "Core/MIPS/JitCommon/JitCommon.h"
|
|
||||||
#include "Core/MIPS/JitCommon/JitBlockCache.h"
|
|
||||||
|
|
||||||
#include "main.h"
|
#include "Windows/main.h"
|
||||||
|
|
||||||
#include "Core/Core.h"
|
|
||||||
#include "Windows/EmuThread.h"
|
#include "Windows/EmuThread.h"
|
||||||
|
#include "Windows/resource.h"
|
||||||
#include "resource.h"
|
|
||||||
|
|
||||||
#include "Windows/MainWindow.h"
|
#include "Windows/MainWindow.h"
|
||||||
#include "Windows/WindowsHost.h"
|
|
||||||
#include "Common/LogManager.h"
|
#include "Common/LogManager.h"
|
||||||
#include "Common/ConsoleListener.h"
|
#include "Common/ConsoleListener.h"
|
||||||
#include "Windows/W32Util/DialogManager.h"
|
#include "Windows/W32Util/DialogManager.h"
|
||||||
|
@ -69,9 +66,9 @@
|
||||||
#include "Windows/W32Util/Misc.h"
|
#include "Windows/W32Util/Misc.h"
|
||||||
#include "Windows/RawInput.h"
|
#include "Windows/RawInput.h"
|
||||||
#include "Windows/TouchInputHandler.h"
|
#include "Windows/TouchInputHandler.h"
|
||||||
|
#include "Windows/MainWindowMenu.h"
|
||||||
#include "GPU/GPUInterface.h"
|
#include "GPU/GPUInterface.h"
|
||||||
#include "UI/OnScreenDisplay.h"
|
#include "UI/OnScreenDisplay.h"
|
||||||
#include "Windows/MainWindowMenu.h"
|
|
||||||
#include "UI/GameSettingsScreen.h"
|
#include "UI/GameSettingsScreen.h"
|
||||||
|
|
||||||
#define MOUSEEVENTF_FROMTOUCH_NOPEN 0xFF515780 //http://msdn.microsoft.com/en-us/library/windows/desktop/ms703320(v=vs.85).aspx
|
#define MOUSEEVENTF_FROMTOUCH_NOPEN 0xFF515780 //http://msdn.microsoft.com/en-us/library/windows/desktop/ms703320(v=vs.85).aspx
|
||||||
|
|
|
@ -504,9 +504,6 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin
|
||||||
|
|
||||||
DialogManager::AddDlg(vfpudlg = new CVFPUDlg(_hInstance, hwndMain, currentDebugMIPS));
|
DialogManager::AddDlg(vfpudlg = new CVFPUDlg(_hInstance, hwndMain, currentDebugMIPS));
|
||||||
|
|
||||||
host = new WindowsHost(_hInstance, hwndMain, hwndDisplay);
|
|
||||||
host->SetWindowTitle(nullptr);
|
|
||||||
|
|
||||||
MainWindow::CreateDebugWindows();
|
MainWindow::CreateDebugWindows();
|
||||||
|
|
||||||
const bool minimized = iCmdShow == SW_MINIMIZE || iCmdShow == SW_SHOWMINIMIZED || iCmdShow == SW_SHOWMINNOACTIVE;
|
const bool minimized = iCmdShow == SW_MINIMIZE || iCmdShow == SW_SHOWMINIMIZED || iCmdShow == SW_SHOWMINNOACTIVE;
|
||||||
|
@ -575,7 +572,6 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin
|
||||||
MainWindow::DestroyDebugWindows();
|
MainWindow::DestroyDebugWindows();
|
||||||
DialogManager::DestroyAll();
|
DialogManager::DestroyAll();
|
||||||
timeEndPeriod(1);
|
timeEndPeriod(1);
|
||||||
delete host;
|
|
||||||
|
|
||||||
LogManager::Shutdown();
|
LogManager::Shutdown();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue