summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp
diff options
context:
space:
mode:
authorLéo Lam <leo@innovatetechnologi.es>2016-06-12 17:08:04 +0200
committerLéo Lam <leo@innovatetechnologi.es>2016-06-25 13:46:53 +0200
commitfd29e5c4cc26cd853a03ac7b0e08b367b7070c84 (patch)
tree5fdf3f210fc09344c829d1fa4b63baa4a423d97e /Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp
parent8a1bbaa56382b1bca3b95d79c716fc377c78e591 (diff)
ControllerInterface: Don't pass m_devices to the backends
Previously, the devices vector would be passed to all backends. They would then manually push_back to it to add new devices. This was fine but caused issues when trying to add synchronisation. Instead, backends now call AddDevice() to fill m_devices so that it is not accessible from the outside.
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp')
-rw-r--r--Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp
index 55643ece5f..c139d3b787 100644
--- a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp
+++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp
@@ -55,31 +55,31 @@ void ControllerInterface::Initialize(void* const hwnd)
m_hwnd = hwnd;
#ifdef CIFACE_USE_DINPUT
- ciface::DInput::Init(m_devices, (HWND)hwnd);
+ ciface::DInput::Init((HWND)hwnd);
#endif
#ifdef CIFACE_USE_XINPUT
- ciface::XInput::Init(m_devices);
+ ciface::XInput::Init();
#endif
#ifdef CIFACE_USE_XLIB
- ciface::Xlib::Init(m_devices, hwnd);
+ ciface::Xlib::Init(hwnd);
#ifdef CIFACE_USE_X11_XINPUT2
- ciface::XInput2::Init(m_devices, hwnd);
+ ciface::XInput2::Init(hwnd);
#endif
#endif
#ifdef CIFACE_USE_OSX
- ciface::OSX::Init(m_devices, hwnd);
+ ciface::OSX::Init(hwnd);
#endif
#ifdef CIFACE_USE_SDL
- ciface::SDL::Init(m_devices);
+ ciface::SDL::Init();
#endif
#ifdef CIFACE_USE_ANDROID
- ciface::Android::Init(m_devices);
+ ciface::Android::Init();
#endif
#ifdef CIFACE_USE_EVDEV
- ciface::evdev::Init(m_devices);
+ ciface::evdev::Init();
#endif
#ifdef CIFACE_USE_PIPES
- ciface::Pipes::Init(m_devices);
+ ciface::Pipes::Init();
#endif
m_is_init = true;
@@ -139,6 +139,11 @@ void ControllerInterface::Shutdown()
m_is_init = false;
}
+void ControllerInterface::AddDevice(ciface::Core::Device* device)
+{
+ m_devices.push_back(device);
+}
+
//
// UpdateInput
//