diff options
Diffstat (limited to 'src/input_common/sdl/sdl.cpp')
| -rw-r--r-- | src/input_common/sdl/sdl.cpp | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/src/input_common/sdl/sdl.cpp b/src/input_common/sdl/sdl.cpp index 8d117c2d4..d1b960fd7 100644 --- a/src/input_common/sdl/sdl.cpp +++ b/src/input_common/sdl/sdl.cpp | |||
| @@ -82,7 +82,7 @@ private: | |||
| 82 | class SDLButton final : public Input::ButtonDevice { | 82 | class SDLButton final : public Input::ButtonDevice { |
| 83 | public: | 83 | public: |
| 84 | explicit SDLButton(std::shared_ptr<SDLJoystick> joystick_, int button_) | 84 | explicit SDLButton(std::shared_ptr<SDLJoystick> joystick_, int button_) |
| 85 | : joystick(joystick_), button(button_) {} | 85 | : joystick(std::move(joystick_)), button(button_) {} |
| 86 | 86 | ||
| 87 | bool GetStatus() const override { | 87 | bool GetStatus() const override { |
| 88 | return joystick->GetButton(button); | 88 | return joystick->GetButton(button); |
| @@ -96,7 +96,7 @@ private: | |||
| 96 | class SDLDirectionButton final : public Input::ButtonDevice { | 96 | class SDLDirectionButton final : public Input::ButtonDevice { |
| 97 | public: | 97 | public: |
| 98 | explicit SDLDirectionButton(std::shared_ptr<SDLJoystick> joystick_, int hat_, Uint8 direction_) | 98 | explicit SDLDirectionButton(std::shared_ptr<SDLJoystick> joystick_, int hat_, Uint8 direction_) |
| 99 | : joystick(joystick_), hat(hat_), direction(direction_) {} | 99 | : joystick(std::move(joystick_)), hat(hat_), direction(direction_) {} |
| 100 | 100 | ||
| 101 | bool GetStatus() const override { | 101 | bool GetStatus() const override { |
| 102 | return joystick->GetHatDirection(hat, direction); | 102 | return joystick->GetHatDirection(hat, direction); |
| @@ -112,7 +112,7 @@ class SDLAxisButton final : public Input::ButtonDevice { | |||
| 112 | public: | 112 | public: |
| 113 | explicit SDLAxisButton(std::shared_ptr<SDLJoystick> joystick_, int axis_, float threshold_, | 113 | explicit SDLAxisButton(std::shared_ptr<SDLJoystick> joystick_, int axis_, float threshold_, |
| 114 | bool trigger_if_greater_) | 114 | bool trigger_if_greater_) |
| 115 | : joystick(joystick_), axis(axis_), threshold(threshold_), | 115 | : joystick(std::move(joystick_)), axis(axis_), threshold(threshold_), |
| 116 | trigger_if_greater(trigger_if_greater_) {} | 116 | trigger_if_greater(trigger_if_greater_) {} |
| 117 | 117 | ||
| 118 | bool GetStatus() const override { | 118 | bool GetStatus() const override { |
| @@ -132,7 +132,7 @@ private: | |||
| 132 | class SDLAnalog final : public Input::AnalogDevice { | 132 | class SDLAnalog final : public Input::AnalogDevice { |
| 133 | public: | 133 | public: |
| 134 | SDLAnalog(std::shared_ptr<SDLJoystick> joystick_, int axis_x_, int axis_y_) | 134 | SDLAnalog(std::shared_ptr<SDLJoystick> joystick_, int axis_x_, int axis_y_) |
| 135 | : joystick(joystick_), axis_x(axis_x_), axis_y(axis_y_) {} | 135 | : joystick(std::move(joystick_)), axis_x(axis_x_), axis_y(axis_y_) {} |
| 136 | 136 | ||
| 137 | std::tuple<float, float> GetStatus() const override { | 137 | std::tuple<float, float> GetStatus() const override { |
| 138 | return joystick->GetAnalog(axis_x, axis_y); | 138 | return joystick->GetAnalog(axis_x, axis_y); |
| @@ -314,10 +314,6 @@ namespace Polling { | |||
| 314 | 314 | ||
| 315 | class SDLPoller : public InputCommon::Polling::DevicePoller { | 315 | class SDLPoller : public InputCommon::Polling::DevicePoller { |
| 316 | public: | 316 | public: |
| 317 | SDLPoller() = default; | ||
| 318 | |||
| 319 | ~SDLPoller() = default; | ||
| 320 | |||
| 321 | void Start() override { | 317 | void Start() override { |
| 322 | // SDL joysticks must be opened, otherwise they don't generate events | 318 | // SDL joysticks must be opened, otherwise they don't generate events |
| 323 | SDL_JoystickUpdate(); | 319 | SDL_JoystickUpdate(); |
| @@ -341,10 +337,6 @@ private: | |||
| 341 | 337 | ||
| 342 | class SDLButtonPoller final : public SDLPoller { | 338 | class SDLButtonPoller final : public SDLPoller { |
| 343 | public: | 339 | public: |
| 344 | SDLButtonPoller() = default; | ||
| 345 | |||
| 346 | ~SDLButtonPoller() = default; | ||
| 347 | |||
| 348 | Common::ParamPackage GetNextInput() override { | 340 | Common::ParamPackage GetNextInput() override { |
| 349 | SDL_Event event; | 341 | SDL_Event event; |
| 350 | while (SDL_PollEvent(&event)) { | 342 | while (SDL_PollEvent(&event)) { |
| @@ -364,10 +356,6 @@ public: | |||
| 364 | 356 | ||
| 365 | class SDLAnalogPoller final : public SDLPoller { | 357 | class SDLAnalogPoller final : public SDLPoller { |
| 366 | public: | 358 | public: |
| 367 | SDLAnalogPoller() = default; | ||
| 368 | |||
| 369 | ~SDLAnalogPoller() = default; | ||
| 370 | |||
| 371 | void Start() override { | 359 | void Start() override { |
| 372 | SDLPoller::Start(); | 360 | SDLPoller::Start(); |
| 373 | 361 | ||