mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-09-26 04:11:54 -05:00
Initialised all controller interfaces together on CFrame construction to fix the crash that would occur if the controller config were opened before a game was started.
This commit is contained in:
@@ -361,8 +361,13 @@ void EmuThread()
|
||||
return;
|
||||
}
|
||||
|
||||
Keyboard::Initialize(s_window_handle);
|
||||
Pad::Initialize(s_window_handle);
|
||||
bool init_controllers = false;
|
||||
if (!g_controller_interface.IsInit())
|
||||
{
|
||||
Pad::Initialize(s_window_handle);
|
||||
Keyboard::Initialize(s_window_handle);
|
||||
init_controllers = true;
|
||||
}
|
||||
|
||||
// Load and Init Wiimotes - only if we are booting in Wii mode
|
||||
if (core_parameter.bWii)
|
||||
@@ -481,8 +486,12 @@ void EmuThread()
|
||||
|
||||
Wiimote::Shutdown();
|
||||
|
||||
Keyboard::Shutdown();
|
||||
Pad::Shutdown();
|
||||
if (init_controllers)
|
||||
{
|
||||
Keyboard::Shutdown();
|
||||
Pad::Shutdown();
|
||||
init_controllers = false;
|
||||
}
|
||||
|
||||
g_video_backend->Shutdown();
|
||||
AudioCommon::ShutdownSoundStream();
|
||||
|
||||
@@ -35,8 +35,9 @@ void Shutdown()
|
||||
// if plugin isn't initialized, init and load config
|
||||
void Initialize(void* const hwnd)
|
||||
{
|
||||
for (unsigned int i=0; i<4; ++i)
|
||||
s_config.controllers.push_back(new GCKeyboard(i));
|
||||
if (s_config.controllers.empty())
|
||||
for (unsigned int i = 0; i < 4; ++i)
|
||||
s_config.controllers.push_back(new GCKeyboard(i));
|
||||
|
||||
g_controller_interface.Initialize(hwnd);
|
||||
|
||||
|
||||
@@ -36,8 +36,9 @@ void Shutdown()
|
||||
void Initialize(void* const hwnd)
|
||||
{
|
||||
// add 4 gcpads
|
||||
for (unsigned int i=0; i<4; ++i)
|
||||
s_config.controllers.push_back(new GCPad(i));
|
||||
if (s_config.controllers.empty())
|
||||
for (unsigned int i = 0; i < 4; ++i)
|
||||
s_config.controllers.push_back(new GCPad(i));
|
||||
|
||||
g_controller_interface.Initialize(hwnd);
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ const std::string hotkey_labels[] =
|
||||
_trans("Change Disc"),
|
||||
_trans("Refresh List"),
|
||||
|
||||
_trans("Play/Pause"),
|
||||
_trans("Toggle Pause"),
|
||||
_trans("Stop"),
|
||||
_trans("Reset"),
|
||||
_trans("Frame Advance"),
|
||||
@@ -205,7 +205,8 @@ bool IsPressed(int Id, bool held)
|
||||
|
||||
void Initialize(void* const hwnd)
|
||||
{
|
||||
s_config.controllers.push_back(new HotkeyManager());
|
||||
if (s_config.controllers.empty())
|
||||
s_config.controllers.push_back(new HotkeyManager());
|
||||
|
||||
g_controller_interface.Initialize(hwnd);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user