This commit is contained in:
thrust26 2020-03-26 22:23:06 +01:00
commit 474ba22e5e
3 changed files with 7 additions and 7 deletions

View File

@ -400,7 +400,8 @@ void Paddles::setAnalogYCenter(int ycenter)
float Paddles::setAnalogSensitivity(int sensitivity)
{
// BASE_ANALOG_SENSE * (1.1 ^ 20) = 1.0
SENSITIVITY = BASE_ANALOG_SENSE * std::pow(1.1, BSPF::clamp(sensitivity, 0, MAX_ANALOG_SENSE));
SENSITIVITY = BASE_ANALOG_SENSE * std::pow(1.1F,
static_cast<float>(BSPF::clamp(sensitivity, 0, MAX_ANALOG_SENSE)));
return SENSITIVITY;
}

View File

@ -48,7 +48,7 @@ class Paddles : public Controller
virtual ~Paddles() = default;
public:
static constexpr float BASE_ANALOG_SENSE = 0.148643628f;
static constexpr float BASE_ANALOG_SENSE = 0.148643628F;
static constexpr int MAX_ANALOG_SENSE = 30;
static constexpr int MIN_ANALOG_CENTER = -10;
static constexpr int MAX_ANALOG_CENTER = 30;
@ -95,14 +95,14 @@ class Paddles : public Controller
/**
Sets the x-center for analog paddles.
@param center Value from -10 to 30, representing the center offset/860
@param xcenter Value from -10 to 30, representing the center offset/860
*/
static void setAnalogXCenter(int xcenter);
/**
Sets the y-center for analog paddles.
@param center Value from -10 to 30, representing the center offset/860
@param ycenter Value from -10 to 30, representing the center offset/860
*/
static void setAnalogYCenter(int ycenter);

View File

@ -229,8 +229,7 @@ void InputDialog::addDevicePortTab()
void InputDialog::addMouseTab()
{
const int lineHeight = _font.getLineHeight(),
fontWidth = _font.getMaxCharWidth(),
fontHeight = _font.getFontHeight();
fontWidth = _font.getMaxCharWidth();
int ypos, lwidth, pwidth, tabID;
WidgetArray wid;
VariantList items;
@ -607,7 +606,7 @@ void InputDialog::handleCommand(CommandSender* sender, int cmd,
break;
case kPSpeedChanged:
myPaddleSpeed->setValueLabel(Paddles::setAnalogSensitivity(myPaddleSpeed->getValue()) * 100.0 + 0.5);
myPaddleSpeed->setValueLabel(Paddles::setAnalogSensitivity(myPaddleSpeed->getValue()) * 100.F + 0.5F);
break;
case kDejitterAvChanged: