mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-03-09 23:14:46 +01:00
input/qt: fix default squircle value in text and remove duplicate comments
This commit is contained in:
parent
414df8432e
commit
1c5e30e83f
|
|
@ -24,13 +24,11 @@ std::set<u32> PadHandlerBase::narrow_set(const std::set<u64>& src)
|
|||
return dst;
|
||||
}
|
||||
|
||||
// Get new multiplied value based on the multiplier
|
||||
s32 PadHandlerBase::MultipliedInput(s32 raw_value, s32 multiplier)
|
||||
{
|
||||
return (multiplier * raw_value) / 100;
|
||||
}
|
||||
|
||||
// Get new scaled value between 0 and range based on its minimum and maximum
|
||||
f32 PadHandlerBase::ScaledInput(f32 raw_value, f32 minimum, f32 maximum, f32 deadzone, f32 range)
|
||||
{
|
||||
if (deadzone > 0 && deadzone > minimum)
|
||||
|
|
@ -46,7 +44,6 @@ f32 PadHandlerBase::ScaledInput(f32 raw_value, f32 minimum, f32 maximum, f32 dea
|
|||
return range * val;
|
||||
}
|
||||
|
||||
// Get new scaled value between -range and range based on its minimum and maximum
|
||||
f32 PadHandlerBase::ScaledAxisInput(f32 raw_value, f32 minimum, f32 maximum, f32 deadzone, f32 range)
|
||||
{
|
||||
// convert [min, max] to [0, 1]
|
||||
|
|
@ -79,7 +76,6 @@ f32 PadHandlerBase::ScaledAxisInput(f32 raw_value, f32 minimum, f32 maximum, f32
|
|||
return (2.0f * range * val) - range;
|
||||
}
|
||||
|
||||
// Get normalized trigger value based on the range defined by a threshold
|
||||
u16 PadHandlerBase::NormalizeTriggerInput(u16 value, u32 threshold) const
|
||||
{
|
||||
if (value <= threshold || threshold >= trigger_max)
|
||||
|
|
@ -90,8 +86,6 @@ u16 PadHandlerBase::NormalizeTriggerInput(u16 value, u32 threshold) const
|
|||
return static_cast<u16>(ScaledInput(static_cast<f32>(value), static_cast<f32>(trigger_min), static_cast<f32>(trigger_max), static_cast<f32>(threshold)));
|
||||
}
|
||||
|
||||
// normalizes a directed input, meaning it will correspond to a single "button" and not an axis with two directions
|
||||
// the input values must lie in 0+
|
||||
u16 PadHandlerBase::NormalizeDirectedInput(s32 raw_value, s32 threshold, s32 maximum) const
|
||||
{
|
||||
if (threshold >= maximum || maximum <= 0 || raw_value < 0)
|
||||
|
|
@ -114,9 +108,6 @@ u16 PadHandlerBase::NormalizeStickInput(u16 raw_value, s32 threshold, s32 multip
|
|||
return static_cast<u16>(ScaledInput(static_cast<f32>(scaled_value), 0.0f, static_cast<f32>(thumb_max), static_cast<f32>(threshold)));
|
||||
}
|
||||
|
||||
// This function normalizes stick deadzone based on the DS3's deadzone, which is ~13% (default of anti deadzone)
|
||||
// X and Y is expected to be in (-255) to 255 range, deadzone should be in terms of thumb stick range
|
||||
// return is new x and y values in 0-255 range
|
||||
std::tuple<u16, u16> PadHandlerBase::NormalizeStickDeadzone(s32 inX, s32 inY, u32 deadzone, u32 anti_deadzone) const
|
||||
{
|
||||
f32 X = inX / 255.0f;
|
||||
|
|
@ -150,28 +141,21 @@ std::tuple<u16, u16> PadHandlerBase::NormalizeStickDeadzone(s32 inX, s32 inY, u3
|
|||
return std::tuple<u16, u16>(ConvertAxis(X), ConvertAxis(Y));
|
||||
}
|
||||
|
||||
// get clamped value between 0 and 255
|
||||
u16 PadHandlerBase::Clamp0To255(f32 input)
|
||||
{
|
||||
return static_cast<u16>(std::clamp(input, 0.0f, 255.0f));
|
||||
}
|
||||
|
||||
// get clamped value between 0 and 1023
|
||||
u16 PadHandlerBase::Clamp0To1023(f32 input)
|
||||
{
|
||||
return static_cast<u16>(std::clamp(input, 0.0f, 1023.0f));
|
||||
}
|
||||
|
||||
// input has to be [-1,1]. result will be [0,255]
|
||||
u16 PadHandlerBase::ConvertAxis(f32 value)
|
||||
{
|
||||
return static_cast<u16>((value + 1.0) * (255.0 / 2.0));
|
||||
}
|
||||
|
||||
// The DS3, (and i think xbox controllers) give a 'square-ish' type response, so that the corners will give (almost)max x/y instead of the ~30x30 from a perfect circle
|
||||
// using a simple scale/sensitivity increase would *work* although it eats a chunk of our usable range in exchange
|
||||
// this might be the best for now, in practice it seems to push the corners to max of 20x20, with a squircle_factor of ~4000
|
||||
// This function assumes inX and inY is already in 0-255
|
||||
void PadHandlerBase::ConvertToSquirclePoint(u16& inX, u16& inY, u32 squircle_factor)
|
||||
{
|
||||
if (!squircle_factor)
|
||||
|
|
|
|||
|
|
@ -274,7 +274,7 @@ protected:
|
|||
// the input values must lie in 0+
|
||||
u16 NormalizeDirectedInput(s32 raw_value, s32 threshold, s32 maximum) const;
|
||||
|
||||
// This function normalizes stick deadzone based on the DS3's deadzone, which is ~13%
|
||||
// This function normalizes stick deadzone based on the DS3's deadzone, which is ~13% (default of anti deadzone)
|
||||
// X and Y is expected to be in (-255) to 255 range, deadzone should be in terms of thumb stick range
|
||||
// return is new x and y values in 0-255 range
|
||||
std::tuple<u16, u16> NormalizeStickDeadzone(s32 inX, s32 inY, u32 deadzone, u32 anti_deadzone) const;
|
||||
|
|
@ -284,10 +284,10 @@ public:
|
|||
// Get new multiplied value based on the multiplier
|
||||
static s32 MultipliedInput(s32 raw_value, s32 multiplier);
|
||||
|
||||
// Get new scaled value between 0 and 255 based on its minimum and maximum
|
||||
// Get new scaled value between 0 and range based on its minimum and maximum
|
||||
static f32 ScaledInput(f32 raw_value, f32 minimum, f32 maximum, f32 deadzone, f32 range = 255.0f);
|
||||
|
||||
// Get new scaled value between -255 and 255 based on its minimum and maximum
|
||||
// Get new scaled value between -range and range based on its minimum and maximum
|
||||
static f32 ScaledAxisInput(f32 raw_value, f32 minimum, f32 maximum, f32 deadzone, f32 range = 255.0f);
|
||||
|
||||
// get clamped value between 0 and 255
|
||||
|
|
@ -301,7 +301,7 @@ public:
|
|||
|
||||
// The DS3, (and i think xbox controllers) give a 'square-ish' type response, so that the corners will give (almost)max x/y instead of the ~30x30 from a perfect circle
|
||||
// using a simple scale/sensitivity increase would *work* although it eats a chunk of our usable range in exchange
|
||||
// this might be the best for now, in practice it seems to push the corners to max of 20x20, with a squircle_factor of 8000
|
||||
// this might be the best for now, in practice it seems to push the corners to max of 20x20, with a squircle_factor of ~4000
|
||||
// This function assumes inX and inY is already in 0-255
|
||||
static void ConvertToSquirclePoint(u16& inX, u16& inY, u32 squircle_factor);
|
||||
|
||||
|
|
|
|||
|
|
@ -302,7 +302,7 @@ public:
|
|||
const QString analog_limiter = tr("Applies the stick multipliers while this special button is pressed.<br>Enable \"Toggle\" if you want to toggle the analog limiter on button press instead.<br>If no button has been assigned, the stick multipliers are always applied.");
|
||||
const QString pressure_intensity = tr("Controls the intensity of pressure sensitive buttons while this special button is pressed.<br>Enable \"Toggle\" if you want to toggle the intensity on button press instead.<br>Use the percentage to change how hard you want to press a button.");
|
||||
const QString pressure_deadzone = tr("Controls the deadzone of pressure sensitive buttons. It determines how far the button has to be pressed until it is recognized by the game. The resulting range will be projected onto the full button sensitivity range.");
|
||||
const QString squircle_factor = tr("The actual DualShock 3's stick range is not circular but formed like a rounded square (or squircle) which represents the maximum range of the emulated sticks. You can use the squircle values to modify the stick input if your sticks can't reach the corners of that range. A value of 0 does not apply any so called squircling. A value of 8000 is usually recommended.");
|
||||
const QString squircle_factor = tr("The actual DualShock 3's stick range is not circular but formed like a rounded square (or squircle) which represents the maximum range of the emulated sticks. You can use the squircle values to modify the stick input if your sticks can't reach the corners of that range. A value of 0 does not apply any so called squircling. A value of 4000 is usually recommended.");
|
||||
const QString stick_multiplier = tr("The stick multipliers can be used to change the sensitivity of your stick movements.<br>The default setting is 1 and represents normal input.");
|
||||
const QString stick_deadzones = tr("A stick's deadzone determines how far the stick has to be moved until it is fully recognized by the game. The resulting range will be projected onto the full input range in order to give you a smooth experience. Movement inside the deadzone is simulated using the anti-deadzone slider (default is 13%), so don't worry if there is still movement shown in the emulated stick preview.");
|
||||
const QString vibration = tr("The PS3 activates two motors (large and small) to handle controller vibrations.<br>You can enable, disable or even switch these signals for the currently selected pad here.<br>The game sends values from 0-255 to activate the motors.<br>Any value smaller or equal the threshold will be set to 0. This is 63 by default for pad handlers other than DualShock3 in order to emulate the DualShock3's behavior.");
|
||||
|
|
|
|||
Loading…
Reference in a new issue