mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-12-27 00:51:48 +01:00
Use unsafe memory pointers for copying imu data
This commit is contained in:
parent
60847ee54e
commit
37bb576aa6
@ -958,8 +958,20 @@ namespace DS4Windows
|
||||
catch { currerror = "Index out of bounds: touchpad"; }
|
||||
|
||||
// Store Gyro and Accel values
|
||||
Array.Copy(inputReport, 13, gyro, 0, 6);
|
||||
Array.Copy(inputReport, 19, accel, 0, 6);
|
||||
//Array.Copy(inputReport, 13, gyro, 0, 6);
|
||||
//Array.Copy(inputReport, 19, accel, 0, 6);
|
||||
fixed (byte* pbInput = inputReport, pbGyro = gyro, pbAccel = accel)
|
||||
{
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
pbGyro[i] = pbInput[i];
|
||||
}
|
||||
|
||||
for (int i = 6; i < 12; i++)
|
||||
{
|
||||
pbAccel[i] = pbInput[i];
|
||||
}
|
||||
}
|
||||
sixAxis.handleSixaxis(gyro, accel, cState, elapsedDeltaTime);
|
||||
|
||||
/* Debug output of incoming HID data:
|
||||
|
Loading…
Reference in New Issue
Block a user