summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/input_common/sdl/sdl_impl.cpp7
-rw-r--r--src/input_common/sdl/sdl_impl.h6
2 files changed, 6 insertions, 7 deletions
diff --git a/src/input_common/sdl/sdl_impl.cpp b/src/input_common/sdl/sdl_impl.cpp
index e03f9b712..90615dc58 100644
--- a/src/input_common/sdl/sdl_impl.cpp
+++ b/src/input_common/sdl/sdl_impl.cpp
@@ -131,9 +131,6 @@ private:
131 mutable std::mutex mutex; 131 mutable std::mutex mutex;
132}; 132};
133 133
134/**
135 * Get the nth joystick with the corresponding GUID
136 */
137std::shared_ptr<SDLJoystick> SDLState::GetSDLJoystickByGUID(const std::string& guid, int port) { 134std::shared_ptr<SDLJoystick> SDLState::GetSDLJoystickByGUID(const std::string& guid, int port) {
138 std::lock_guard lock{joystick_map_mutex}; 135 std::lock_guard lock{joystick_map_mutex};
139 const auto it = joystick_map.find(guid); 136 const auto it = joystick_map.find(guid);
@@ -149,10 +146,6 @@ std::shared_ptr<SDLJoystick> SDLState::GetSDLJoystickByGUID(const std::string& g
149 return joystick_map[guid].emplace_back(std::move(joystick)); 146 return joystick_map[guid].emplace_back(std::move(joystick));
150} 147}
151 148
152/**
153 * Check how many identical joysticks (by guid) were connected before the one with sdl_id and so tie
154 * it to a SDLJoystick with the same guid and that port
155 */
156std::shared_ptr<SDLJoystick> SDLState::GetSDLJoystickBySDLID(SDL_JoystickID sdl_id) { 149std::shared_ptr<SDLJoystick> SDLState::GetSDLJoystickBySDLID(SDL_JoystickID sdl_id) {
157 auto sdl_joystick = SDL_JoystickFromInstanceID(sdl_id); 150 auto sdl_joystick = SDL_JoystickFromInstanceID(sdl_id);
158 const std::string guid = GetGUID(sdl_joystick); 151 const std::string guid = GetGUID(sdl_joystick);
diff --git a/src/input_common/sdl/sdl_impl.h b/src/input_common/sdl/sdl_impl.h
index fadcf3139..606a32c5b 100644
--- a/src/input_common/sdl/sdl_impl.h
+++ b/src/input_common/sdl/sdl_impl.h
@@ -34,7 +34,13 @@ public:
34 /// Handle SDL_Events for joysticks from SDL_PollEvent 34 /// Handle SDL_Events for joysticks from SDL_PollEvent
35 void HandleGameControllerEvent(const SDL_Event& event); 35 void HandleGameControllerEvent(const SDL_Event& event);
36 36
37 /// Get the nth joystick with the corresponding GUID
37 std::shared_ptr<SDLJoystick> GetSDLJoystickBySDLID(SDL_JoystickID sdl_id); 38 std::shared_ptr<SDLJoystick> GetSDLJoystickBySDLID(SDL_JoystickID sdl_id);
39
40 /**
41 * Check how many identical joysticks (by guid) were connected before the one with sdl_id and so
42 * tie it to a SDLJoystick with the same guid and that port
43 */
38 std::shared_ptr<SDLJoystick> GetSDLJoystickByGUID(const std::string& guid, int port); 44 std::shared_ptr<SDLJoystick> GetSDLJoystickByGUID(const std::string& guid, int port);
39 45
40 /// Get all DevicePoller that use the SDL backend for a specific device type 46 /// Get all DevicePoller that use the SDL backend for a specific device type