1
0
mirror of synced 2024-11-24 06:50:11 +01:00
FFBArcadePlugin/Game Files/TestGame.cpp

56 lines
1.6 KiB
C++
Raw Normal View History

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");
//GameId test values:
//const int TEST_GAME_CONST = -1;
//const int TEST_GAME_SINE = -2;
//const int TEST_GAME_FRICTION = -3;
//const int TEST_GAME_SPRING = -4;
//const int TEST_GAME_HEAVY = -5;
//const int TEST_GAME_LOOSE = -6;
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:
triggers->Rumble(1.0, 1.0, SDL_HAPTIC_INFINITY);
2019-05-15 09:25:41 +02:00
break;
2019-04-07 07:16:19 +02:00
}
}