summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorGlenn Rice <glennricster@gmail.com>2011-02-25 21:14:13 +0000
committerGlenn Rice <glennricster@gmail.com>2011-02-25 21:14:13 +0000
commit992f8be5b0ac4c391e50bb2e18cb2f7df1b7dd26 (patch)
treea479a4613d4fea10126c174bdc0502ae9680b719 /Source/Core
parenteef715b1cf8730174777000f94252d9adf92332b (diff)
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
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Common/Src/VideoBackendBase.h2
-rw-r--r--Source/Core/Core/Src/BootManager.cpp1
-rw-r--r--Source/Core/Core/Src/Core.cpp15
-rw-r--r--Source/Core/Core/Src/CoreParameter.cpp2
-rw-r--r--Source/Core/Core/Src/CoreParameter.h3
5 files changed, 11 insertions, 12 deletions
diff --git a/Source/Core/Common/Src/VideoBackendBase.h b/Source/Core/Common/Src/VideoBackendBase.h
index c72a8a2cc9..e18e2a6acd 100644
--- a/Source/Core/Common/Src/VideoBackendBase.h
+++ b/Source/Core/Common/Src/VideoBackendBase.h
@@ -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;
diff --git a/Source/Core/Core/Src/BootManager.cpp b/Source/Core/Core/Src/BootManager.cpp
index 80a6127c56..e857ad82ca 100644
--- a/Source/Core/Core/Src/BootManager.cpp
+++ b/Source/Core/Core/Src/BootManager.cpp
@@ -120,7 +120,6 @@ bool BootCore(const std::string& _rFilename)
}
// Run the game
- StartUp.hMainWindow = Host_GetRenderHandle();
// Init the core
if (!Core::Init())
{
diff --git a/Source/Core/Core/Src/Core.cpp b/Source/Core/Core/Src/Core.cpp
index cca835751d..6f8b0a38df 100644
--- a/Source/Core/Core/Src/Core.cpp
+++ b/Source/Core/Core/Src/Core.cpp
@@ -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,
diff --git a/Source/Core/Core/Src/CoreParameter.cpp b/Source/Core/Core/Src/CoreParameter.cpp
index ec32a13ac0..986476815f 100644
--- a/Source/Core/Core/Src/CoreParameter.cpp
+++ b/Source/Core/Core/Src/CoreParameter.cpp
@@ -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),
diff --git a/Source/Core/Core/Src/CoreParameter.h b/Source/Core/Core/Src/CoreParameter.h
index 2faba2f78e..188ec63a10 100644
--- a/Source/Core/Core/Src/CoreParameter.h
+++ b/Source/Core/Core/Src/CoreParameter.h
@@ -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;