diff options
Diffstat (limited to 'src/input_common/helpers')
| -rw-r--r-- | src/input_common/helpers/stick_from_buttons.cpp | 15 | ||||
| -rw-r--r-- | src/input_common/helpers/touch_from_buttons.cpp | 3 |
2 files changed, 6 insertions, 12 deletions
diff --git a/src/input_common/helpers/stick_from_buttons.cpp b/src/input_common/helpers/stick_from_buttons.cpp index cdd360f13..82aa6ac2f 100644 --- a/src/input_common/helpers/stick_from_buttons.cpp +++ b/src/input_common/helpers/stick_from_buttons.cpp | |||
| @@ -326,16 +326,11 @@ private: | |||
| 326 | std::unique_ptr<Common::Input::InputDevice> StickFromButton::Create( | 326 | std::unique_ptr<Common::Input::InputDevice> StickFromButton::Create( |
| 327 | const Common::ParamPackage& params) { | 327 | const Common::ParamPackage& params) { |
| 328 | const std::string null_engine = Common::ParamPackage{{"engine", "null"}}.Serialize(); | 328 | const std::string null_engine = Common::ParamPackage{{"engine", "null"}}.Serialize(); |
| 329 | auto up = Common::Input::CreateDeviceFromString<Common::Input::InputDevice>( | 329 | auto up = Common::Input::CreateInputDeviceFromString(params.Get("up", null_engine)); |
| 330 | params.Get("up", null_engine)); | 330 | auto down = Common::Input::CreateInputDeviceFromString(params.Get("down", null_engine)); |
| 331 | auto down = Common::Input::CreateDeviceFromString<Common::Input::InputDevice>( | 331 | auto left = Common::Input::CreateInputDeviceFromString(params.Get("left", null_engine)); |
| 332 | params.Get("down", null_engine)); | 332 | auto right = Common::Input::CreateInputDeviceFromString(params.Get("right", null_engine)); |
| 333 | auto left = Common::Input::CreateDeviceFromString<Common::Input::InputDevice>( | 333 | auto modifier = Common::Input::CreateInputDeviceFromString(params.Get("modifier", null_engine)); |
| 334 | params.Get("left", null_engine)); | ||
| 335 | auto right = Common::Input::CreateDeviceFromString<Common::Input::InputDevice>( | ||
| 336 | params.Get("right", null_engine)); | ||
| 337 | auto modifier = Common::Input::CreateDeviceFromString<Common::Input::InputDevice>( | ||
| 338 | params.Get("modifier", null_engine)); | ||
| 339 | auto modifier_scale = params.Get("modifier_scale", 0.5f); | 334 | auto modifier_scale = params.Get("modifier_scale", 0.5f); |
| 340 | auto modifier_angle = params.Get("modifier_angle", 5.5f); | 335 | auto modifier_angle = params.Get("modifier_angle", 5.5f); |
| 341 | return std::make_unique<Stick>(std::move(up), std::move(down), std::move(left), | 336 | return std::make_unique<Stick>(std::move(up), std::move(down), std::move(left), |
diff --git a/src/input_common/helpers/touch_from_buttons.cpp b/src/input_common/helpers/touch_from_buttons.cpp index ff633a807..e064b13d9 100644 --- a/src/input_common/helpers/touch_from_buttons.cpp +++ b/src/input_common/helpers/touch_from_buttons.cpp | |||
| @@ -77,8 +77,7 @@ private: | |||
| 77 | std::unique_ptr<Common::Input::InputDevice> TouchFromButton::Create( | 77 | std::unique_ptr<Common::Input::InputDevice> TouchFromButton::Create( |
| 78 | const Common::ParamPackage& params) { | 78 | const Common::ParamPackage& params) { |
| 79 | const std::string null_engine = Common::ParamPackage{{"engine", "null"}}.Serialize(); | 79 | const std::string null_engine = Common::ParamPackage{{"engine", "null"}}.Serialize(); |
| 80 | auto button = Common::Input::CreateDeviceFromString<Common::Input::InputDevice>( | 80 | auto button = Common::Input::CreateInputDeviceFromString(params.Get("button", null_engine)); |
| 81 | params.Get("button", null_engine)); | ||
| 82 | const float x = params.Get("x", 0.0f) / 1280.0f; | 81 | const float x = params.Get("x", 0.0f) / 1280.0f; |
| 83 | const float y = params.Get("y", 0.0f) / 720.0f; | 82 | const float y = params.Get("y", 0.0f) / 720.0f; |
| 84 | return std::make_unique<TouchFromButtonDevice>(std::move(button), x, y); | 83 | return std::make_unique<TouchFromButtonDevice>(std::move(button), x, y); |