Skip to content

Commit b8a7bbb

Browse files
committed
revert: remove SDL_HAPTIC_INFINITY duration change (Boomslangnz#103)
Infinite duration causes FFB to stop working on some drivers because RunEffect on an already-running infinite effect is silently ignored. Reverts constant, inertia and damper effects back to configFeedbackLength.
1 parent f824bb4 commit b8a7bbb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

DllMain.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,7 +1342,7 @@ void TriggerConstantEffect(int direction, double strength)
13421342
tempEffect.type = SDL_HAPTIC_CONSTANT;
13431343
tempEffect.constant.direction.type = SDL_HAPTIC_CARTESIAN;
13441344
tempEffect.constant.direction.dir[0] = direction;
1345-
tempEffect.constant.length = SDL_HAPTIC_INFINITY;
1345+
tempEffect.constant.length = configFeedbackLength;
13461346
tempEffect.constant.delay = 0;
13471347

13481348
int confMinForce = configMinForce;
@@ -1435,7 +1435,7 @@ void TriggerInertiaEffect(double strength)
14351435
tempEffect.condition.type = SDL_HAPTIC_INERTIA;
14361436
tempEffect.condition.direction.type = SDL_HAPTIC_CARTESIAN;
14371437
tempEffect.condition.delay = 0;
1438-
tempEffect.condition.length = SDL_HAPTIC_INFINITY;
1438+
tempEffect.condition.length = configFeedbackLength;
14391439
tempEffect.condition.direction.dir[0] = 1;
14401440
tempEffect.condition.direction.dir[1] = 1; //Y Position
14411441
SHORT minForce = (SHORT)(strength > 0.001 ? (configMinForce / 100.0 * 32767.0) : 0); // strength is a double so we do an epsilon check of 0.001 instead of > 0.
@@ -1520,7 +1520,7 @@ void TriggerDamperEffect(double strength)
15201520
tempEffect.condition.type = SDL_HAPTIC_DAMPER;
15211521
tempEffect.condition.direction.type = SDL_HAPTIC_CARTESIAN;
15221522
tempEffect.condition.delay = 0;
1523-
tempEffect.condition.length = SDL_HAPTIC_INFINITY;
1523+
tempEffect.condition.length = configFeedbackLength;
15241524
tempEffect.condition.direction.dir[0] = 1; // not used
15251525
tempEffect.condition.direction.dir[1] = 0; //Y Position
15261526
SHORT minForce = (SHORT)(strength > 0.001 ? (configMinForce / 100.0 * 32767.0) : 0); // strength is a double so we do an epsilon check of 0.001 instead of > 0.

0 commit comments

Comments
 (0)