rewrite TargetInspector to directly access memory, and add experimental ShouldVibrate bool

This commit is contained in:
somewhatlurker
2019-08-14 21:46:38 +10:00
parent 226d0d33d9
commit e1fe198376
7 changed files with 61 additions and 30 deletions
@@ -3,6 +3,7 @@
#include "../../Constants.h"
#include "../../FileSystem/ConfigFile.h"
#include "../../framework.h"
#include "../../Components/GameTargets/TargetInspector.h"
namespace TLAC::Input
{
@@ -226,6 +227,25 @@ namespace TLAC::Input
SetTapStates(i, elapsed);
}
if (TLAC::Components::TargetInspector::ShouldVibrate)
{
XINPUT_VIBRATION vibration;
ZeroMemory(&vibration, sizeof(XINPUT_VIBRATION));
vibration.wLeftMotorSpeed = 8000; // use any value between 0-65535 here
vibration.wRightMotorSpeed = 4000; // use any value between 0-65535 here
//XInputSetState(xc_pref, &vibration);
//printf("1");
}
else
{
XINPUT_VIBRATION vibration;
ZeroMemory(&vibration, sizeof(XINPUT_VIBRATION));
vibration.wLeftMotorSpeed = 0; // use any value between 0-65535 here
vibration.wRightMotorSpeed = 0; // use any value between 0-65535 here
//XInputSetState(xc_pref, &vibration);
//printf("0");
}
break;
}
else if (n == 3) {