]> Devoid-pointer.net GitWeb - FFBChecker.git/commitdiff
Support timing in SDL2's ramp effect
authorMichal Malý <madcatxster@devoid-pointer.net>
Sat, 1 Aug 2015 11:42:41 +0000 (13:42 +0200)
committerMichal Malý <madcatxster@devoid-pointer.net>
Sat, 1 Aug 2015 11:42:41 +0000 (13:42 +0200)
sdl2ffbrampeffect.cpp

index f2e078cd6b081dc33825464885aa541c5ac61bcb..5fec9fd83528cc34b2cc713e1d2e3adb6951628b 100644 (file)
@@ -18,6 +18,11 @@ SDL_HapticEffect* SDL2FFBRampEffect::createFFstruct()
   effect->ramp.direction.type = SDL_HAPTIC_POLAR;
   effect->ramp.direction.dir[0] = m_params->direction;
 
+  if (m_params->replayLength == 0)
+    effect->ramp.length = SDL_HAPTIC_INFINITY;
+  else
+    effect->ramp.length = m_params->replayLength;
+
   effect->ramp.attack_length = m_params->attackLength;
   effect->ramp.attack_level = m_params->attackLevel;
   effect->ramp.fade_length = m_params->fadeLength;