1
0
mirror of synced 2024-12-18 09:15:58 +01:00

Remove Lastwasstop etc

This commit is contained in:
Aaron M 2019-11-03 20:46:18 +13:00
parent 57d812e6af
commit 04e446f586
19 changed files with 1 additions and 71 deletions

View File

@ -9,7 +9,6 @@ class TeknoParrotGame : public Game {
int ffbOffset = 0; int ffbOffset = 0;
protected: protected:
int lastWasStop = 0;
int GetTeknoParrotFFB(); int GetTeknoParrotFFB();
TeknoParrotGame(); TeknoParrotGame();

View File

@ -14,7 +14,6 @@ along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>.
#pragma once #pragma once
#include "../Common Files/Game.h" #include "../Common Files/Game.h"
class BG4JP : public Game { class BG4JP : public Game {
int lastWasStop = 0;
public: public:
void FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTriggers* triggers); void FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTriggers* triggers);

View File

@ -114,7 +114,6 @@ void ChaseHQ2::FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTrigg
// direction from left => makes wheel turn right // direction from left => makes wheel turn right
triggers->Rumble(percentForce, 0, percentLength); triggers->Rumble(percentForce, 0, percentLength);
triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce); // old logic: 31 - ff triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce); // old logic: 31 - ff
lastWasStop = 0;
} }
else if (ff > 0) else if (ff > 0)
{ {
@ -125,13 +124,5 @@ void ChaseHQ2::FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTrigg
// direction from right => makes wheel turn left // direction from right => makes wheel turn left
triggers->Rumble(0, percentForce, percentLength); triggers->Rumble(0, percentForce, percentLength);
triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce); // old logic: 15 - ff triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce); // old logic: 15 - ff
lastWasStop = 0;
}
else
{
if (lastWasStop == 0) {
triggers->Constant(constants->DIRECTION_FROM_LEFT, 0); // just pass the hash of 0 strength so we update lastEffectHash & lastEffectTime
lastWasStop = 1;
}
} }
} }

View File

@ -14,7 +14,6 @@ along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>.
#pragma once #pragma once
#include "../Common Files/Game.h" #include "../Common Files/Game.h"
class ChaseHQ2 : public Game { class ChaseHQ2 : public Game {
int lastWasStop = 0;
public: public:
void FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTriggers* triggers); void FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTriggers* triggers);

View File

@ -14,7 +14,6 @@ along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>.
#pragma once #pragma once
#include "../Common Files/Game.h" #include "../Common Files/Game.h"
class Daytona3 : public Game { class Daytona3 : public Game {
int lastWasStop = 0;
public: public:
void FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTriggers* triggers); void FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTriggers* triggers);

View File

@ -23,33 +23,17 @@ void FordRacing::FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTri
if (ff < -65505 && ff > -65515) if (ff < -65505 && ff > -65515)
{ {
helpers->log("moving wheel left"); helpers->log("moving wheel left");
// -65507 => 9
// -65508 => 8
// -65515 => 1
// weirdly, FR has 9 levels, not 15, utilizing only -65506 (weakest) to -65514 (strongest)
double percentForce = (-65505 - ff) / 9.0; double percentForce = (-65505 - ff) / 9.0;
double percentLength = 50; double percentLength = 50;
// direction from left => makes wheel turn right
triggers->Rumble(0, percentForce, percentLength); triggers->Rumble(0, percentForce, percentLength);
triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce); triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce);
lastWasStop = 0;
} }
else if (ff > 0 && ff < 16) else if (ff > 0 && ff < 16)
{ {
helpers->log("moving wheel right"); helpers->log("moving wheel right");
// weirdly, FR has 9 levels, not 15, utilizing 15 (weakest) through 7 (strongest)
double percentForce = (16 - ff) / 9.0; double percentForce = (16 - ff) / 9.0;
double percentLength = 50; double percentLength = 50;
// direction from right => makes wheel turn left
triggers->Rumble(percentForce, 0, percentLength); triggers->Rumble(percentForce, 0, percentLength);
triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce); triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce);
lastWasStop = 0;
}
else
{
if (lastWasStop == 0) {
triggers->Constant(constants->DIRECTION_FROM_LEFT, 0); // just pass the hash of 0 strength so we update lastEffectHash & lastEffectTime
lastWasStop = 1;
}
} }
} }

View File

@ -14,7 +14,6 @@ along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>.
#pragma once #pragma once
#include "../Common Files/Game.h" #include "../Common Files/Game.h"
class Machstorm : public Game { class Machstorm : public Game {
int lastWasStop = 0;
public: public:
void FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTriggers* triggers); void FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTriggers* triggers);

View File

@ -14,7 +14,6 @@ along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>.
#pragma once #pragma once
#include "../Common Files/Game.h" #include "../Common Files/Game.h"
class MarioKartGPDX100 : public Game { class MarioKartGPDX100 : public Game {
int lastWasStop = 0;
public: public:
void FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTriggers* triggers); void FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTriggers* triggers);

View File

@ -14,7 +14,6 @@ along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>.
#pragma once #pragma once
#include "../Common Files/Game.h" #include "../Common Files/Game.h"
class MarioKartGPDX110 : public Game { class MarioKartGPDX110 : public Game {
int lastWasStop = 0;
public: public:
void FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTriggers* triggers); void FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTriggers* triggers);

View File

@ -14,7 +14,6 @@ along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>.
#pragma once #pragma once
#include "../Common Files/Game.h" #include "../Common Files/Game.h"
class PokkenTournament : public Game { class PokkenTournament : public Game {
int lastWasStop = 0;
public: public:
void FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTriggers* triggers); void FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTriggers* triggers);

