mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-28 16:49:58 -06:00
HW: Don't be responsible for g_controller_interface
Currently, `g_controller_interface` is initialized and shut down by each of `GCKeyboard`, `GCPad`, `Wiimote`, and `HotkeyManager`. This 1) is weird conceptually, because it necessitates passing a pointer to the native window to each of those classes, which don't need it, and 2) can cause issues when controller backends are initialized or shutdown multiple times in succession.
This commit is contained in:
@ -182,12 +182,11 @@ bool IsPressed(int Id, bool held)
|
||||
return false;
|
||||
}
|
||||
|
||||
void Initialize(void* const hwnd)
|
||||
void Initialize()
|
||||
{
|
||||
if (s_config.ControllersNeedToBeCreated())
|
||||
s_config.CreateController<HotkeyManager>();
|
||||
|
||||
g_controller_interface.Initialize(hwnd);
|
||||
g_controller_interface.RegisterHotplugCallback(LoadConfig);
|
||||
|
||||
// load the saved controller config
|
||||
@ -207,8 +206,6 @@ void LoadConfig()
|
||||
void Shutdown()
|
||||
{
|
||||
s_config.ClearControllers();
|
||||
|
||||
g_controller_interface.Shutdown();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user