From 3e69d066f5e9ad0a1097d806c656035398bbb7bc Mon Sep 17 00:00:00 2001 From: Michael Maltese Date: Sun, 16 Oct 2016 13:39:05 -0700 Subject: ControllerInterface: replace Reinitialize with RefreshDevices The SDL backend crashes when you close a joystick after SDL_Quit has been called. Some backends don't need to be shutdown and re-initialized everytime, we can just ask to enumerate devices again. --- Source/Core/InputCommon/ControllerInterface/XInput/XInput.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Source/Core/InputCommon/ControllerInterface/XInput/XInput.cpp') diff --git a/Source/Core/InputCommon/ControllerInterface/XInput/XInput.cpp b/Source/Core/InputCommon/ControllerInterface/XInput/XInput.cpp index d39b0b8e1e..3d8650820e 100644 --- a/Source/Core/InputCommon/ControllerInterface/XInput/XInput.cpp +++ b/Source/Core/InputCommon/ControllerInterface/XInput/XInput.cpp @@ -85,6 +85,12 @@ void Init() return; } } +} + +void PopulateDevices() +{ + if (!hXInput) + return; XINPUT_CAPABILITIES caps; for (int i = 0; i != 4; ++i) -- cgit v1.2.3