mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-11-26 11:04:21 +01:00
Use unsafe memory pointers for detecting output report changes
This commit is contained in:
parent
895539c787
commit
f3a019742d
@ -1089,7 +1089,7 @@ namespace DS4Windows
|
||||
hDevice.flush_Queue();
|
||||
}
|
||||
|
||||
private void sendOutputReport(bool synchronous)
|
||||
private unsafe void sendOutputReport(bool synchronous)
|
||||
{
|
||||
setTestRumble();
|
||||
setHapticState();
|
||||
@ -1161,8 +1161,14 @@ namespace DS4Windows
|
||||
else
|
||||
{
|
||||
bool output = outputPendCount > 0, change = false;
|
||||
for (int i = 0, arlen = outputReport.Length; !change && i < arlen; i++)
|
||||
change = outputReport[i] != outReportBuffer[i];
|
||||
fixed (byte* byteR = outputReport, byteB = outReportBuffer)
|
||||
{
|
||||
for (int i = 0, arlen = outputReport.Length; !change && i < arlen; i++)
|
||||
change = byteR[i] != byteB[i];
|
||||
}
|
||||
|
||||
//for (int i = 0, arlen = outputReport.Length; !change && i < arlen; i++)
|
||||
// change = outputReport[i] != outReportBuffer[i];
|
||||
|
||||
if (output || change)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user