summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-03-28 09:34:25 +0100
committeraap <aap@papnet.eu>2020-03-28 09:34:25 +0100
commit6a14457614e2d44d7e15b93b4b4b3efbb6c1a9e8 (patch)
treee7c217879fb4afd591d6d0e822ea89db9fe9bc4f /src/core
parentCCam fix (diff)
parentFix Text n Pager (diff)
downloadre3-6a14457614e2d44d7e15b93b4b4b3efbb6c1a9e8.tar
re3-6a14457614e2d44d7e15b93b4b4b3efbb6c1a9e8.tar.gz
re3-6a14457614e2d44d7e15b93b4b4b3efbb6c1a9e8.tar.bz2
re3-6a14457614e2d44d7e15b93b4b4b3efbb6c1a9e8.tar.lz
re3-6a14457614e2d44d7e15b93b4b4b3efbb6c1a9e8.tar.xz
re3-6a14457614e2d44d7e15b93b4b4b3efbb6c1a9e8.tar.zst
re3-6a14457614e2d44d7e15b93b4b4b3efbb6c1a9e8.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/Pad.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp
index 9a911aa4..87f45b9f 100644
--- a/src/core/Pad.cpp
+++ b/src/core/Pad.cpp
@@ -7,7 +7,7 @@
#include "common.h"
#ifdef XINPUT
#include <Xinput.h>
-#pragma comment( lib, "Xinput.lib" )
+#pragma comment( lib, "Xinput9_1_0.lib" )
#endif
#include "patcher.h"
#include "Pad.h"
@@ -590,6 +590,24 @@ void CPad::AffectFromXinput(uint32 pad)
PCTempJoyState.RightStickX = (int32)(rx * 128.0f);
PCTempJoyState.RightStickY = (int32)(ry * 128.0f);
}
+
+ XINPUT_VIBRATION VibrationState;
+
+ memset(&VibrationState, 0, sizeof(XINPUT_VIBRATION));
+
+ uint16 iLeftMotor = (uint16)((float)ShakeFreq / 255.0f * (float)0xffff);
+ uint16 iRightMotor = (uint16)((float)ShakeFreq / 255.0f * (float)0xffff);
+
+ if (ShakeDur < CTimer::GetTimeStepInMilliseconds())
+ ShakeDur = 0;
+ else
+ ShakeDur -= CTimer::GetTimeStepInMilliseconds();
+ if (ShakeDur == 0) ShakeFreq = 0;
+
+ VibrationState.wLeftMotorSpeed = iLeftMotor;
+ VibrationState.wRightMotorSpeed = iRightMotor;
+
+ XInputSetState(pad, &VibrationState);
}
}
#endif
@@ -617,6 +635,7 @@ void CPad::UpdatePads(void)
if ( bUpdate )
{
GetPad(0)->Update(0);
+ GetPad(1)->Update(0);
}
#if defined(MASTER) && !defined(XINPUT)