mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-02 06:40:42 -07:00
rawinput: remove experimental analog features (delay and relative axis mode) (#668)
## Link to GitHub Issue or related Pull Request, if one exists Related to #181 ## Description of change This PR removes two features marked as "experimental" for analog axis - `Delay` and `Relative Axis`. They have been in spice as experimental option for almost 2 years.. but they have a fundamental problem of being tied to how often the analog is polled. Not just how often the game's I/O emulation code polls it, but literally any source (spice API, overlay, etc). For `Delay`, the only real usage I'm aware of is for #181 which is delaying IIDX turntable input. For this, I will follow up with a separate PR that adds back the delay option specifically for IIDX. For `Relative Axis` - I'm not quite sure if any one actually uses this. This could be implemented per-game if some game demands it. Polaris Chord already has one, for example. ## Testing
This commit is contained in:
@@ -2522,9 +2522,9 @@ namespace overlay::windows {
|
||||
}
|
||||
}
|
||||
|
||||
// hide deadzone for circular analog since it doesn't make any sense (unless in relative mode)
|
||||
// hide deadzone for circular analog since it doesn't make any sense
|
||||
if ((device->type == rawinput::HID || device->type == rawinput::MIDI) &&
|
||||
((analog.getType() != GameAPI::Analogs::AnalogType::Circular) || analog.isRelativeMode())) {
|
||||
analog.getType() != GameAPI::Analogs::AnalogType::Circular) {
|
||||
auto deadzone = analog.getDeadzone();
|
||||
|
||||
// for back compat (before each analog had a type)
|
||||
@@ -2568,46 +2568,16 @@ namespace overlay::windows {
|
||||
if (analog.getType() == GameAPI::Analogs::AnalogType::Circular) {
|
||||
// smoothing
|
||||
bool smoothing = analog.getSmoothing();
|
||||
ImGui::BeginDisabled(analog.isRelativeMode());
|
||||
ImGui::Checkbox("Smooth Axis (adds latency)", &smoothing);
|
||||
ImGui::SameLine();
|
||||
ImGui::HelpMarker(
|
||||
"Apply a moving average algorithm; intended for angular input (knobs, turntables). "
|
||||
"Adds a slight bit of latency to input as the algorithm averages out recent input. "
|
||||
"Only use in dire situations where the input is too jittery for the game.");
|
||||
ImGui::EndDisabled();
|
||||
if (smoothing != analog.getSmoothing()) {
|
||||
analog.setSmoothing(smoothing);
|
||||
}
|
||||
}
|
||||
|
||||
// relative input mode
|
||||
bool relative_analog = analog.isRelativeMode();
|
||||
ImGui::Checkbox("Relative Axis", &relative_analog);
|
||||
ImGui::SameLine();
|
||||
ImGui::HelpMarker(
|
||||
"Use relative directional input instead of positional values.\n\n"
|
||||
"Can be used to translate analog sticks to knob input, for example.\n\n"
|
||||
"WARNING: speed depends on how often the game polls for input! "
|
||||
"Strongly recommended that you go into the game's test menu instead "
|
||||
"of adjusting in spicecfg.");
|
||||
if (relative_analog != analog.isRelativeMode()) {
|
||||
analog.setRelativeMode(relative_analog);
|
||||
}
|
||||
|
||||
// delay buffer
|
||||
int delay = analog.getDelayBufferDepth();
|
||||
if (ImGui::InputInt("Delay (experimental)", &delay, 1, 10)) {
|
||||
delay = CLAMP(delay, 0, 256);
|
||||
analog.setDelayBufferDepth(delay);
|
||||
}
|
||||
ImGui::SameLine();
|
||||
ImGui::HelpMarker(
|
||||
"Adds a delay to input. This is poll-based, not time-based.\n\n"
|
||||
"WARNING: delay depends on how often the game polls for input! "
|
||||
"Strongly recommended that you go into the game's test menu instead "
|
||||
"of adjusting in spicecfg. Close all overlays as that will affect "
|
||||
"how input delay is calculated.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5419,8 +5389,6 @@ namespace overlay::windows {
|
||||
a.setInvert(ta.invert);
|
||||
a.setSmoothing(ta.smoothing);
|
||||
a.setMultiplier(ta.multiplier);
|
||||
a.setRelativeMode(ta.relative_mode);
|
||||
a.setDelayBufferDepth(ta.delay_buffer_depth);
|
||||
::Config::getInstance().updateBinding(game, a);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -71,8 +71,6 @@ namespace overlay::windows {
|
||||
bool invert = false;
|
||||
bool smoothing = false;
|
||||
int multiplier = 1;
|
||||
bool relative_mode = false;
|
||||
int delay_buffer_depth = 0;
|
||||
|
||||
bool is_device() const { return !device_identifier.empty(); }
|
||||
bool is_unbound() const { return device_identifier.empty() && index == 0xFF; }
|
||||
@@ -89,8 +87,6 @@ namespace overlay::windows {
|
||||
invert = a.getInvert();
|
||||
smoothing = a.getSmoothing();
|
||||
multiplier = a.getMultiplier();
|
||||
relative_mode = a.isRelativeMode();
|
||||
delay_buffer_depth = a.getDelayBufferDepth();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user