mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-06-26 12:26:18 +00:00
Updated C-style casts in kbm_gui.cpp
This commit is contained in:
parent
135bc0c020
commit
429c64a51b
1 changed files with 5 additions and 9 deletions
|
@ -414,7 +414,7 @@ void KBMSettings::SetUIValuestoMappings(std::string config_id) {
|
||||||
if (comma_pos != std::string::npos) {
|
if (comma_pos != std::string::npos) {
|
||||||
std::string DOstring = line.substr(equal_pos + 1, comma_pos);
|
std::string DOstring = line.substr(equal_pos + 1, comma_pos);
|
||||||
float DOffsetValue = std::stof(DOstring) * 100.0;
|
float DOffsetValue = std::stof(DOstring) * 100.0;
|
||||||
int DOffsetInt = int(DOffsetValue);
|
int DOffsetInt = static_cast<int>(DOffsetValue);
|
||||||
ui->DeadzoneOffsetSlider->setValue(DOffsetInt);
|
ui->DeadzoneOffsetSlider->setValue(DOffsetInt);
|
||||||
QString LabelValue = QString::number(DOffsetInt / 100.0, 'f', 2);
|
QString LabelValue = QString::number(DOffsetInt / 100.0, 'f', 2);
|
||||||
QString LabelString = tr("Deadzone Offset (def 0.50):") + " " + LabelValue;
|
QString LabelString = tr("Deadzone Offset (def 0.50):") + " " + LabelValue;
|
||||||
|
@ -424,12 +424,8 @@ void KBMSettings::SetUIValuestoMappings(std::string config_id) {
|
||||||
std::size_t comma_pos2 = SMSOstring.find(',');
|
std::size_t comma_pos2 = SMSOstring.find(',');
|
||||||
if (comma_pos2 != std::string::npos) {
|
if (comma_pos2 != std::string::npos) {
|
||||||
std::string SMstring = SMSOstring.substr(0, comma_pos2);
|
std::string SMstring = SMSOstring.substr(0, comma_pos2);
|
||||||
float SpeedMultValue = std::stof(SMstring) * 10.0;
|
float SpeedMultValue = std::clamp(std::stof(SMstring) * 10.0f, 1.0f, 50.0f);
|
||||||
int SpeedMultInt = int(SpeedMultValue);
|
int SpeedMultInt = static_cast<int>(SpeedMultValue);
|
||||||
if (SpeedMultInt < 1)
|
|
||||||
SpeedMultInt = 1;
|
|
||||||
if (SpeedMultInt > 50)
|
|
||||||
SpeedMultInt = 50;
|
|
||||||
ui->SpeedMultiplierSlider->setValue(SpeedMultInt);
|
ui->SpeedMultiplierSlider->setValue(SpeedMultInt);
|
||||||
LabelValue = QString::number(SpeedMultInt / 10.0, 'f', 1);
|
LabelValue = QString::number(SpeedMultInt / 10.0, 'f', 1);
|
||||||
LabelString = tr("Speed Multiplier (def 1.0):") + " " + LabelValue;
|
LabelString = tr("Speed Multiplier (def 1.0):") + " " + LabelValue;
|
||||||
|
@ -437,7 +433,7 @@ void KBMSettings::SetUIValuestoMappings(std::string config_id) {
|
||||||
|
|
||||||
std::string SOstring = SMSOstring.substr(comma_pos2 + 1);
|
std::string SOstring = SMSOstring.substr(comma_pos2 + 1);
|
||||||
float SOffsetValue = std::stof(SOstring) * 1000.0;
|
float SOffsetValue = std::stof(SOstring) * 1000.0;
|
||||||
int SOffsetInt = int(SOffsetValue);
|
int SOffsetInt = static_cast<int>(SOffsetValue);
|
||||||
ui->SpeedOffsetSlider->setValue(SOffsetInt);
|
ui->SpeedOffsetSlider->setValue(SOffsetInt);
|
||||||
LabelValue = QString::number(SOffsetInt / 1000.0, 'f', 3);
|
LabelValue = QString::number(SOffsetInt / 1000.0, 'f', 3);
|
||||||
LabelString = tr("Speed Offset (def 0.125):") + " " + LabelValue;
|
LabelString = tr("Speed Offset (def 0.125):") + " " + LabelValue;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue