diff options
| author | Jordan Woyak <jordan.woyak@gmail.com> | 2024-11-05 19:22:30 -0600 |
|---|---|---|
| committer | Jordan Woyak <jordan.woyak@gmail.com> | 2024-11-05 19:22:30 -0600 |
| commit | 649e49c9e23a6c2ee4d10958c7cbaed034ced018 (patch) | |
| tree | 701559712df005c4bb614ecf528296ce6c3f8f0d /Source/Core | |
| parent | 29172fab9ec85952be0e3efb57909af2b5436721 (diff) | |
ControllerEmu: Remove nunchuk stick data hax.
Diffstat (limited to 'Source/Core')
3 files changed, 1 insertions, 31 deletions
diff --git a/Source/Core/Core/HW/WiimoteEmu/Extension/Nunchuk.cpp b/Source/Core/Core/HW/WiimoteEmu/Extension/Nunchuk.cpp index 14ba12b01f..741b061f49 100644 --- a/Source/Core/Core/HW/WiimoteEmu/Extension/Nunchuk.cpp +++ b/Source/Core/Core/HW/WiimoteEmu/Extension/Nunchuk.cpp @@ -67,31 +67,11 @@ void Nunchuk::BuildDesiredExtensionState(DesiredExtensionState* target_state) DataFormat nc_data = {}; // stick - bool override_occurred = false; const ControllerEmu::AnalogStick::StateData stick_state = - m_stick->GetState(m_input_override_function, &override_occurred); + m_stick->GetState(m_input_override_function); nc_data.jx = MapFloat<u8>(stick_state.x, STICK_CENTER, 0, STICK_RANGE); nc_data.jy = MapFloat<u8>(stick_state.y, STICK_CENTER, 0, STICK_RANGE); - if (!override_occurred) - { - // Some terribly coded games check whether to move with a check like - // - // if (x != 0 && y != 0) - // do_movement(x, y); - // - // With keyboard controls, these games break if you simply hit one - // of the axes. Adjust this if you're hitting one of the axes so that - // we slightly tweak the other axis. - if (nc_data.jx != STICK_CENTER || nc_data.jy != STICK_CENTER) - { - if (nc_data.jx == STICK_CENTER) - ++nc_data.jx; - if (nc_data.jy == STICK_CENTER) - ++nc_data.jy; - } - } - // buttons u8 buttons = 0; m_buttons->GetState(&buttons, nunchuk_button_bitmasks.data(), m_input_override_function); diff --git a/Source/Core/InputCommon/ControllerEmu/ControlGroup/AnalogStick.cpp b/Source/Core/InputCommon/ControllerEmu/ControlGroup/AnalogStick.cpp index c26f143f1c..7cc204ab10 100644 --- a/Source/Core/InputCommon/ControllerEmu/ControlGroup/AnalogStick.cpp +++ b/Source/Core/InputCommon/ControllerEmu/ControlGroup/AnalogStick.cpp @@ -51,13 +51,6 @@ AnalogStick::StateData AnalogStick::GetState() const AnalogStick::StateData AnalogStick::GetState(const InputOverrideFunction& override_func) const { - bool override_occurred = false; - return GetState(override_func, &override_occurred); -} - -AnalogStick::StateData AnalogStick::GetState(const InputOverrideFunction& override_func, - bool* override_occurred) const -{ StateData state = GetState(); if (!override_func) return state; @@ -65,13 +58,11 @@ AnalogStick::StateData AnalogStick::GetState(const InputOverrideFunction& overri if (const std::optional<ControlState> x_override = override_func(name, X_INPUT_OVERRIDE, state.x)) { state.x = *x_override; - *override_occurred = true; } if (const std::optional<ControlState> y_override = override_func(name, Y_INPUT_OVERRIDE, state.y)) { state.y = *y_override; - *override_occurred = true; } return state; diff --git a/Source/Core/InputCommon/ControllerEmu/ControlGroup/AnalogStick.h b/Source/Core/InputCommon/ControllerEmu/ControlGroup/AnalogStick.h index 377e63251d..5e913029ad 100644 --- a/Source/Core/InputCommon/ControllerEmu/ControlGroup/AnalogStick.h +++ b/Source/Core/InputCommon/ControllerEmu/ControlGroup/AnalogStick.h @@ -22,7 +22,6 @@ public: StateData GetState() const; StateData GetState(const InputOverrideFunction& override_func) const; - StateData GetState(const InputOverrideFunction& override_func, bool* override_occurred) const; private: Control* GetModifierInput() const override; |
