diff options
| author | 2019-03-18 11:26:13 -0400 | |
|---|---|---|
| committer | 2019-03-18 11:40:35 -0400 | |
| commit | 874826b6ddef20f190013f24021d20e0338d5593 (patch) | |
| tree | a8c904b3b04deed81668f070de12a4c43e9b6af5 /src | |
| parent | Merge pull request #2259 from lioncash/fsp (diff) | |
| download | yuzu-874826b6ddef20f190013f24021d20e0338d5593.tar.gz yuzu-874826b6ddef20f190013f24021d20e0338d5593.tar.xz yuzu-874826b6ddef20f190013f24021d20e0338d5593.zip | |
input_common/sdl: Use a type alias to shorten declaration of GetPollers
Just makes the definitions a little bit more tidy.
Diffstat (limited to 'src')
| -rw-r--r-- | src/input_common/sdl/sdl.h | 10 | ||||
| -rw-r--r-- | src/input_common/sdl/sdl_impl.cpp | 5 | ||||
| -rw-r--r-- | src/input_common/sdl/sdl_impl.h | 5 |
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 | ||
| 25 | class State { | 25 | class State { |
| 26 | public: | 26 | public: |
| 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 | ||
| 34 | class NullState : public State { | 35 | class NullState : public State { |
| 35 | public: | 36 | public: |
| 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 | ||
| 40 | std::unique_ptr<State> Init(); | 40 | std::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 | ||
| 653 | std::vector<std::unique_ptr<InputCommon::Polling::DevicePoller>> SDLState::GetPollers( | 653 | SDLState::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; |