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:
Michael Maltese
2016-10-11 12:54:35 -07:00
parent 183f3c3759
commit a082e9324f
10 changed files with 24 additions and 36 deletions

View File

@ -23,11 +23,9 @@ InputConfig* GetConfig()
void Shutdown()
{
s_config.ClearControllers();
g_controller_interface.Shutdown();
}
void Initialize(void* const hwnd)
void Initialize()
{
if (s_config.ControllersNeedToBeCreated())
{
@ -35,7 +33,6 @@ void Initialize(void* const hwnd)
s_config.CreateController<GCKeyboard>(i);
}
g_controller_interface.Initialize(hwnd);
g_controller_interface.RegisterHotplugCallback(LoadConfig);
// Load the saved controller config