From 5c92ae12e0f554e355e65a093e637f0e45829231 Mon Sep 17 00:00:00 2001 From: Foo Bar Date: Sun, 21 Oct 2018 02:06:44 +0100 Subject: [PATCH] Fix endless bumpstop damping force --- irFFB/irFFB.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/irFFB/irFFB.cpp b/irFFB/irFFB.cpp index c55585d..d0b3768 100644 --- a/irFFB/irFFB.cpp +++ b/irFFB/irFFB.cpp @@ -226,6 +226,8 @@ DWORD WINAPI readWheelThread(LPVOID lParam) { d *= DAMPING_MULTIPLIER * settings.getDampingFactor(); } + else + d = 0.0f; } @@ -657,6 +659,8 @@ int APIENTRY wWinMain( logiEscape.lpvInBuffer = &logiLedData; logiEscape.cbInBuffer = sizeof(logiLedData); + InitializeCriticalSection(&effectCrit); + if (!InitInstance(hInstance, nCmdShow)) return FALSE; @@ -693,8 +697,6 @@ int APIENTRY wWinMain( initVJD(); SetPriorityClass(GetCurrentProcess(), ABOVE_NORMAL_PRIORITY_CLASS); - InitializeCriticalSection(&effectCrit); - SetThreadPriority( CreateThread(NULL, 0, readWheelThread, NULL, 0, NULL), THREAD_PRIORITY_HIGHEST );