Fix vibration strength
This commit is contained in:
parent
0f979f605e
commit
ab6ac13193
|
@ -412,7 +412,7 @@ void MainContext::FF13_2_CreateSetFrameRateCodeBlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainContext::PrintVersionInfo() {
|
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) {
|
bool MainContext::AreAlmostTheSame(float a, float b) {
|
||||||
|
|
|
@ -48,8 +48,8 @@ void XInputManager::VibrationLoop()
|
||||||
const float vibrationStrengthLowFrequency = *vibration_address_low_frequency;
|
const float vibrationStrengthLowFrequency = *vibration_address_low_frequency;
|
||||||
const float vibrationStrengthHighFrequency = *vibration_address_high_frequency;
|
const float vibrationStrengthHighFrequency = *vibration_address_high_frequency;
|
||||||
if (vibrationStrengthLowFrequency > 0.01f || vibrationStrengthHighFrequency > 0.01f) {
|
if (vibrationStrengthLowFrequency > 0.01f || vibrationStrengthHighFrequency > 0.01f) {
|
||||||
const WORD leftMotorVibration = std::min((WORD)(vibrationStrengthFactor * vibrationStrengthLowFrequency * maxVibrationStrength), maxVibrationStrength);
|
const WORD leftMotorVibration = (WORD) (std::min(vibrationStrengthFactor * vibrationStrengthLowFrequency, 1.0f) * maxVibrationStrength);
|
||||||
const WORD rightMotorVibration = std::min((WORD)(vibrationStrengthFactor * vibrationStrengthHighFrequency * maxVibrationStrength), maxVibrationStrength);
|
const WORD rightMotorVibration = (WORD) (std::min(vibrationStrengthFactor * vibrationStrengthHighFrequency, 1.0f) * maxVibrationStrength);
|
||||||
SetControllerVibration(leftMotorVibration, rightMotorVibration);
|
SetControllerVibration(leftMotorVibration, rightMotorVibration);
|
||||||
wasVibrating = true;
|
wasVibrating = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue