diff options
Diffstat (limited to 'src/input_common/input_poller.cpp')
| -rw-r--r-- | src/input_common/input_poller.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/input_common/input_poller.cpp b/src/input_common/input_poller.cpp index 92cf690cd..7e4eafded 100644 --- a/src/input_common/input_poller.cpp +++ b/src/input_common/input_poller.cpp | |||
| @@ -146,7 +146,8 @@ public: | |||
| 146 | Common::Input::AnalogProperties properties_y_, | 146 | Common::Input::AnalogProperties properties_y_, |
| 147 | InputEngine* input_engine_) | 147 | InputEngine* input_engine_) |
| 148 | : identifier(identifier_), axis_x(axis_x_), axis_y(axis_y_), properties_x(properties_x_), | 148 | : identifier(identifier_), axis_x(axis_x_), axis_y(axis_y_), properties_x(properties_x_), |
| 149 | properties_y(properties_y_), input_engine(input_engine_) { | 149 | properties_y(properties_y_), |
| 150 | input_engine(input_engine_), invert_axis_y{input_engine_->GetEngineName() == "sdl"} { | ||
| 150 | UpdateCallback engine_callback{[this]() { OnChange(); }}; | 151 | UpdateCallback engine_callback{[this]() { OnChange(); }}; |
| 151 | const InputIdentifier x_input_identifier{ | 152 | const InputIdentifier x_input_identifier{ |
| 152 | .identifier = identifier, | 153 | .identifier = identifier, |
| @@ -181,6 +182,11 @@ public: | |||
| 181 | .raw_value = input_engine->GetAxis(identifier, axis_y), | 182 | .raw_value = input_engine->GetAxis(identifier, axis_y), |
| 182 | .properties = properties_y, | 183 | .properties = properties_y, |
| 183 | }; | 184 | }; |
| 185 | // This is a workaround too keep compatibility with old yuzu versions. Vertical axis is | ||
| 186 | // inverted on SDL compared to Nintendo | ||
| 187 | if (invert_axis_y) { | ||
| 188 | status.y.raw_value = -status.y.raw_value; | ||
| 189 | } | ||
| 184 | return status; | 190 | return status; |
| 185 | } | 191 | } |
| 186 | 192 | ||
| @@ -220,6 +226,7 @@ private: | |||
| 220 | float last_axis_x_value; | 226 | float last_axis_x_value; |
| 221 | float last_axis_y_value; | 227 | float last_axis_y_value; |
| 222 | InputEngine* input_engine; | 228 | InputEngine* input_engine; |
| 229 | const bool invert_axis_y; | ||
| 223 | }; | 230 | }; |
| 224 | 231 | ||
| 225 | class InputFromTouch final : public Common::Input::InputDevice { | 232 | class InputFromTouch final : public Common::Input::InputDevice { |