diff --git a/Source/RMG-Core/Settings/Settings.cpp b/Source/RMG-Core/Settings/Settings.cpp index c0dbadb0..dd94aa72 100644 --- a/Source/RMG-Core/Settings/Settings.cpp +++ b/Source/RMG-Core/Settings/Settings.cpp @@ -452,9 +452,6 @@ static l_Setting get_setting(SettingsID settingId) case SettingsID::Input_DeviceNum: setting = {"", "DeviceNum"}; break; - case SettingsID::Input_Range: - setting = {"", "Range"}; - break; case SettingsID::Input_Deadzone: setting = {"", "Deadzone"}; break; diff --git a/Source/RMG-Core/Settings/SettingsID.hpp b/Source/RMG-Core/Settings/SettingsID.hpp index c8c80883..3e9b37b1 100644 --- a/Source/RMG-Core/Settings/SettingsID.hpp +++ b/Source/RMG-Core/Settings/SettingsID.hpp @@ -127,7 +127,6 @@ enum class SettingsID Input_DeviceType, Input_DeviceName, Input_DeviceNum, - Input_Range, Input_Deadzone, Input_Pak, Input_GameboyRom, diff --git a/Source/RMG-Input/UserInterface/Widget/ControllerWidget.cpp b/Source/RMG-Input/UserInterface/Widget/ControllerWidget.cpp index 38156bb5..c1a6fcd8 100644 --- a/Source/RMG-Input/UserInterface/Widget/ControllerWidget.cpp +++ b/Source/RMG-Input/UserInterface/Widget/ControllerWidget.cpp @@ -358,14 +358,6 @@ void ControllerWidget::on_deadZoneSlider_valueChanged(int value) this->controllerImageWidget->SetDeadzone(value); } -void ControllerWidget::on_analogStickRangeSlider_valueChanged(int value) -{ - QString text = QString::number(value); - text += "%"; - this->analogStickRangeLabel->setText(text); - this->controllerImageWidget->SetRange(value); -} - void ControllerWidget::on_profileComboBox_currentIndexChanged(int value) { // reload settings from section @@ -415,7 +407,6 @@ void ControllerWidget::on_controllerPluggedCheckBox_toggled(bool value) this->analogStickDownButton, this->analogStickLeftButton, this->analogStickRightButton, - this->analogStickRangeSlider, // cbuttons this->cbuttonUpButton, this->cbuttonDownButton, @@ -892,7 +883,6 @@ void ControllerWidget::LoadSettings(QString sectionQString) } this->controllerPluggedCheckBox->setChecked(CoreSettingsGetBoolValue(SettingsID::Input_PluggedIn, section)); - this->analogStickRangeSlider->setValue(CoreSettingsGetIntValue(SettingsID::Input_Range, section)); this->deadZoneSlider->setValue(CoreSettingsGetIntValue(SettingsID::Input_Deadzone, section)); this->optionsDialogSettings.RemoveDuplicateMappings = CoreSettingsGetBoolValue(SettingsID::Input_RemoveDuplicateMappings, section); this->optionsDialogSettings.ControllerPak = CoreSettingsGetIntValue(SettingsID::Input_Pak, section); @@ -922,7 +912,6 @@ void ControllerWidget::SaveDefaultSettings() CoreSettingsSetValue(SettingsID::Input_PluggedIn, section, false); CoreSettingsSetValue(SettingsID::Input_DeviceName, section, std::string("Keyboard")); CoreSettingsSetValue(SettingsID::Input_DeviceNum, section, -1); - CoreSettingsSetValue(SettingsID::Input_Range, section, 100); CoreSettingsSetValue(SettingsID::Input_Deadzone, section, 9); CoreSettingsSetValue(SettingsID::Input_Pak, section, 0); CoreSettingsSetValue(SettingsID::Input_RemoveDuplicateMappings, section, true); @@ -954,7 +943,6 @@ void ControllerWidget::SaveSettings() CoreSettingsSetValue(SettingsID::Input_PluggedIn, section, this->IsPluggedIn()); CoreSettingsSetValue(SettingsID::Input_DeviceName, section, deviceName.toStdString()); CoreSettingsSetValue(SettingsID::Input_DeviceNum, section, deviceNum); - CoreSettingsSetValue(SettingsID::Input_Range, section, this->analogStickRangeSlider->value()); CoreSettingsSetValue(SettingsID::Input_Deadzone, section, this->deadZoneSlider->value()); CoreSettingsSetValue(SettingsID::Input_Pak, section, this->optionsDialogSettings.ControllerPak); CoreSettingsSetValue(SettingsID::Input_GameboyRom, section, this->optionsDialogSettings.GameboyRom); diff --git a/Source/RMG-Input/UserInterface/Widget/ControllerWidget.hpp b/Source/RMG-Input/UserInterface/Widget/ControllerWidget.hpp index 58bd69da..e38a93cc 100644 --- a/Source/RMG-Input/UserInterface/Widget/ControllerWidget.hpp +++ b/Source/RMG-Input/UserInterface/Widget/ControllerWidget.hpp @@ -108,7 +108,6 @@ public: private slots: void on_deadZoneSlider_valueChanged(int value); - void on_analogStickRangeSlider_valueChanged(int value); void on_profileComboBox_currentIndexChanged(int value); diff --git a/Source/RMG-Input/UserInterface/Widget/ControllerWidget.ui b/Source/RMG-Input/UserInterface/Widget/ControllerWidget.ui index 987ccb73..7aaa0092 100644 --- a/Source/RMG-Input/UserInterface/Widget/ControllerWidget.ui +++ b/Source/RMG-Input/UserInterface/Widget/ControllerWidget.ui @@ -411,55 +411,6 @@ - - - - - - - 0 - 0 - - - - Range: - - - - - - - - 0 - 0 - - - - 1 - - - 100 - - - Qt::Horizontal - - - - - - - - 0 - 0 - - - - 100% - - - - - diff --git a/Source/RMG-Input/main.cpp b/Source/RMG-Input/main.cpp index 8df6b352..cf59597b 100644 --- a/Source/RMG-Input/main.cpp +++ b/Source/RMG-Input/main.cpp @@ -58,7 +58,6 @@ struct InputProfile { bool PluggedIn = false; int DeadzoneValue = 0; - int RangeValue = 100; N64ControllerPak ControllerPak = N64ControllerPak::None; @@ -166,7 +165,6 @@ static void load_settings(void) profile->PluggedIn = CoreSettingsGetBoolValue(SettingsID::Input_PluggedIn, section); profile->DeadzoneValue = CoreSettingsGetIntValue(SettingsID::Input_Deadzone, section); - profile->RangeValue = CoreSettingsGetIntValue(SettingsID::Input_Range, section); profile->ControllerPak = (N64ControllerPak)CoreSettingsGetIntValue(SettingsID::Input_Pak, section); profile->DeviceName = CoreSettingsGetStringValue(SettingsID::Input_DeviceName, section); profile->DeviceNum = CoreSettingsGetIntValue(SettingsID::Input_DeviceNum, section); @@ -334,7 +332,7 @@ static double get_axis_state(InputProfile* profile, InputMapping* inputMapping, double axis_value = SDL_GameControllerGetAxis(profile->InputDevice.GetGameControllerHandle(), (SDL_GameControllerAxis)inputMapping->Data); if (inputMapping->ExtraData ? axis_value > 0 : axis_value < 0) { - axis_value = (axis_value / SDL_AXIS_PEAK) * (profile->RangeValue / 100.0); + axis_value = (axis_value / SDL_AXIS_PEAK); axis_value = abs(axis_value) * direction; return axis_value; } @@ -349,7 +347,7 @@ static double get_axis_state(InputProfile* profile, InputMapping* inputMapping, double axis_value = SDL_JoystickGetAxis(profile->InputDevice.GetJoystickHandle(), inputMapping->Data); if (inputMapping->ExtraData ? axis_value > 0 : axis_value < 0) { - axis_value = (axis_value / SDL_AXIS_PEAK) * (profile->RangeValue / 100.0); + axis_value = (axis_value / SDL_AXIS_PEAK); axis_value = abs(axis_value) * direction; return axis_value; } @@ -383,12 +381,12 @@ static double simulate_deadzone(double n64InputAxis, double maxAxis, int deadzon } // Credit: MerryMage -static void simulate_octagon(double inputX, double inputY, double deadzoneFactor, double scalingFactor, int& outputX, int& outputY) +static void simulate_octagon(double inputX, double inputY, double deadzoneFactor, int& outputX, int& outputY) { - double maxAxis = scalingFactor * N64_AXIS_PEAK; - double maxDiagonal = scalingFactor * MAX_DIAGONAL_VALUE; - int deadzone = static_cast(deadzoneFactor * N64_AXIS_PEAK); - double axisRange = maxAxis - deadzone; + double maxAxis = N64_AXIS_PEAK; + double maxDiagonal = MAX_DIAGONAL_VALUE; + int deadzone = static_cast(deadzoneFactor * N64_AXIS_PEAK); + double axisRange = maxAxis - deadzone; // scale to [-maxAxis, maxAxis] double ax = inputX * maxAxis; double ay = inputY * maxAxis; @@ -709,7 +707,6 @@ EXPORT void CALL GetKeys(int Control, BUTTONS* Keys) inputX, // inputX inputY, // inputY profile->DeadzoneValue / 100.0, // deadzoneFactor - profile->RangeValue / 100.0, // scalingFactor octagonX, // outputX octagonY // outputY );