From ab6ac131930c5547b5765d1759623f7930c96a3d Mon Sep 17 00:00:00 2001 From: rebtd7 <59185507+rebtd7@users.noreply.github.com> Date: Tue, 9 Mar 2021 18:11:22 -0300 Subject: [PATCH] Fix vibration strength --- d3d9ex/AutoFix.cpp | 2 +- d3d9ex/XInputManager.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/d3d9ex/AutoFix.cpp b/d3d9ex/AutoFix.cpp index e6a3383..ee93d95 100644 --- a/d3d9ex/AutoFix.cpp +++ b/d3d9ex/AutoFix.cpp @@ -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) { diff --git a/d3d9ex/XInputManager.cpp b/d3d9ex/XInputManager.cpp index f34a59e..338c166 100644 --- a/d3d9ex/XInputManager.cpp +++ b/d3d9ex/XInputManager.cpp @@ -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; }