Fix vibration strength

This commit is contained in:
rebtd7 2021-03-09 18:11:22 -03:00
parent 0f979f605e
commit ab6ac13193
2 changed files with 3 additions and 3 deletions

View file

@ -412,7 +412,7 @@ void MainContext::FF13_2_CreateSetFrameRateCodeBlock()
}
void MainContext::PrintVersionInfo() {
PrintLog("FF13Fix 1.5.0 https://github.com/rebtd7/FF13Fix");
PrintLog("FF13Fix 1.5.1 https://github.com/rebtd7/FF13Fix");
}
bool MainContext::AreAlmostTheSame(float a, float b) {

View file

@ -48,8 +48,8 @@ void XInputManager::VibrationLoop()
const float vibrationStrengthLowFrequency = *vibration_address_low_frequency;
const float vibrationStrengthHighFrequency = *vibration_address_high_frequency;
if (vibrationStrengthLowFrequency > 0.01f || vibrationStrengthHighFrequency > 0.01f) {
const WORD leftMotorVibration = std::min((WORD)(vibrationStrengthFactor * vibrationStrengthLowFrequency * maxVibrationStrength), maxVibrationStrength);
const WORD rightMotorVibration = std::min((WORD)(vibrationStrengthFactor * vibrationStrengthHighFrequency * maxVibrationStrength), maxVibrationStrength);
const WORD leftMotorVibration = (WORD) (std::min(vibrationStrengthFactor * vibrationStrengthLowFrequency, 1.0f) * maxVibrationStrength);
const WORD rightMotorVibration = (WORD) (std::min(vibrationStrengthFactor * vibrationStrengthHighFrequency, 1.0f) * maxVibrationStrength);
SetControllerVibration(leftMotorVibration, rightMotorVibration);
wasVibrating = true;
}