summaryrefslogtreecommitdiff
path: root/src/input_common
diff options
context:
space:
mode:
Diffstat (limited to 'src/input_common')
-rw-r--r--src/input_common/sdl/sdl.h10
-rw-r--r--src/input_common/sdl/sdl_impl.cpp5
-rw-r--r--src/input_common/sdl/sdl_impl.h5
3 files changed, 9 insertions, 11 deletions
diff --git a/src/input_common/sdl/sdl.h b/src/input_common/sdl/sdl.h
index 02a8d2e2c..940ca7f1b 100644
--- a/src/input_common/sdl/sdl.h
+++ b/src/input_common/sdl/sdl.h
@@ -24,17 +24,17 @@ namespace InputCommon::SDL {
24 24
25class State { 25class State {
26public: 26public:
27 /// Unresisters SDL device factories and shut them down. 27 using Pollers = std::vector<std::unique_ptr<Polling::DevicePoller>>;
28
29 /// Unregisters SDL device factories and shut them down.
28 virtual ~State() = default; 30 virtual ~State() = default;
29 31
30 virtual std::vector<std::unique_ptr<InputCommon::Polling::DevicePoller>> GetPollers( 32 virtual Pollers GetPollers(Polling::DeviceType type) = 0;
31 InputCommon::Polling::DeviceType type) = 0;
32}; 33};
33 34
34class NullState : public State { 35class NullState : public State {
35public: 36public:
36 std::vector<std::unique_ptr<InputCommon::Polling::DevicePoller>> GetPollers( 37 Pollers GetPollers(Polling::DeviceType type) override {}
37 InputCommon::Polling::DeviceType type) override {}
38}; 38};
39 39
40std::unique_ptr<State> Init(); 40std::unique_ptr<State> Init();
diff --git a/src/input_common/sdl/sdl_impl.cpp b/src/input_common/sdl/sdl_impl.cpp
index 6e8376549..f44a4a332 100644
--- a/src/input_common/sdl/sdl_impl.cpp
+++ b/src/input_common/sdl/sdl_impl.cpp
@@ -650,9 +650,8 @@ private:
650}; 650};
651} // namespace Polling 651} // namespace Polling
652 652
653std::vector<std::unique_ptr<InputCommon::Polling::DevicePoller>> SDLState::GetPollers( 653SDLState::Pollers SDLState::GetPollers(InputCommon::Polling::DeviceType type) {
654 InputCommon::Polling::DeviceType type) { 654 Pollers pollers;
655 std::vector<std::unique_ptr<InputCommon::Polling::DevicePoller>> pollers;
656 switch (type) { 655 switch (type) {
657 case InputCommon::Polling::DeviceType::Analog: 656 case InputCommon::Polling::DeviceType::Analog:
658 pollers.emplace_back(std::make_unique<Polling::SDLAnalogPoller>(*this)); 657 pollers.emplace_back(std::make_unique<Polling::SDLAnalogPoller>(*this));
diff --git a/src/input_common/sdl/sdl_impl.h b/src/input_common/sdl/sdl_impl.h
index fec82fbe6..2579741d6 100644
--- a/src/input_common/sdl/sdl_impl.h
+++ b/src/input_common/sdl/sdl_impl.h
@@ -25,7 +25,7 @@ public:
25 /// Initializes and registers SDL device factories 25 /// Initializes and registers SDL device factories
26 SDLState(); 26 SDLState();
27 27
28 /// Unresisters SDL device factories and shut them down. 28 /// Unregisters SDL device factories and shut them down.
29 ~SDLState() override; 29 ~SDLState() override;
30 30
31 /// Handle SDL_Events for joysticks from SDL_PollEvent 31 /// Handle SDL_Events for joysticks from SDL_PollEvent
@@ -35,8 +35,7 @@ public:
35 std::shared_ptr<SDLJoystick> GetSDLJoystickByGUID(const std::string& guid, int port); 35 std::shared_ptr<SDLJoystick> GetSDLJoystickByGUID(const std::string& guid, int port);
36 36
37 /// Get all DevicePoller that use the SDL backend for a specific device type 37 /// Get all DevicePoller that use the SDL backend for a specific device type
38 std::vector<std::unique_ptr<InputCommon::Polling::DevicePoller>> GetPollers( 38 Pollers GetPollers(Polling::DeviceType type) override;
39 InputCommon::Polling::DeviceType type) override;
40 39
41 /// Used by the Pollers during config 40 /// Used by the Pollers during config
42 std::atomic<bool> polling = false; 41 std::atomic<bool> polling = false;