Revert EnableRumble
This commit is contained in:
parent
2e3f8f2149
commit
d816224f72
@ -21,7 +21,7 @@ MaxForce=100
|
|||||||
; Set Device GUID to connect to specific joystick or controller.
|
; Set Device GUID to connect to specific joystick or controller.
|
||||||
DeviceGUID=
|
DeviceGUID=
|
||||||
;Set to 1 if you want to enable rumble, else 0.
|
;Set to 1 if you want to enable rumble, else 0.
|
||||||
FFBorRumble=0
|
EnableRumble=0
|
||||||
ReverseRumble=0
|
ReverseRumble=0
|
||||||
; Set to 1 to generate log.txt, else 0. Logs will be appended and not cleared.
|
; Set to 1 to generate log.txt, else 0. Logs will be appended and not cleared.
|
||||||
Logging=0
|
Logging=0
|
||||||
@ -91,7 +91,7 @@ GearChangeLength=80
|
|||||||
|
|
||||||
[AfterburnerClimax]
|
[AfterburnerClimax]
|
||||||
GameId=15
|
GameId=15
|
||||||
FFBorRumble=1
|
EnableRumble=1
|
||||||
Rumble1Strength=50
|
Rumble1Strength=50
|
||||||
Rumble2Strength=100
|
Rumble2Strength=100
|
||||||
Rumble1Length=200
|
Rumble1Length=200
|
||||||
@ -100,7 +100,7 @@ Rumble2Length=200
|
|||||||
[HOTD4]
|
[HOTD4]
|
||||||
GameId=4
|
GameId=4
|
||||||
FeedbackLength=100
|
FeedbackLength=100
|
||||||
FFBorRumble=1
|
EnableRumble=1
|
||||||
Device2GUID=
|
Device2GUID=
|
||||||
Bullet1pStrength=50
|
Bullet1pStrength=50
|
||||||
Grenade1pStrength=70
|
Grenade1pStrength=70
|
||||||
@ -115,7 +115,7 @@ HowtoRumbleHealthEffect=0
|
|||||||
[LGI]
|
[LGI]
|
||||||
GameId=31
|
GameId=31
|
||||||
FeedbackLength=100
|
FeedbackLength=100
|
||||||
FFBorRumble=1
|
EnableRumble=1
|
||||||
Device2GUID=
|
Device2GUID=
|
||||||
Knock1pStrength=50
|
Knock1pStrength=50
|
||||||
Motor1pStrength=60
|
Motor1pStrength=60
|
||||||
@ -130,7 +130,7 @@ HowtoRumbleHealthEffect=0
|
|||||||
[LGI3D]
|
[LGI3D]
|
||||||
GameId=30
|
GameId=30
|
||||||
FeedbackLength=100
|
FeedbackLength=100
|
||||||
FFBorRumble=1
|
EnableRumble=1
|
||||||
Device2GUID=
|
Device2GUID=
|
||||||
Knock1pStrength=50
|
Knock1pStrength=50
|
||||||
Motor1pStrength=60
|
Motor1pStrength=60
|
||||||
@ -200,7 +200,7 @@ MaxForce=100
|
|||||||
|
|
||||||
[Machstorm]
|
[Machstorm]
|
||||||
GameId=14
|
GameId=14
|
||||||
FFBorRumble=1
|
EnableRumble=1
|
||||||
Power1RumbleStrength=10
|
Power1RumbleStrength=10
|
||||||
Power2RumbleStrength=20
|
Power2RumbleStrength=20
|
||||||
Power3RumbleStrength=30
|
Power3RumbleStrength=30
|
||||||
@ -224,7 +224,7 @@ Power10RumbleLength=100
|
|||||||
|
|
||||||
[PokkenTournament]
|
[PokkenTournament]
|
||||||
GameId=19
|
GameId=19
|
||||||
FFBorRumble=1
|
EnableRumble=1
|
||||||
RumbleStrength=100
|
RumbleStrength=100
|
||||||
RumbleLength=500
|
RumbleLength=500
|
||||||
HowtoRumble=0
|
HowtoRumble=0
|
||||||
@ -397,7 +397,7 @@ leverRightDevice2=99
|
|||||||
|
|
||||||
[Button Rumble 32bit]
|
[Button Rumble 32bit]
|
||||||
GameId=28
|
GameId=28
|
||||||
FFBorRumble=1
|
EnableRumble=1
|
||||||
ShowButtonNumbersForSetup=0
|
ShowButtonNumbersForSetup=0
|
||||||
BothRumbleMotor=1
|
BothRumbleMotor=1
|
||||||
LeftRumbleMotor=0
|
LeftRumbleMotor=0
|
||||||
@ -428,7 +428,7 @@ Button10Device2Rumble=99
|
|||||||
|
|
||||||
[Button Rumble 64bit]
|
[Button Rumble 64bit]
|
||||||
GameId=28
|
GameId=28
|
||||||
FFBorRumble=1
|
EnableRumble=1
|
||||||
ShowButtonNumbersForSetup=0
|
ShowButtonNumbersForSetup=0
|
||||||
BothRumbleMotor=1
|
BothRumbleMotor=1
|
||||||
LeftRumbleMotor=0
|
LeftRumbleMotor=0
|
||||||
|
148
DllMain.cpp
148
DllMain.cpp
@ -850,7 +850,7 @@ wchar_t *settingsFilename = TEXT(".\\FFBPlugin.ini");
|
|||||||
int configMinForce = GetPrivateProfileInt(TEXT("Settings"), TEXT("MinForce"), 0, settingsFilename);
|
int configMinForce = GetPrivateProfileInt(TEXT("Settings"), TEXT("MinForce"), 0, settingsFilename);
|
||||||
int configMaxForce = GetPrivateProfileInt(TEXT("Settings"), TEXT("MaxForce"), 100, settingsFilename);
|
int configMaxForce = GetPrivateProfileInt(TEXT("Settings"), TEXT("MaxForce"), 100, settingsFilename);
|
||||||
int enableLogging = GetPrivateProfileInt(TEXT("Settings"), TEXT("Logging"), 0, settingsFilename);
|
int enableLogging = GetPrivateProfileInt(TEXT("Settings"), TEXT("Logging"), 0, settingsFilename);
|
||||||
int FFBorRumble = GetPrivateProfileInt(TEXT("Settings"), TEXT("FFBorRumble"), 0, settingsFilename);
|
int EnableRumble = GetPrivateProfileInt(TEXT("Settings"), TEXT("EnableRumble"), 0, settingsFilename);
|
||||||
int ReverseRumble = GetPrivateProfileInt(TEXT("Settings"), TEXT("ReverseRumble"), 0, settingsFilename);
|
int ReverseRumble = GetPrivateProfileInt(TEXT("Settings"), TEXT("ReverseRumble"), 0, settingsFilename);
|
||||||
wchar_t *deviceGUIDString = new wchar_t[256];
|
wchar_t *deviceGUIDString = new wchar_t[256];
|
||||||
int DeviceGUID = GetPrivateProfileString(TEXT("Settings"), TEXT("DeviceGUID"), NULL, deviceGUIDString, 256, settingsFilename);
|
int DeviceGUID = GetPrivateProfileString(TEXT("Settings"), TEXT("DeviceGUID"), NULL, deviceGUIDString, 256, settingsFilename);
|
||||||
@ -982,7 +982,7 @@ void Initialize(int device_index)
|
|||||||
hlp.log(firstJoystickSelectedText);
|
hlp.log(firstJoystickSelectedText);
|
||||||
}
|
}
|
||||||
haptic = ControllerHaptic;
|
haptic = ControllerHaptic;
|
||||||
if ((SDL_HapticRumbleSupported(haptic) == SDL_TRUE && FFBorRumble == 1))
|
if ((SDL_HapticRumbleSupported(haptic) == SDL_TRUE && EnableRumble == 1))
|
||||||
{
|
{
|
||||||
SDL_HapticRumbleInit(ControllerHaptic);
|
SDL_HapticRumbleInit(ControllerHaptic);
|
||||||
hlp.log("Rumble Init");
|
hlp.log("Rumble Init");
|
||||||
@ -1080,8 +1080,6 @@ std::chrono::milliseconds timeOfLastSineEffect = duration_cast<milliseconds>(sys
|
|||||||
double lastSineEffectStrength = 0;
|
double lastSineEffectStrength = 0;
|
||||||
double lastSineEffectPeriod = 0;
|
double lastSineEffectPeriod = 0;
|
||||||
void TriggerConstantEffect(int direction, double strength)
|
void TriggerConstantEffect(int direction, double strength)
|
||||||
{
|
|
||||||
if (FFBorRumble == 0)
|
|
||||||
{
|
{
|
||||||
SDL_HapticEffect tempEffect;
|
SDL_HapticEffect tempEffect;
|
||||||
SDL_memset(&tempEffect, 0, sizeof(SDL_HapticEffect));
|
SDL_memset(&tempEffect, 0, sizeof(SDL_HapticEffect));
|
||||||
@ -1127,11 +1125,8 @@ void TriggerConstantEffect(int direction, double strength)
|
|||||||
SDL_HapticUpdateEffect(haptic, effects.effect_constant_id, &tempEffect);
|
SDL_HapticUpdateEffect(haptic, effects.effect_constant_id, &tempEffect);
|
||||||
SDL_HapticRunEffect(haptic, effects.effect_constant_id, 1);
|
SDL_HapticRunEffect(haptic, effects.effect_constant_id, 1);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void TriggerFrictionEffectWithDefaultOption(double strength, bool isDefault)
|
void TriggerFrictionEffectWithDefaultOption(double strength, bool isDefault)
|
||||||
{
|
|
||||||
if (FFBorRumble == 0)
|
|
||||||
{
|
{
|
||||||
SDL_HapticEffect tempEffect;
|
SDL_HapticEffect tempEffect;
|
||||||
SDL_memset(&tempEffect, 0, sizeof(SDL_HapticEffect));
|
SDL_memset(&tempEffect, 0, sizeof(SDL_HapticEffect));
|
||||||
@ -1157,11 +1152,8 @@ void TriggerFrictionEffectWithDefaultOption(double strength, bool isDefault)
|
|||||||
SDL_HapticUpdateEffect(haptic, effects.effect_friction_id, &tempEffect);
|
SDL_HapticUpdateEffect(haptic, effects.effect_friction_id, &tempEffect);
|
||||||
SDL_HapticRunEffect(haptic, effects.effect_friction_id, 1);
|
SDL_HapticRunEffect(haptic, effects.effect_friction_id, 1);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void TriggerInertiaEffect(double strength)
|
void TriggerInertiaEffect(double strength)
|
||||||
{
|
|
||||||
if (FFBorRumble == 0)
|
|
||||||
{
|
{
|
||||||
SDL_HapticEffect tempEffect;
|
SDL_HapticEffect tempEffect;
|
||||||
SDL_memset(&tempEffect, 0, sizeof(SDL_HapticEffect));
|
SDL_memset(&tempEffect, 0, sizeof(SDL_HapticEffect));
|
||||||
@ -1190,10 +1182,10 @@ void TriggerInertiaEffect(double strength)
|
|||||||
SDL_HapticUpdateEffect(haptic, effects.effect_inertia_id, &tempEffect);
|
SDL_HapticUpdateEffect(haptic, effects.effect_inertia_id, &tempEffect);
|
||||||
SDL_HapticRunEffect(haptic, effects.effect_inertia_id, 1);
|
SDL_HapticRunEffect(haptic, effects.effect_inertia_id, 1);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void TriggerTriangleEffect(double strength, double length)
|
void TriggerTriangleEffect(double strength, double length)
|
||||||
{
|
{
|
||||||
|
<<<<<<< HEAD
|
||||||
if (FFBorRumble == 0)
|
if (FFBorRumble == 0)
|
||||||
{
|
{
|
||||||
int direction = 1;
|
int direction = 1;
|
||||||
@ -1201,6 +1193,13 @@ void TriggerTriangleEffect(double strength, double length)
|
|||||||
strength *= -1;
|
strength *= -1;
|
||||||
direction = -1;
|
direction = -1;
|
||||||
}
|
}
|
||||||
|
=======
|
||||||
|
int direction = 1;
|
||||||
|
if (strength <= -0.001) {
|
||||||
|
strength *= -1;
|
||||||
|
direction = -1;
|
||||||
|
}
|
||||||
|
>>>>>>> parent of 779758b... Now Choose FFB or Rumble
|
||||||
|
|
||||||
SDL_HapticEffect tempEffect;
|
SDL_HapticEffect tempEffect;
|
||||||
SDL_memset(&tempEffect, 0, sizeof(SDL_HapticEffect));
|
SDL_memset(&tempEffect, 0, sizeof(SDL_HapticEffect));
|
||||||
@ -1246,11 +1245,8 @@ void TriggerTriangleEffect(double strength, double length)
|
|||||||
SDL_HapticUpdateEffect(haptic, effects.effect_triangle_id, &tempEffect);
|
SDL_HapticUpdateEffect(haptic, effects.effect_triangle_id, &tempEffect);
|
||||||
SDL_HapticRunEffect(haptic, effects.effect_triangle_id, 1);
|
SDL_HapticRunEffect(haptic, effects.effect_triangle_id, 1);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void TriggerDamperEffect(double strength)
|
void TriggerDamperEffect(double strength)
|
||||||
{
|
|
||||||
if (FFBorRumble == 0)
|
|
||||||
{
|
{
|
||||||
SDL_HapticEffect tempEffect;
|
SDL_HapticEffect tempEffect;
|
||||||
SDL_memset(&tempEffect, 0, sizeof(SDL_HapticEffect));
|
SDL_memset(&tempEffect, 0, sizeof(SDL_HapticEffect));
|
||||||
@ -1278,11 +1274,8 @@ void TriggerDamperEffect(double strength)
|
|||||||
SDL_HapticUpdateEffect(haptic, effects.effect_damper_id, &tempEffect);
|
SDL_HapticUpdateEffect(haptic, effects.effect_damper_id, &tempEffect);
|
||||||
SDL_HapticRunEffect(haptic, effects.effect_damper_id, 1);
|
SDL_HapticRunEffect(haptic, effects.effect_damper_id, 1);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void TriggerRampEffect(double start,double end,double length)
|
void TriggerRampEffect(double start,double end,double length)
|
||||||
{
|
|
||||||
if (FFBorRumble == 0)
|
|
||||||
{
|
{
|
||||||
SDL_HapticEffect tempEffect;
|
SDL_HapticEffect tempEffect;
|
||||||
SDL_memset(&tempEffect, 0, sizeof(SDL_HapticEffect));
|
SDL_memset(&tempEffect, 0, sizeof(SDL_HapticEffect));
|
||||||
@ -1313,11 +1306,8 @@ void TriggerRampEffect(double start,double end,double length)
|
|||||||
SDL_HapticUpdateEffect(haptic, effects.effect_ramp_id, &tempEffect);
|
SDL_HapticUpdateEffect(haptic, effects.effect_ramp_id, &tempEffect);
|
||||||
SDL_HapticRunEffect(haptic, effects.effect_ramp_id, 1);
|
SDL_HapticRunEffect(haptic, effects.effect_ramp_id, 1);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void TriggerSawtoothUpEffect(double strength, double length)
|
void TriggerSawtoothUpEffect(double strength, double length)
|
||||||
{
|
|
||||||
if (FFBorRumble == 0)
|
|
||||||
{
|
{
|
||||||
SDL_HapticEffect tempEffect;
|
SDL_HapticEffect tempEffect;
|
||||||
SDL_memset(&tempEffect, 0, sizeof(SDL_HapticEffect));
|
SDL_memset(&tempEffect, 0, sizeof(SDL_HapticEffect));
|
||||||
@ -1341,12 +1331,8 @@ void TriggerSawtoothUpEffect(double strength, double length)
|
|||||||
SDL_HapticUpdateEffect(haptic, effects.effect_sawtoothup_id, &tempEffect);
|
SDL_HapticUpdateEffect(haptic, effects.effect_sawtoothup_id, &tempEffect);
|
||||||
SDL_HapticRunEffect(haptic, effects.effect_sawtoothup_id, 1);
|
SDL_HapticRunEffect(haptic, effects.effect_sawtoothup_id, 1);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void TriggerSawtoothDownEffect(double strength, double length)
|
void TriggerSawtoothDownEffect(double strength, double length) {
|
||||||
{
|
|
||||||
if (FFBorRumble == 0)
|
|
||||||
{
|
|
||||||
SDL_HapticEffect tempEffect;
|
SDL_HapticEffect tempEffect;
|
||||||
SDL_memset(&tempEffect, 0, sizeof(SDL_HapticEffect));
|
SDL_memset(&tempEffect, 0, sizeof(SDL_HapticEffect));
|
||||||
tempEffect.type = SDL_HAPTIC_SAWTOOTHDOWN;
|
tempEffect.type = SDL_HAPTIC_SAWTOOTHDOWN;
|
||||||
@ -1369,23 +1355,18 @@ void TriggerSawtoothDownEffect(double strength, double length)
|
|||||||
SDL_HapticUpdateEffect(haptic, effects.effect_sawtoothdown_id, &tempEffect);
|
SDL_HapticUpdateEffect(haptic, effects.effect_sawtoothdown_id, &tempEffect);
|
||||||
SDL_HapticRunEffect(haptic, effects.effect_sawtoothdown_id, 1);
|
SDL_HapticRunEffect(haptic, effects.effect_sawtoothdown_id, 1);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void TriggerFrictionEffect(double strength)
|
void TriggerFrictionEffect(double strength)
|
||||||
{
|
|
||||||
if (FFBorRumble == 0)
|
|
||||||
{
|
{
|
||||||
TriggerFrictionEffectWithDefaultOption(strength, false);
|
TriggerFrictionEffectWithDefaultOption(strength, false);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void TriggerSineEffect(UINT16 period, UINT16 fadePeriod, double strength)
|
void TriggerSineEffect(UINT16 period, UINT16 fadePeriod, double strength)
|
||||||
{
|
|
||||||
if (FFBorRumble == 0)
|
|
||||||
{
|
{
|
||||||
std::chrono::milliseconds now = duration_cast<milliseconds>(system_clock::now().time_since_epoch());
|
std::chrono::milliseconds now = duration_cast<milliseconds>(system_clock::now().time_since_epoch());
|
||||||
long long elapsedTime = (std::chrono::duration_cast<std::chrono::milliseconds>(now - timeOfLastSineEffect)).count();
|
long long elapsedTime = (std::chrono::duration_cast<std::chrono::milliseconds>(now - timeOfLastSineEffect)).count();
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
int direction = 1;
|
int direction = 1;
|
||||||
if (strength < -0.001) {
|
if (strength < -0.001) {
|
||||||
strength *= -1;
|
strength *= -1;
|
||||||
@ -1401,6 +1382,23 @@ void TriggerSineEffect(UINT16 period, UINT16 fadePeriod, double strength)
|
|||||||
if (elapsedTime < lastSineEffectPeriod && strength < (lastSineEffectStrength * 1.5)) {
|
if (elapsedTime < lastSineEffectPeriod && strength < (lastSineEffectStrength * 1.5)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
=======
|
||||||
|
int direction = 1;
|
||||||
|
if (strength <= -0.001) {
|
||||||
|
strength *= -1;
|
||||||
|
direction = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// we ignore the new effect until the last one is completed, unless the new one is significantly stronger
|
||||||
|
if (elapsedTime < lastSineEffectPeriod && strength < (lastSineEffectStrength * 2.0)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// if no strength, we do nothing
|
||||||
|
if (strength <= 0.001) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
>>>>>>> parent of 779758b... Now Choose FFB or Rumble
|
||||||
|
|
||||||
SDL_HapticEffect tempEffect;
|
SDL_HapticEffect tempEffect;
|
||||||
SDL_memset(&tempEffect, 0, sizeof(SDL_HapticEffect));
|
SDL_memset(&tempEffect, 0, sizeof(SDL_HapticEffect));
|
||||||
@ -1454,11 +1452,8 @@ void TriggerSineEffect(UINT16 period, UINT16 fadePeriod, double strength)
|
|||||||
lastSineEffectStrength = strength;
|
lastSineEffectStrength = strength;
|
||||||
lastSineEffectPeriod = period;
|
lastSineEffectPeriod = period;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void TriggerSpringEffectWithDefaultOption(double strength, bool isDefault)
|
void TriggerSpringEffectWithDefaultOption(double strength, bool isDefault)
|
||||||
{
|
|
||||||
if (FFBorRumble == 0)
|
|
||||||
{
|
{
|
||||||
SDL_HapticEffect tempEffect;
|
SDL_HapticEffect tempEffect;
|
||||||
SDL_memset(&tempEffect, 0, sizeof(SDL_HapticEffect));
|
SDL_memset(&tempEffect, 0, sizeof(SDL_HapticEffect));
|
||||||
@ -1488,11 +1483,8 @@ void TriggerSpringEffectWithDefaultOption(double strength, bool isDefault)
|
|||||||
SDL_HapticUpdateEffect(haptic, effects.effect_spring_id, &tempEffect);
|
SDL_HapticUpdateEffect(haptic, effects.effect_spring_id, &tempEffect);
|
||||||
SDL_HapticRunEffect(haptic, effects.effect_spring_id, 1);
|
SDL_HapticRunEffect(haptic, effects.effect_spring_id, 1);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void TriggerSpringEffectInfinite(double strength)
|
void TriggerSpringEffectInfinite(double strength)
|
||||||
{
|
|
||||||
if (FFBorRumble == 0)
|
|
||||||
{
|
{
|
||||||
SDL_HapticEffect tempEffect;
|
SDL_HapticEffect tempEffect;
|
||||||
SDL_memset(&tempEffect, 0, sizeof(SDL_HapticEffect));
|
SDL_memset(&tempEffect, 0, sizeof(SDL_HapticEffect));
|
||||||
@ -1523,30 +1515,12 @@ void TriggerSpringEffectInfinite(double strength)
|
|||||||
SDL_HapticUpdateEffect(haptic, effects.effect_spring_id, &tempEffect);
|
SDL_HapticUpdateEffect(haptic, effects.effect_spring_id, &tempEffect);
|
||||||
SDL_HapticRunEffect(haptic, effects.effect_spring_id, 1);
|
SDL_HapticRunEffect(haptic, effects.effect_spring_id, 1);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void TriggerLeftRightEffect(double smallstrength, double largestrength, double length)
|
void TriggerLeftRightEffect(double smallstrength, double largestrength, double length)
|
||||||
{
|
{
|
||||||
if (FFBorRumble == 1)
|
if (EnableRumble == 1)
|
||||||
{
|
{
|
||||||
if (ReverseRumble == 1)
|
if (ReverseRumble == 0)
|
||||||
{
|
|
||||||
SDL_HapticEffect tempEffect;
|
|
||||||
tempEffect.type = SDL_HAPTIC_LEFTRIGHT;
|
|
||||||
tempEffect.leftright.length = length;
|
|
||||||
SHORT minForce = (SHORT)(largestrength > 0.001 ? (configMinForce / 100.0 * 32767.0) : 0); // strength is a double so we do an epsilon check of 0.001 instead of > 0.
|
|
||||||
SHORT maxForce = (SHORT)(configMaxForce / 100.0 * 32767.0);
|
|
||||||
SHORT range = maxForce - minForce;
|
|
||||||
tempEffect.leftright.small_magnitude = (SHORT)(largestrength * range + minForce);
|
|
||||||
SHORT minForce1 = (SHORT)(smallstrength > 0.001 ? (configMinForce / 100.0 * 32767.0) : 0); // strength is a double so we do an epsilon check of 0.001 instead of > 0.
|
|
||||||
SHORT maxForce1 = (SHORT)(configMaxForce / 100.0 * 32767.0);
|
|
||||||
SHORT range1 = maxForce1 - minForce1;
|
|
||||||
tempEffect.leftright.large_magnitude = (SHORT)(smallstrength * range1 + minForce1);
|
|
||||||
SDL_HapticUpdateEffect(haptic, effects.effect_leftright_id, &tempEffect);
|
|
||||||
SDL_HapticRunEffect(haptic, effects.effect_leftright_id, 1);
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
SDL_HapticEffect tempEffect;
|
SDL_HapticEffect tempEffect;
|
||||||
tempEffect.type = SDL_HAPTIC_LEFTRIGHT;
|
tempEffect.type = SDL_HAPTIC_LEFTRIGHT;
|
||||||
@ -1562,31 +1536,30 @@ void TriggerLeftRightEffect(double smallstrength, double largestrength, double l
|
|||||||
SDL_HapticUpdateEffect(haptic, effects.effect_leftright_id, &tempEffect);
|
SDL_HapticUpdateEffect(haptic, effects.effect_leftright_id, &tempEffect);
|
||||||
SDL_HapticRunEffect(haptic, effects.effect_leftright_id, 1);
|
SDL_HapticRunEffect(haptic, effects.effect_leftright_id, 1);
|
||||||
}
|
}
|
||||||
|
else if (ReverseRumble == 1)
|
||||||
|
{
|
||||||
|
SDL_HapticEffect tempEffect;
|
||||||
|
tempEffect.type = SDL_HAPTIC_LEFTRIGHT;
|
||||||
|
tempEffect.leftright.length = length;
|
||||||
|
SHORT minForce = (SHORT)(largestrength > 0.001 ? (configMinForce / 100.0 * 32767.0) : 0); // strength is a double so we do an epsilon check of 0.001 instead of > 0.
|
||||||
|
SHORT maxForce = (SHORT)(configMaxForce / 100.0 * 32767.0);
|
||||||
|
SHORT range = maxForce - minForce;
|
||||||
|
tempEffect.leftright.small_magnitude = (SHORT)(largestrength * range + minForce);
|
||||||
|
SHORT minForce1 = (SHORT)(smallstrength > 0.001 ? (configMinForce / 100.0 * 32767.0) : 0); // strength is a double so we do an epsilon check of 0.001 instead of > 0.
|
||||||
|
SHORT maxForce1 = (SHORT)(configMaxForce / 100.0 * 32767.0);
|
||||||
|
SHORT range1 = maxForce1 - minForce1;
|
||||||
|
tempEffect.leftright.large_magnitude = (SHORT)(smallstrength * range1 + minForce1);
|
||||||
|
SDL_HapticUpdateEffect(haptic, effects.effect_leftright_id, &tempEffect);
|
||||||
|
SDL_HapticRunEffect(haptic, effects.effect_leftright_id, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TriggerLeftRightDevice2Effect(double smallstrength, double largestrength, double length)
|
void TriggerLeftRightDevice2Effect(double smallstrength, double largestrength, double length)
|
||||||
{
|
{
|
||||||
if (FFBorRumble == 1)
|
if (EnableRumble == 1)
|
||||||
{
|
{
|
||||||
if (ReverseRumble == 1)
|
if (ReverseRumble == 0)
|
||||||
{
|
|
||||||
SDL_HapticEffect tempEffect;
|
|
||||||
tempEffect.type = SDL_HAPTIC_LEFTRIGHT;
|
|
||||||
tempEffect.leftright.length = length;
|
|
||||||
SHORT minForce = (SHORT)(largestrength > 0.001 ? (configMinForce / 100.0 * 32767.0) : 0); // strength is a double so we do an epsilon check of 0.001 instead of > 0.
|
|
||||||
SHORT maxForce = (SHORT)(configMaxForce / 100.0 * 32767.0);
|
|
||||||
SHORT range = maxForce - minForce;
|
|
||||||
tempEffect.leftright.small_magnitude = (SHORT)(largestrength * range + minForce);
|
|
||||||
SHORT minForce1 = (SHORT)(smallstrength > 0.001 ? (configMinForce / 100.0 * 32767.0) : 0); // strength is a double so we do an epsilon check of 0.001 instead of > 0.
|
|
||||||
SHORT maxForce1 = (SHORT)(configMaxForce / 100.0 * 32767.0);
|
|
||||||
SHORT range1 = maxForce1 - minForce1;
|
|
||||||
tempEffect.leftright.large_magnitude = (SHORT)(smallstrength * range1 + minForce1);
|
|
||||||
SDL_HapticUpdateEffect(haptic2, effects.effect_leftright_id, &tempEffect);
|
|
||||||
SDL_HapticRunEffect(haptic2, effects.effect_leftright_id, 1);
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
SDL_HapticEffect tempEffect;
|
SDL_HapticEffect tempEffect;
|
||||||
tempEffect.type = SDL_HAPTIC_LEFTRIGHT;
|
tempEffect.type = SDL_HAPTIC_LEFTRIGHT;
|
||||||
@ -1602,24 +1575,37 @@ void TriggerLeftRightDevice2Effect(double smallstrength, double largestrength, d
|
|||||||
SDL_HapticUpdateEffect(haptic2, effects.effect_leftright_id, &tempEffect);
|
SDL_HapticUpdateEffect(haptic2, effects.effect_leftright_id, &tempEffect);
|
||||||
SDL_HapticRunEffect(haptic2, effects.effect_leftright_id, 1);
|
SDL_HapticRunEffect(haptic2, effects.effect_leftright_id, 1);
|
||||||
}
|
}
|
||||||
|
else if (ReverseRumble == 1)
|
||||||
|
{
|
||||||
|
SDL_HapticEffect tempEffect;
|
||||||
|
tempEffect.type = SDL_HAPTIC_LEFTRIGHT;
|
||||||
|
tempEffect.leftright.length = length;
|
||||||
|
SHORT minForce = (SHORT)(largestrength > 0.001 ? (configMinForce / 100.0 * 32767.0) : 0); // strength is a double so we do an epsilon check of 0.001 instead of > 0.
|
||||||
|
SHORT maxForce = (SHORT)(configMaxForce / 100.0 * 32767.0);
|
||||||
|
SHORT range = maxForce - minForce;
|
||||||
|
tempEffect.leftright.small_magnitude = (SHORT)(largestrength * range + minForce);
|
||||||
|
SHORT minForce1 = (SHORT)(smallstrength > 0.001 ? (configMinForce / 100.0 * 32767.0) : 0); // strength is a double so we do an epsilon check of 0.001 instead of > 0.
|
||||||
|
SHORT maxForce1 = (SHORT)(configMaxForce / 100.0 * 32767.0);
|
||||||
|
SHORT range1 = maxForce1 - minForce1;
|
||||||
|
tempEffect.leftright.large_magnitude = (SHORT)(smallstrength * range1 + minForce1);
|
||||||
|
SDL_HapticUpdateEffect(haptic2, effects.effect_leftright_id, &tempEffect);
|
||||||
|
SDL_HapticRunEffect(haptic2, effects.effect_leftright_id, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TriggerRumbleEffect(double strength, double length)
|
void TriggerRumbleEffect(double strength, double length)
|
||||||
{
|
{
|
||||||
if (FFBorRumble == 1)
|
if (EnableRumble == 1)
|
||||||
{
|
{
|
||||||
SDL_HapticRumblePlay(haptic, strength, length);
|
SDL_HapticRumblePlay(haptic, strength, length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TriggerSpringEffect(double strength)
|
void TriggerSpringEffect(double strength)
|
||||||
{
|
|
||||||
if (FFBorRumble == 0)
|
|
||||||
{
|
{
|
||||||
TriggerSpringEffectWithDefaultOption(strength, false);
|
TriggerSpringEffectWithDefaultOption(strength, false);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
DWORD WINAPI FFBLoop(LPVOID lpParam)
|
DWORD WINAPI FFBLoop(LPVOID lpParam)
|
||||||
{
|
{
|
||||||
@ -1630,7 +1616,7 @@ DWORD WINAPI FFBLoop(LPVOID lpParam)
|
|||||||
Sleep(2500);
|
Sleep(2500);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FFBorRumble == 1)
|
if (EnableRumble == 1)
|
||||||
{
|
{
|
||||||
//SPECIAL K DISABLES RUMBLE BY DEFAULT. WRITE IT TO FALSE
|
//SPECIAL K DISABLES RUMBLE BY DEFAULT. WRITE IT TO FALSE
|
||||||
char RumbleDisableChar[256];
|
char RumbleDisableChar[256];
|
||||||
|
@ -413,7 +413,7 @@ MaxForce= **Maximum FFB force with 100 being highest value available**
|
|||||||
|
|
||||||
DeviceGUID= **Set Device GUID to connect to specific wheel or controller**
|
DeviceGUID= **Set Device GUID to connect to specific wheel or controller**
|
||||||
|
|
||||||
FFBorRumble= **Turn to 0 if using wheel & want Force Feedback effects. For controllers change to 1 to enable rumble**
|
EnableRumble= **Turn Off (0) if your wheel supports rumble effect. For controllers, turn on (1)**
|
||||||
|
|
||||||
Logging= **Turn On (1) to allow log.txt to be made to log plugin. Device GUID is given in here**
|
Logging= **Turn On (1) to allow log.txt to be made to log plugin. Device GUID is given in here**
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user