From fd29e5c4cc26cd853a03ac7b0e08b367b7070c84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Sun, 12 Jun 2016 17:08:04 +0200 Subject: 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. --- Source/Core/InputCommon/ControllerInterface/ControllerInterface.h | 1 + 1 file changed, 1 insertion(+) (limited to 'Source/Core/InputCommon/ControllerInterface/ControllerInterface.h') diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.h b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.h index 25154ede40..3d1354dcc7 100644 --- a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.h +++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.h @@ -121,6 +121,7 @@ public: void Initialize(void* const hwnd); void Reinitialize(); void Shutdown(); + void AddDevice(ciface::Core::Device* device); bool IsInit() const { return m_is_init; } void UpdateReference(ControlReference* control, const ciface::Core::DeviceQualifier& default_device) const; -- cgit v1.2.3 From d3e2ae35ff853d115aca077eaa10b88114ef7c7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Sun, 12 Jun 2016 17:31:41 +0200 Subject: ControllerInterface: Add synchronisation Since we may have to add/access devices from different threads, this adds synchronisation to anything that touches m_devices. --- Source/Core/InputCommon/ControllerInterface/ControllerInterface.h | 1 + 1 file changed, 1 insertion(+) (limited to 'Source/Core/InputCommon/ControllerInterface/ControllerInterface.h') diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.h b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.h index 3d1354dcc7..2571e5f3ab 100644 --- a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.h +++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.h @@ -6,6 +6,7 @@ #include #include +#include #include #include #include -- cgit v1.2.3