View File

@ -14,7 +14,6 @@ along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>.
#pragma once #pragma once
#include "../Common Files/Game.h" #include "../Common Files/Game.h"
class SegaRacingClassic : public Game { class SegaRacingClassic : public Game {
int lastWasStop = 0;
public: public:
void FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTriggers* triggers); void FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTriggers* triggers);

View File

@ -23,30 +23,17 @@ void SegaRally3::FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTri
if (ff > 15) if (ff > 15)
{ {
helpers->log("moving wheel right"); helpers->log("moving wheel right");
// assume that 30 is the weakest and 16 is the strongest
double percentForce = (31 - ff) / 15.0; double percentForce = (31 - ff) / 15.0;
double percentLength = 100; double percentLength = 100;
// direction from left => makes wheel turn right
triggers->Rumble(percentForce, 0, percentLength); triggers->Rumble(percentForce, 0, percentLength);
triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce); triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce);
lastWasStop = 0;
} }
else if (ff > 0) else if (ff > 0)
{ {
helpers->log("moving wheel left"); helpers->log("moving wheel left");
// assume that 1 is the strongest and 15 is the weakest
double percentForce = (16 - ff) / 15.0; double percentForce = (16 - ff) / 15.0;
double percentLength = 100; double percentLength = 100;
// direction from right => makes wheel turn left
triggers->Rumble(0, percentForce, percentLength); triggers->Rumble(0, percentForce, percentLength);
triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce); triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce);
lastWasStop = 0;
}
else
{
if (lastWasStop == 0) {
triggers->Constant(constants->DIRECTION_FROM_LEFT, 0); // just pass the hash of 0 strength so we update lastEffectHash & lastEffectTime
lastWasStop = 1;
}
}
} }

View File

@ -34,7 +34,6 @@ void SonicSegaAllStarsRacing::FFBLoop(EffectConstants *constants, Helpers *helpe
double percentLength = 100; double percentLength = 100;
triggers->Rumble(0, percentForce, percentLength); triggers->Rumble(0, percentForce, percentLength);
triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce); triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce);
lastWasStop = 0;
} }
else if ((FFB > 237) & (FFB < 256)) else if ((FFB > 237) & (FFB < 256))
@ -44,13 +43,5 @@ void SonicSegaAllStarsRacing::FFBLoop(EffectConstants *constants, Helpers *helpe
double percentLength = 100; double percentLength = 100;
triggers->Rumble(percentForce, 0, percentLength); triggers->Rumble(percentForce, 0, percentLength);
triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce); triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce);
lastWasStop = 0;
}
else
{
if (lastWasStop == 0) {
triggers->Constant(constants->DIRECTION_FROM_LEFT, 0); // just pass the hash of 0 strength so we update lastEffectHash & lastEffectTime
lastWasStop = 1;
}
} }
} }

View File

@ -14,7 +14,6 @@ along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>.
#pragma once #pragma once
#include "../Common Files/Game.h" #include "../Common Files/Game.h"
class SonicSegaAllStarsRacing : public Game { class SonicSegaAllStarsRacing : public Game {
int lastWasStop = 0;
public: public:
void FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTriggers* triggers); void FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTriggers* triggers);

View File

@ -15,7 +15,6 @@ along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>.
#include "TestGame.h" #include "TestGame.h"
#include "SDL.h" #include "SDL.h"
//settingsFN copied from DllMain.cpp; renamed from settingsFilename
wchar_t *settingsFN = TEXT(".\\FFBPlugin.ini"); wchar_t *settingsFN = TEXT(".\\FFBPlugin.ini");
//GameId test values: //GameId test values:

View File

@ -14,7 +14,6 @@ along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>.
#pragma once #pragma once
#include "../Common Files/Game.h" #include "../Common Files/Game.h"
class TestGame : public Game { class TestGame : public Game {
int lastWasStop = 0;
public: public:
void FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTriggers* triggers); void FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTriggers* triggers);

View File

@ -14,7 +14,6 @@ along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>.
#pragma once #pragma once
#include "../Common Files/Game.h" #include "../Common Files/Game.h"
class WMMT5 : public Game { class WMMT5 : public Game {
int lastWasStop = 0;
public: public:
void FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTriggers* triggers); void FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTriggers* triggers);

View File

@ -112,7 +112,6 @@ void WackyRaces::FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTri
// direction from left => makes wheel turn right // direction from left => makes wheel turn right
triggers->Rumble(0, percentForce, percentLength); triggers->Rumble(0, percentForce, percentLength);
triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce); // old logic: 31 - ff triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce); // old logic: 31 - ff
lastWasStop = 0;
} }
else if (ff > 0) else if (ff > 0)
{ {
@ -123,13 +122,5 @@ void WackyRaces::FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTri
// direction from right => makes wheel turn left // direction from right => makes wheel turn left
triggers->Rumble(percentForce, 0, percentLength); triggers->Rumble(percentForce, 0, percentLength);
triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce); // old logic: 15 - ff triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce); // old logic: 15 - ff
lastWasStop = 0;
}
else
{
if (lastWasStop == 0) {
triggers->Constant(constants->DIRECTION_FROM_LEFT, 0); // just pass the hash of 0 strength so we update lastEffectHash & lastEffectTime
lastWasStop = 1;
}
} }
} }

View File

@ -15,7 +15,6 @@ along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>.
#include "../Common Files/Game.h" #include "../Common Files/Game.h"
class WackyRaces : public Game { class WackyRaces : public Game {
int lastWasStop = 0;
public: public:
void FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTriggers* triggers); void FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTriggers* triggers);