From c594324584a7f7f14753ce8b212cb0f8bfaaa78f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michal=20Mal=C3=BD?= Date: Sat, 1 Aug 2015 13:42:41 +0200 Subject: [PATCH] Support timing in SDL2's ramp effect --- sdl2ffbrampeffect.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sdl2ffbrampeffect.cpp b/sdl2ffbrampeffect.cpp index f2e078c..5fec9fd 100644 --- a/sdl2ffbrampeffect.cpp +++ b/sdl2ffbrampeffect.cpp @@ -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; -- 2.43.5