mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-04 22:19:02 +00:00
Improvements to XInput vibration:
- use std::chrono to measure 20ms between XInputSetState calls, because clock() measures cpu time and not real time (so calls were made more often than intended) - fixup data types for cached vibration values to prevent u8 values overflowing and giving false positives on m_dev->newVibrateData
This commit is contained in:
parent
b3aff3a1c6
commit
87ffa04a2b
2 changed files with 13 additions and 13 deletions
|
|
@ -5,7 +5,7 @@
|
|||
#define NOMINMAX
|
||||
#include <Windows.h>
|
||||
#include <Xinput.h>
|
||||
#include <ctime>
|
||||
#include <chrono>
|
||||
|
||||
namespace XINPUT_INFO
|
||||
{
|
||||
|
|
@ -91,9 +91,9 @@ class xinput_pad_handler final : public PadHandlerBase
|
|||
{
|
||||
u32 deviceNumber{ 0 };
|
||||
bool newVibrateData{ true };
|
||||
u8 largeVibrate{ 0 };
|
||||
u8 smallVibrate{ 0 };
|
||||
clock_t last_vibration{ 0 };
|
||||
u16 largeVibrate{ 0 };
|
||||
u16 smallVibrate{ 0 };
|
||||
std::chrono::high_resolution_clock::time_point last_vibration;
|
||||
pad_config* config{ nullptr };
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue