diff options
| -rw-r--r-- | src/input_common/input_poller.cpp | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/src/input_common/input_poller.cpp b/src/input_common/input_poller.cpp index c56d5e0c2..7b370335f 100644 --- a/src/input_common/input_poller.cpp +++ b/src/input_common/input_poller.cpp | |||
| @@ -12,8 +12,7 @@ namespace InputCommon { | |||
| 12 | 12 | ||
| 13 | class DummyInput final : public Common::Input::InputDevice { | 13 | class DummyInput final : public Common::Input::InputDevice { |
| 14 | public: | 14 | public: |
| 15 | explicit DummyInput() {} | 15 | explicit DummyInput() = default; |
| 16 | ~DummyInput() {} | ||
| 17 | }; | 16 | }; |
| 18 | 17 | ||
| 19 | class InputFromButton final : public Common::Input::InputDevice { | 18 | class InputFromButton final : public Common::Input::InputDevice { |
| @@ -33,7 +32,7 @@ public: | |||
| 33 | callback_key = input_engine->SetCallback(input_identifier); | 32 | callback_key = input_engine->SetCallback(input_identifier); |
| 34 | } | 33 | } |
| 35 | 34 | ||
| 36 | ~InputFromButton() { | 35 | ~InputFromButton() override { |
| 37 | input_engine->DeleteCallback(callback_key); | 36 | input_engine->DeleteCallback(callback_key); |
| 38 | } | 37 | } |
| 39 | 38 | ||
| @@ -45,7 +44,7 @@ public: | |||
| 45 | }; | 44 | }; |
| 46 | } | 45 | } |
| 47 | 46 | ||
| 48 | void ForceUpdate() { | 47 | void ForceUpdate() override { |
| 49 | const Common::Input::CallbackStatus status{ | 48 | const Common::Input::CallbackStatus status{ |
| 50 | .type = Common::Input::InputType::Button, | 49 | .type = Common::Input::InputType::Button, |
| 51 | .button_status = GetStatus(), | 50 | .button_status = GetStatus(), |
| @@ -94,7 +93,7 @@ public: | |||
| 94 | callback_key = input_engine->SetCallback(input_identifier); | 93 | callback_key = input_engine->SetCallback(input_identifier); |
| 95 | } | 94 | } |
| 96 | 95 | ||
| 97 | ~InputFromHatButton() { | 96 | ~InputFromHatButton() override { |
| 98 | input_engine->DeleteCallback(callback_key); | 97 | input_engine->DeleteCallback(callback_key); |
| 99 | } | 98 | } |
| 100 | 99 | ||
| @@ -106,7 +105,7 @@ public: | |||
| 106 | }; | 105 | }; |
| 107 | } | 106 | } |
| 108 | 107 | ||
| 109 | void ForceUpdate() { | 108 | void ForceUpdate() override { |
| 110 | const Common::Input::CallbackStatus status{ | 109 | const Common::Input::CallbackStatus status{ |
| 111 | .type = Common::Input::InputType::Button, | 110 | .type = Common::Input::InputType::Button, |
| 112 | .button_status = GetStatus(), | 111 | .button_status = GetStatus(), |
| @@ -167,7 +166,7 @@ public: | |||
| 167 | callback_key_y = input_engine->SetCallback(y_input_identifier); | 166 | callback_key_y = input_engine->SetCallback(y_input_identifier); |
| 168 | } | 167 | } |
| 169 | 168 | ||
| 170 | ~InputFromStick() { | 169 | ~InputFromStick() override { |
| 171 | input_engine->DeleteCallback(callback_key_x); | 170 | input_engine->DeleteCallback(callback_key_x); |
| 172 | input_engine->DeleteCallback(callback_key_y); | 171 | input_engine->DeleteCallback(callback_key_y); |
| 173 | } | 172 | } |
| @@ -190,7 +189,7 @@ public: | |||
| 190 | return status; | 189 | return status; |
| 191 | } | 190 | } |
| 192 | 191 | ||
| 193 | void ForceUpdate() { | 192 | void ForceUpdate() override { |
| 194 | const Common::Input::CallbackStatus status{ | 193 | const Common::Input::CallbackStatus status{ |
| 195 | .type = Common::Input::InputType::Stick, | 194 | .type = Common::Input::InputType::Stick, |
| 196 | .stick_status = GetStatus(), | 195 | .stick_status = GetStatus(), |
| @@ -266,7 +265,7 @@ public: | |||
| 266 | callback_key_y = input_engine->SetCallback(y_input_identifier); | 265 | callback_key_y = input_engine->SetCallback(y_input_identifier); |
| 267 | } | 266 | } |
| 268 | 267 | ||
| 269 | ~InputFromTouch() { | 268 | ~InputFromTouch() override { |
| 270 | input_engine->DeleteCallback(callback_key_button); | 269 | input_engine->DeleteCallback(callback_key_button); |
| 271 | input_engine->DeleteCallback(callback_key_x); | 270 | input_engine->DeleteCallback(callback_key_x); |
| 272 | input_engine->DeleteCallback(callback_key_y); | 271 | input_engine->DeleteCallback(callback_key_y); |
| @@ -352,7 +351,7 @@ public: | |||
| 352 | axis_callback_key = input_engine->SetCallback(axis_input_identifier); | 351 | axis_callback_key = input_engine->SetCallback(axis_input_identifier); |
| 353 | } | 352 | } |
| 354 | 353 | ||
| 355 | ~InputFromTrigger() { | 354 | ~InputFromTrigger() override { |
| 356 | input_engine->DeleteCallback(callback_key_button); | 355 | input_engine->DeleteCallback(callback_key_button); |
| 357 | input_engine->DeleteCallback(axis_callback_key); | 356 | input_engine->DeleteCallback(axis_callback_key); |
| 358 | } | 357 | } |
| @@ -419,7 +418,7 @@ public: | |||
| 419 | callback_key = input_engine->SetCallback(input_identifier); | 418 | callback_key = input_engine->SetCallback(input_identifier); |
| 420 | } | 419 | } |
| 421 | 420 | ||
| 422 | ~InputFromAnalog() { | 421 | ~InputFromAnalog() override { |
| 423 | input_engine->DeleteCallback(callback_key); | 422 | input_engine->DeleteCallback(callback_key); |
| 424 | } | 423 | } |
| 425 | 424 | ||
| @@ -466,7 +465,7 @@ public: | |||
| 466 | callback_key = input_engine->SetCallback(input_identifier); | 465 | callback_key = input_engine->SetCallback(input_identifier); |
| 467 | } | 466 | } |
| 468 | 467 | ||
| 469 | ~InputFromBattery() { | 468 | ~InputFromBattery() override { |
| 470 | input_engine->DeleteCallback(callback_key); | 469 | input_engine->DeleteCallback(callback_key); |
| 471 | } | 470 | } |
| 472 | 471 | ||
| @@ -474,7 +473,7 @@ public: | |||
| 474 | return static_cast<Common::Input::BatteryLevel>(input_engine->GetBattery(identifier)); | 473 | return static_cast<Common::Input::BatteryLevel>(input_engine->GetBattery(identifier)); |
| 475 | } | 474 | } |
| 476 | 475 | ||
| 477 | void ForceUpdate() { | 476 | void ForceUpdate() override { |
| 478 | const Common::Input::CallbackStatus status{ | 477 | const Common::Input::CallbackStatus status{ |
| 479 | .type = Common::Input::InputType::Battery, | 478 | .type = Common::Input::InputType::Battery, |
| 480 | .battery_status = GetStatus(), | 479 | .battery_status = GetStatus(), |
| @@ -518,7 +517,7 @@ public: | |||
| 518 | callback_key = input_engine->SetCallback(input_identifier); | 517 | callback_key = input_engine->SetCallback(input_identifier); |
| 519 | } | 518 | } |
| 520 | 519 | ||
| 521 | ~InputFromMotion() { | 520 | ~InputFromMotion() override { |
| 522 | input_engine->DeleteCallback(callback_key); | 521 | input_engine->DeleteCallback(callback_key); |
| 523 | } | 522 | } |
| 524 | 523 | ||
| @@ -593,7 +592,7 @@ public: | |||
| 593 | callback_key_z = input_engine->SetCallback(z_input_identifier); | 592 | callback_key_z = input_engine->SetCallback(z_input_identifier); |
| 594 | } | 593 | } |
| 595 | 594 | ||
| 596 | ~InputFromAxisMotion() { | 595 | ~InputFromAxisMotion() override { |
| 597 | input_engine->DeleteCallback(callback_key_x); | 596 | input_engine->DeleteCallback(callback_key_x); |
| 598 | input_engine->DeleteCallback(callback_key_y); | 597 | input_engine->DeleteCallback(callback_key_y); |
| 599 | input_engine->DeleteCallback(callback_key_z); | 598 | input_engine->DeleteCallback(callback_key_z); |
| @@ -618,7 +617,7 @@ public: | |||
| 618 | return status; | 617 | return status; |
| 619 | } | 618 | } |
| 620 | 619 | ||
| 621 | void ForceUpdate() { | 620 | void ForceUpdate() override { |
| 622 | const Common::Input::CallbackStatus status{ | 621 | const Common::Input::CallbackStatus status{ |
| 623 | .type = Common::Input::InputType::Motion, | 622 | .type = Common::Input::InputType::Motion, |
| 624 | .motion_status = GetStatus(), | 623 | .motion_status = GetStatus(), |
| @@ -668,16 +667,16 @@ public: | |||
| 668 | explicit OutputFromIdentifier(PadIdentifier identifier_, InputEngine* input_engine_) | 667 | explicit OutputFromIdentifier(PadIdentifier identifier_, InputEngine* input_engine_) |
| 669 | : identifier(identifier_), input_engine(input_engine_) {} | 668 | : identifier(identifier_), input_engine(input_engine_) {} |
| 670 | 669 | ||
| 671 | virtual void SetLED(const Common::Input::LedStatus& led_status) { | 670 | void SetLED(const Common::Input::LedStatus& led_status) override { |
| 672 | input_engine->SetLeds(identifier, led_status); | 671 | input_engine->SetLeds(identifier, led_status); |
| 673 | } | 672 | } |
| 674 | 673 | ||
| 675 | virtual Common::Input::VibrationError SetVibration( | 674 | Common::Input::VibrationError SetVibration( |
| 676 | const Common::Input::VibrationStatus& vibration_status) { | 675 | const Common::Input::VibrationStatus& vibration_status) override { |
| 677 | return input_engine->SetRumble(identifier, vibration_status); | 676 | return input_engine->SetRumble(identifier, vibration_status); |
| 678 | } | 677 | } |
| 679 | 678 | ||
| 680 | virtual Common::Input::PollingError SetPollingMode(Common::Input::PollingMode polling_mode) { | 679 | Common::Input::PollingError SetPollingMode(Common::Input::PollingMode polling_mode) override { |
| 681 | return input_engine->SetPollingMode(identifier, polling_mode); | 680 | return input_engine->SetPollingMode(identifier, polling_mode); |
| 682 | } | 681 | } |
| 683 | 682 | ||