Skip to content

Commit

Permalink
Use stick_stroke_acceleration_transition_duration_milliseconds_
Browse files Browse the repository at this point in the history
  • Loading branch information
tekezo committed Oct 28, 2023
1 parent 7acad43 commit d1e2192
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ class game_pad_stick_converter final : public pqrs::dispatcher::extra::dispatche
const device_identifiers& device_identifiers) {
stick_stroke_release_detection_threshold_milliseconds_ = core_configuration.get_selected_profile().get_device_game_pad_stick_stroke_release_detection_threshold_milliseconds(device_identifiers);
stick_stroke_acceleration_measurement_duration_milliseconds_ = core_configuration.get_selected_profile().get_device_game_pad_stick_stroke_acceleration_measurement_duration_milliseconds_(device_identifiers);
stick_stroke_acceleration_transition_duration_milliseconds_ = core_configuration.get_selected_profile().get_device_game_pad_stick_stroke_acceleration_transition_duration_milliseconds(device_identifiers);

xy_stick_interval_milliseconds_formula_string_ = core_configuration.get_selected_profile().get_device_game_pad_xy_stick_interval_milliseconds_formula(device_identifiers);
wheels_stick_interval_milliseconds_formula_string_ = core_configuration.get_selected_profile().get_device_game_pad_wheels_stick_interval_milliseconds_formula(device_identifiers);
Expand Down Expand Up @@ -277,8 +278,8 @@ class game_pad_stick_converter final : public pqrs::dispatcher::extra::dispatche
}

if (stroke_acceleration_destination_value_changed) {
stroke_acceleration_transition_magnitude_ = std::abs(stroke_acceleration_destination_value_ - stroke_acceleration_transition_value_) /
(1000 / update_timer_interval_milliseconds);
auto divisor = std::max(1, stick_stroke_acceleration_transition_duration_milliseconds_ / update_timer_interval_milliseconds);
stroke_acceleration_transition_magnitude_ = std::abs(stroke_acceleration_destination_value_ - stroke_acceleration_transition_value_) / divisor;
}
}

Expand Down Expand Up @@ -332,8 +333,13 @@ class game_pad_stick_converter final : public pqrs::dispatcher::extra::dispatche
double previous_horizontal_value_;
double previous_vertical_value_;

//
// configurations
//

int stick_stroke_release_detection_threshold_milliseconds_;
int stick_stroke_acceleration_measurement_duration_milliseconds_;
int stick_stroke_acceleration_transition_duration_milliseconds_;
std::string xy_stick_interval_milliseconds_formula_string_;
std::string wheels_stick_interval_milliseconds_formula_string_;
std::string x_formula_string_;
Expand Down

0 comments on commit d1e2192

Please sign in to comment.