From 2eb0d19a75a1764a6b3cc3e2a85b0a2cdf10725d Mon Sep 17 00:00:00 2001 From: Megamouse Date: Sun, 29 Aug 2021 08:39:16 +0200 Subject: [PATCH] input: rename some variables --- rpcs3/Emu/Io/PadHandler.cpp | 6 +++--- rpcs3/Input/evdev_joystick_handler.cpp | 16 ++++++++-------- rpcs3/Input/xinput_pad_handler.cpp | 10 +++++----- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/rpcs3/Emu/Io/PadHandler.cpp b/rpcs3/Emu/Io/PadHandler.cpp index 8556ba7c84..7069428852 100644 --- a/rpcs3/Emu/Io/PadHandler.cpp +++ b/rpcs3/Emu/Io/PadHandler.cpp @@ -548,7 +548,7 @@ void PadHandlerBase::get_mapping(const std::shared_ptr& device, const if (!device || !pad) return; - auto profile = device->config; + auto cfg = device->config; auto button_values = get_button_values(device); @@ -584,8 +584,8 @@ void PadHandlerBase::get_mapping(const std::shared_ptr& device, const u16 lx, ly, rx, ry; // Normalize and apply pad squircling - convert_stick_values(lx, ly, stick_val[0], stick_val[1], profile->lstickdeadzone, profile->lpadsquircling); - convert_stick_values(rx, ry, stick_val[2], stick_val[3], profile->rstickdeadzone, profile->rpadsquircling); + convert_stick_values(lx, ly, stick_val[0], stick_val[1], cfg->lstickdeadzone, cfg->lpadsquircling); + convert_stick_values(rx, ry, stick_val[2], stick_val[3], cfg->rstickdeadzone, cfg->rpadsquircling); if (m_type == pad_handler::ds4) { diff --git a/rpcs3/Input/evdev_joystick_handler.cpp b/rpcs3/Input/evdev_joystick_handler.cpp index 1bb335aef2..a4130e3c8d 100644 --- a/rpcs3/Input/evdev_joystick_handler.cpp +++ b/rpcs3/Input/evdev_joystick_handler.cpp @@ -848,13 +848,13 @@ void evdev_joystick_handler::get_mapping(const std::shared_ptr& devic m_dev->stick_val[idx] = m_dev->val_max[idx] - m_dev->val_min[idx]; } - const auto profile = m_dev->config; + const auto cfg = m_dev->config; u16 lx, ly, rx, ry; // Normalize and apply pad squircling - convert_stick_values(lx, ly, m_dev->stick_val[0], m_dev->stick_val[1], profile->lstickdeadzone, profile->lpadsquircling); - convert_stick_values(rx, ry, m_dev->stick_val[2], m_dev->stick_val[3], profile->rstickdeadzone, profile->rpadsquircling); + convert_stick_values(lx, ly, m_dev->stick_val[0], m_dev->stick_val[1], cfg->lstickdeadzone, cfg->lpadsquircling); + convert_stick_values(rx, ry, m_dev->stick_val[2], m_dev->stick_val[3], cfg->rstickdeadzone, cfg->rpadsquircling); pad->m_sticks[0].m_value = lx; pad->m_sticks[1].m_value = 255 - ly; @@ -870,13 +870,13 @@ void evdev_joystick_handler::apply_pad_data(const std::shared_ptr& de if (!evdev_device) return; - auto profile = device->config; + auto cfg = device->config; // Handle vibration - const int idx_l = profile->switch_vibration_motors ? 1 : 0; - const int idx_s = profile->switch_vibration_motors ? 0 : 1; - const u16 force_large = profile->enable_vibration_motor_large ? pad->m_vibrateMotors[idx_l].m_value * 257 : vibration_min; - const u16 force_small = profile->enable_vibration_motor_small ? pad->m_vibrateMotors[idx_s].m_value * 257 : vibration_min; + const int idx_l = cfg->switch_vibration_motors ? 1 : 0; + const int idx_s = cfg->switch_vibration_motors ? 0 : 1; + const u16 force_large = cfg->enable_vibration_motor_large ? pad->m_vibrateMotors[idx_l].m_value * 257 : vibration_min; + const u16 force_small = cfg->enable_vibration_motor_small ? pad->m_vibrateMotors[idx_s].m_value * 257 : vibration_min; SetRumble(evdev_device, force_large, force_small); } diff --git a/rpcs3/Input/xinput_pad_handler.cpp b/rpcs3/Input/xinput_pad_handler.cpp index 74825b2478..ae8e31bfed 100644 --- a/rpcs3/Input/xinput_pad_handler.cpp +++ b/rpcs3/Input/xinput_pad_handler.cpp @@ -519,15 +519,15 @@ void xinput_pad_handler::apply_pad_data(const std::shared_ptr& device return; const auto padnum = dev->deviceNumber; - const auto profile = dev->config; + const auto cfg = dev->config; // The left motor is the low-frequency rumble motor. The right motor is the high-frequency rumble motor. // The two motors are not the same, and they create different vibration effects. Values range between 0 to 65535. - const usz idx_l = profile->switch_vibration_motors ? 1 : 0; - const usz idx_s = profile->switch_vibration_motors ? 0 : 1; + const usz idx_l = cfg->switch_vibration_motors ? 1 : 0; + const usz idx_s = cfg->switch_vibration_motors ? 0 : 1; - const u16 speed_large = profile->enable_vibration_motor_large ? pad->m_vibrateMotors[idx_l].m_value : static_cast(vibration_min); - const u16 speed_small = profile->enable_vibration_motor_small ? pad->m_vibrateMotors[idx_s].m_value : static_cast(vibration_min); + const u16 speed_large = cfg->enable_vibration_motor_large ? pad->m_vibrateMotors[idx_l].m_value : static_cast(vibration_min); + const u16 speed_small = cfg->enable_vibration_motor_small ? pad->m_vibrateMotors[idx_s].m_value : static_cast(vibration_min); dev->newVibrateData |= dev->largeVibrate != speed_large || dev->smallVibrate != speed_small;