1
0
mirror of synced 2025-02-20 20:20:59 +01:00

Added FFBMode to be used global if enabled

This commit is contained in:
Aaron M 2019-11-02 17:30:14 +13:00
parent 648e97f891
commit 726b2ae87c

View File

@ -850,6 +850,7 @@ wchar_t* settingsFilename = TEXT(".\\FFBPlugin.ini");
int configMinForce = GetPrivateProfileInt(TEXT("Settings"), TEXT("MinForce"), 0, settingsFilename);
int configMaxForce = GetPrivateProfileInt(TEXT("Settings"), TEXT("MaxForce"), 100, settingsFilename);
int enableLogging = GetPrivateProfileInt(TEXT("Settings"), TEXT("Logging"), 0, settingsFilename);
int FFBMode = GetPrivateProfileInt(TEXT("Settings"), TEXT("FFBMode"), 0, settingsFilename);
int EnableRumble = GetPrivateProfileInt(TEXT("Settings"), TEXT("EnableRumble"), 0, settingsFilename);
int ReverseRumble = GetPrivateProfileInt(TEXT("Settings"), TEXT("ReverseRumble"), 0, settingsFilename);
wchar_t* deviceGUIDString = new wchar_t[256];
@ -1106,6 +1107,11 @@ void TriggerConstantEffect(int direction, double strength)
}
}
if (FFBMode == 1)
{
strength = pow(strength, 0.5);
}
SHORT MinForce = (SHORT)(strength > 0.001 ? (confMinForce / 100.0 * 32767.0) : 0);
SHORT MaxForce = (SHORT)(confMaxForce / 100.0 * 32767.0);
SHORT range = MaxForce - MinForce;