summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface/XInput
diff options
context:
space:
mode:
authorMichael Maltese <michaeljosephmaltese@gmail.com>2016-10-16 13:39:05 -0700
committerMichael Maltese <michaeljosephmaltese@gmail.com>2016-11-30 16:07:55 -0800
commit3e69d066f5e9ad0a1097d806c656035398bbb7bc (patch)
treedd7ab461e209f81876a2b2145a5595812512eb6c /Source/Core/InputCommon/ControllerInterface/XInput
parentcebb4d84f2a8021a5df2ff2a9d31eba16e1cb5e5 (diff)
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.
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/XInput')
-rw-r--r--Source/Core/InputCommon/ControllerInterface/XInput/XInput.cpp6
-rw-r--r--Source/Core/InputCommon/ControllerInterface/XInput/XInput.h1
2 files changed, 7 insertions, 0 deletions
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)
diff --git a/Source/Core/InputCommon/ControllerInterface/XInput/XInput.h b/Source/Core/InputCommon/ControllerInterface/XInput/XInput.h
index 0dda9a93da..52530e9a00 100644
--- a/Source/Core/InputCommon/ControllerInterface/XInput/XInput.h
+++ b/Source/Core/InputCommon/ControllerInterface/XInput/XInput.h
@@ -23,6 +23,7 @@ namespace ciface
namespace XInput
{
void Init();
+void PopulateDevices();
void DeInit();
class Device : public Core::Device