Skip to content

Commit

Permalink
Snapturn: abs->glm::abs
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Dec 17, 2023
1 parent 1f15d07 commit 376286b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/mods/VR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ void VR::on_xinput_get_state(uint32_t* retval, uint32_t user_index, XINPUT_STATE
if (!m_was_snapturn_run_on_input) {
if (dpad_method == RIGHT_JOYSTICK) {
stick_axis = get_left_stick_axis().x;
if (abs(stick_axis) >= snapturn_deadzone) {
if (glm::abs(stick_axis) >= snapturn_deadzone) {
if (stick_axis < 0) {
m_snapturn_left = true;
}
Expand All @@ -908,7 +908,7 @@ void VR::on_xinput_get_state(uint32_t* retval, uint32_t user_index, XINPUT_STATE
}
else {
stick_axis = get_right_stick_axis().x;
if (abs(stick_axis) >= snapturn_deadzone && !(dpad_method == DPadMethod::LEFT_TOUCH && is_action_active_any_joystick(m_action_thumbrest_touch_left))) {
if (glm::abs(stick_axis) >= snapturn_deadzone && !(dpad_method == DPadMethod::LEFT_TOUCH && is_action_active_any_joystick(m_action_thumbrest_touch_left))) {
if (stick_axis < 0) {
m_snapturn_left = true;
}
Expand All @@ -919,15 +919,15 @@ void VR::on_xinput_get_state(uint32_t* retval, uint32_t user_index, XINPUT_STATE
}
else {
if (dpad_method == RIGHT_JOYSTICK) {
if (abs(get_left_stick_axis().x) < snapturn_deadzone) {
if (glm::abs(get_left_stick_axis().x) < snapturn_deadzone) {
m_was_snapturn_run_on_input = false;
} else {
state->Gamepad.sThumbLY = 0;
state->Gamepad.sThumbLX = 0;
}
}
else {
if (abs(get_right_stick_axis().x) < snapturn_deadzone) {
if (glm::abs(get_right_stick_axis().x) < snapturn_deadzone) {
m_was_snapturn_run_on_input = false;
} else {
state->Gamepad.sThumbRY = 0;
Expand Down

0 comments on commit 376286b

Please sign in to comment.