Fix FFB not working on certain games
This commit is contained in:
parent
8c934944d4
commit
939a67f17d
41
DllMain.cpp
41
DllMain.cpp
@ -2063,8 +2063,17 @@ DWORD WINAPI AdjustFFBStrengthLoop(LPVOID lpParam)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD WINAPI FFBLoop2(LPVOID lpParam)
|
DWORD WINAPI FFBLoop(LPVOID lpParam)
|
||||||
{
|
{
|
||||||
|
hlp.log("In FFBLoop");
|
||||||
|
|
||||||
|
SDL_HapticStopAll(haptic);
|
||||||
|
if (configGameId != 29) //For games which need code to run quicker etc. Some games will crash if no sleep added
|
||||||
|
{
|
||||||
|
Sleep(2500);
|
||||||
|
}
|
||||||
|
Initialize(0);
|
||||||
|
hlp.log("Initialize() complete");
|
||||||
if (EnableRumble == 1)
|
if (EnableRumble == 1)
|
||||||
{
|
{
|
||||||
if ((configGameId != 1) && (configGameId != 9) && (configGameId != 12) && (configGameId != 26) && (configGameId != 28) && (configGameId != 29) && (configGameId != 30) && (configGameId != 31) && (configGameId != 35))
|
if ((configGameId != 1) && (configGameId != 9) && (configGameId != 12) && (configGameId != 26) && (configGameId != 28) && (configGameId != 29) && (configGameId != 30) && (configGameId != 31) && (configGameId != 35))
|
||||||
@ -2266,7 +2275,13 @@ DWORD WINAPI FFBLoop2(LPVOID lpParam)
|
|||||||
if (configDefaultFriction >= 0 && configDefaultFriction <= 100) {
|
if (configDefaultFriction >= 0 && configDefaultFriction <= 100) {
|
||||||
TriggerFrictionEffectWithDefaultOption(configDefaultFriction / 100.0, true);
|
TriggerFrictionEffectWithDefaultOption(configDefaultFriction / 100.0, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (EnableFFBStrengthDynamicAdjustment == 1)
|
||||||
|
{
|
||||||
|
CreateThread(NULL, 0, AdjustFFBStrengthLoop, NULL, 0, NULL);
|
||||||
|
CustomFFBStrengthSetup();
|
||||||
|
}
|
||||||
|
|
||||||
hlp.log("Entering Game's FFBLoop loop");
|
hlp.log("Entering Game's FFBLoop loop");
|
||||||
bool* kr = (bool*)lpParam;
|
bool* kr = (bool*)lpParam;
|
||||||
while (*kr)
|
while (*kr)
|
||||||
@ -2281,28 +2296,6 @@ DWORD WINAPI FFBLoop2(LPVOID lpParam)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD WINAPI FFBLoop(LPVOID lpParam)
|
|
||||||
{
|
|
||||||
hlp.log("In FFBLoop");
|
|
||||||
|
|
||||||
SDL_HapticStopAll(haptic);
|
|
||||||
CreateThread(NULL, 0, FFBLoop2, (LPVOID)&keepRunning, 0, NULL);
|
|
||||||
if (configGameId != 29) //For games which need code to run quicker etc. Some games will crash if no sleep added
|
|
||||||
{
|
|
||||||
Sleep(2500);
|
|
||||||
}
|
|
||||||
Initialize(0);
|
|
||||||
hlp.log("Initialize() complete");
|
|
||||||
|
|
||||||
if (EnableFFBStrengthDynamicAdjustment == 1)
|
|
||||||
{
|
|
||||||
Sleep(4000);
|
|
||||||
CreateThread(NULL, 0, AdjustFFBStrengthLoop, NULL, 0, NULL);
|
|
||||||
CustomFFBStrengthSetup();
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CreateFFBLoopThread()
|
void CreateFFBLoopThread()
|
||||||
{
|
{
|
||||||
hlp.log("Before CreateThread");
|
hlp.log("Before CreateThread");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user