2019-09-14 03:13:05 +02:00
|
|
|
/*This file is part of FFB Arcade Plugin.
|
|
|
|
FFB Arcade Plugin is free software : you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
FFB Arcade Plugin is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2019-04-07 07:16:19 +02:00
|
|
|
#include <string>
|
|
|
|
#include "TestGame.h"
|
2019-05-15 09:25:41 +02:00
|
|
|
#include "SDL.h"
|
2019-04-07 07:16:19 +02:00
|
|
|
|
|
|
|
wchar_t *settingsFN = TEXT(".\\FFBPlugin.ini");
|
|
|
|
|
|
|
|
int configGameIdEffect = GetPrivateProfileInt(TEXT("Settings"), TEXT("GameId"), 1, settingsFN);
|
|
|
|
|
|
|
|
void TestGame::FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTriggers* triggers) {
|
|
|
|
switch (configGameIdEffect) {
|
|
|
|
case -1:
|
|
|
|
// turn left
|
|
|
|
triggers->Constant(constants->DIRECTION_FROM_RIGHT, 1);
|
|
|
|
break;
|
|
|
|
case -2:
|
|
|
|
triggers->Sine(125, 100, 0.25);
|
|
|
|
break;
|
|
|
|
case -3:
|
|
|
|
triggers->Friction(1);
|
|
|
|
break;
|
|
|
|
case -4:
|
|
|
|
triggers->Spring(1);
|
|
|
|
break;
|
|
|
|
case -5:
|
|
|
|
triggers->Friction(1);
|
|
|
|
triggers->Spring(1);
|
|
|
|
break;
|
|
|
|
case -6:
|
|
|
|
triggers->Friction(0);
|
|
|
|
triggers->Spring(0);
|
|
|
|
break;
|
2019-05-15 09:25:41 +02:00
|
|
|
case -7:
|
2019-10-30 07:03:50 +01:00
|
|
|
triggers->Rumble(1.0, 1.0, SDL_HAPTIC_INFINITY);
|
2019-05-15 09:25:41 +02:00
|
|
|
break;
|
2021-02-20 09:34:03 +01:00
|
|
|
case -8:
|
|
|
|
triggers->RumbleTriggers(1.0, 1.0, SDL_HAPTIC_INFINITY);
|
|
|
|
break;
|
2019-04-07 07:16:19 +02:00
|
|
|
}
|
|
|
|
}
|