Added optional force spring to ID0
This commit is contained in:
parent
c1ba1e900d
commit
9009db81b6
@ -163,6 +163,8 @@ FeedbackLength=500
|
||||
GameId=32
|
||||
FeedbackLength=80
|
||||
PowerMode=0
|
||||
EnableForceSpringEffect=0
|
||||
ForceSpringStrength=70
|
||||
|
||||
[InitialD 4]
|
||||
GameId=16
|
||||
@ -252,7 +254,7 @@ SineStrength=100
|
||||
RumbleStrengthLeftMotor=100
|
||||
RumbleStrengthRightMotor=100
|
||||
EnableForceSpringEffect=0
|
||||
ForceSpringStrength=0
|
||||
ForceSpringStrength=70
|
||||
Device2GUID=
|
||||
MinForceDevice2=0
|
||||
MaxForceDevice2=100
|
||||
|
@ -15,6 +15,10 @@ along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>.
|
||||
#include "InitialD0.h"
|
||||
#include "math.h"
|
||||
|
||||
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);
|
||||
|
||||
void InitialD0::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* triggers) {
|
||||
|
||||
UINT8 ff = helpers->ReadByte(0x168317F, true);
|
||||
@ -25,6 +29,11 @@ void InitialD0::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTrig
|
||||
std::string ffs = std::to_string(ff);
|
||||
helpers->log((char*)ffs.c_str());
|
||||
|
||||
if (EnableForceSpringEffect == 1)
|
||||
{
|
||||
triggers->Springi(ForceSpringStrength / 100.0);
|
||||
}
|
||||
|
||||
if (oldff != newff)
|
||||
{
|
||||
if ((ff > 0x37) && (ff < 0x80))
|
||||
|
Loading…
x
Reference in New Issue
Block a user