mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
If video backend initialization fails, have the emulator die gracefully instead of crashing the application. Also a little clean up of the passage of the video window handle to the backend and back.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7248 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -86,7 +86,7 @@ public:
|
||||
|
||||
virtual unsigned int PeekMessages() = 0;
|
||||
|
||||
virtual void Initialize() = 0;
|
||||
virtual bool Initialize(void *&) = 0;
|
||||
virtual void Shutdown() = 0;
|
||||
|
||||
virtual void DoState(PointerWrap &p) = 0;
|
||||
|
@ -120,7 +120,6 @@ bool BootCore(const std::string& _rFilename)
|
||||
}
|
||||
|
||||
// Run the game
|
||||
StartUp.hMainWindow = Host_GetRenderHandle();
|
||||
// Init the core
|
||||
if (!Core::Init())
|
||||
{
|
||||
|
@ -215,13 +215,16 @@ bool Init()
|
||||
GetData<u8>("IPL.AR"));
|
||||
}
|
||||
|
||||
// _CoreParameter.hMainWindow is first the m_Panel handle,
|
||||
// then it is updated to have the new window handle,
|
||||
// g_pWindowHandle is first the m_Panel handle,
|
||||
// then it is updated to the render window handle,
|
||||
// within g_video_backend->Initialize()
|
||||
// TODO: that's ugly, change Initialize() to take m_Panel
|
||||
// and return the new window handle
|
||||
g_video_backend->Initialize();
|
||||
g_pWindowHandle = _CoreParameter.hMainWindow;
|
||||
g_pWindowHandle = Host_GetRenderHandle();
|
||||
if (!g_video_backend->Initialize(g_pWindowHandle))
|
||||
{
|
||||
emuThreadGoing.Shutdown();
|
||||
Host_SetWaitCursor(false);
|
||||
return false;
|
||||
}
|
||||
|
||||
HW::Init();
|
||||
DSP::GetDSPEmulator()->Initialize(g_pWindowHandle,
|
||||
|
@ -31,7 +31,7 @@
|
||||
#include "Core.h" // for bWii
|
||||
|
||||
SCoreStartupParameter::SCoreStartupParameter()
|
||||
: hInstance(0), hMainWindow(0),
|
||||
: hInstance(0),
|
||||
bJITNoBlockCache(false), bJITBlockLinking(true),
|
||||
bJITOff(false),
|
||||
bJITLoadStoreOff(false), bJITLoadStorelXzOff(false),
|
||||
|
@ -69,9 +69,6 @@ struct SCoreStartupParameter
|
||||
{
|
||||
void* hInstance; // HINSTANCE but we don't want to include <windows.h>
|
||||
|
||||
// Windows/GUI related
|
||||
void* hMainWindow;
|
||||
|
||||
// Settings
|
||||
bool bEnableDebugging;
|
||||
bool bAutomaticStart;
|
||||
|
Reference in New Issue
Block a user