diff options
Diffstat (limited to 'src/input_common/gcadapter/gc_poller.cpp')
| -rw-r--r-- | src/input_common/gcadapter/gc_poller.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/input_common/gcadapter/gc_poller.cpp b/src/input_common/gcadapter/gc_poller.cpp index a04c507b8..385ce8430 100644 --- a/src/input_common/gcadapter/gc_poller.cpp +++ b/src/input_common/gcadapter/gc_poller.cpp | |||
| @@ -14,7 +14,7 @@ namespace InputCommon { | |||
| 14 | 14 | ||
| 15 | class GCButton final : public Input::ButtonDevice { | 15 | class GCButton final : public Input::ButtonDevice { |
| 16 | public: | 16 | public: |
| 17 | explicit GCButton(int port_, int button_, int axis_, GCAdapter::Adapter* adapter) | 17 | explicit GCButton(int port_, int button_, GCAdapter::Adapter* adapter) |
| 18 | : port(port_), button(button_), gcadapter(adapter) {} | 18 | : port(port_), button(button_), gcadapter(adapter) {} |
| 19 | 19 | ||
| 20 | ~GCButton() override; | 20 | ~GCButton() override; |
| @@ -45,7 +45,9 @@ public: | |||
| 45 | bool GetStatus() const override { | 45 | bool GetStatus() const override { |
| 46 | const float axis_value = (gcadapter->GetPadState()[port].axes.at(axis) - 128.0f) / 128.0f; | 46 | const float axis_value = (gcadapter->GetPadState()[port].axes.at(axis) - 128.0f) / 128.0f; |
| 47 | if (trigger_if_greater) { | 47 | if (trigger_if_greater) { |
| 48 | return axis_value > threshold; // TODO(ameerj) : Fix threshold. | 48 | // TODO: Might be worthwile to set a slider for the trigger threshold. It is currently |
| 49 | // always set to 0.5 in configure_input_player.cpp ZL/ZR HandleClick | ||
| 50 | return axis_value > threshold; | ||
| 49 | } | 51 | } |
| 50 | return axis_value < -threshold; | 52 | return axis_value < -threshold; |
| 51 | } | 53 | } |
| @@ -71,8 +73,7 @@ std::unique_ptr<Input::ButtonDevice> GCButtonFactory::Create(const Common::Param | |||
| 71 | 73 | ||
| 72 | // button is not an axis/stick button | 74 | // button is not an axis/stick button |
| 73 | if (button_id != PAD_STICK_ID) { | 75 | if (button_id != PAD_STICK_ID) { |
| 74 | std::unique_ptr<GCButton> button = | 76 | auto button = std::make_unique<GCButton>(port, button_id, adapter.get()); |
| 75 | std::make_unique<GCButton>(port, button_id, params.Get("axis", 0), adapter.get()); | ||
| 76 | return std::move(button); | 77 | return std::move(button); |
| 77 | } | 78 | } |
| 78 | 79 | ||