From c7fb16b6f8b0acb55e59ea69455bb02715495378 Mon Sep 17 00:00:00 2001 From: Aaron M Date: Tue, 27 Apr 2021 19:36:19 +1200 Subject: [PATCH] Add Enable Outputs to ID0 v1.31 & 2.11 --- Game Files/InitialD0v131.cpp | 12 ++++++++++++ Game Files/InitialD0v211.cpp | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/Game Files/InitialD0v131.cpp b/Game Files/InitialD0v131.cpp index 18242d8..5be1996 100644 --- a/Game Files/InitialD0v131.cpp +++ b/Game Files/InitialD0v131.cpp @@ -18,6 +18,8 @@ along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>. extern int EnableDamper; extern int DamperStrength; +static bool outputinit = false; + static UINT8 ff; static UINT8 oldff; static UINT8 newff; @@ -30,9 +32,19 @@ static int EnableForceSpringEffect = GetPrivateProfileInt(TEXT("Settings"), TEXT static int ForceSpringStrength = GetPrivateProfileInt(TEXT("Settings"), TEXT("ForceSpringStrength"), 0, settingsFilename); static int EscapeKeyExitViaPlugin = GetPrivateProfileInt(TEXT("Settings"), TEXT("EscapeKeyExitViaPlugin"), 0, settingsFilename); static int IDZMode = GetPrivateProfileInt(TEXT("Settings"), TEXT("IDZMode"), 0, settingsFilename); +static int EnableOutputs = GetPrivateProfileInt(TEXT("Settings"), TEXT("EnableOutputs"), 0, settingsFilename); void InitialD0::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* triggers) { + if (!outputinit) + { + if (EnableOutputs == 1) + { + outputinit = true; + LoadLibraryA("OutputBlaster.dll"); + } + } + if (GetAsyncKeyState((VK_ESCAPE)) && (EscapeKeyExitViaPlugin == 1)) { ExitProcess(0); diff --git a/Game Files/InitialD0v211.cpp b/Game Files/InitialD0v211.cpp index 6b0a1e0..e684cab 100644 --- a/Game Files/InitialD0v211.cpp +++ b/Game Files/InitialD0v211.cpp @@ -25,14 +25,26 @@ static UINT8 ff3; extern int EnableDamper; extern int DamperStrength; +static bool outputinit = false; + static wchar_t* settingsFilename = TEXT(".\\FFBPlugin.ini"); static int EnableForceSpringEffect = GetPrivateProfileInt(TEXT("Settings"), TEXT("EnableForceSpringEffect"), 0, settingsFilename); static int ForceSpringStrength = GetPrivateProfileInt(TEXT("Settings"), TEXT("ForceSpringStrength"), 0, settingsFilename); static int EscapeKeyExitViaPlugin = GetPrivateProfileInt(TEXT("Settings"), TEXT("EscapeKeyExitViaPlugin"), 0, settingsFilename); static int IDZMode = GetPrivateProfileInt(TEXT("Settings"), TEXT("IDZMode"), 0, settingsFilename); +static int EnableOutputs = GetPrivateProfileInt(TEXT("Settings"), TEXT("EnableOutputs"), 0, settingsFilename); void InitialD0v211::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* triggers) { + if (!outputinit) + { + if (EnableOutputs == 1) + { + outputinit = true; + LoadLibraryA("OutputBlaster.dll"); + } + } + if (GetAsyncKeyState((VK_ESCAPE)) && (EscapeKeyExitViaPlugin == 1)) { ExitProcess(0);