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:
Glenn Rice
2011-02-25 21:14:13 +00:00
parent eef715b1cf
commit 992f8be5b0
17 changed files with 53 additions and 96 deletions

View File

@ -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;

View File

@ -120,7 +120,6 @@ bool BootCore(const std::string& _rFilename)
}
// Run the game
StartUp.hMainWindow = Host_GetRenderHandle();
// Init the core
if (!Core::Init())
{

View File

@ -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,

View File

@ -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),

View File

@ -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;