mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-11-26 19:14:20 +01:00
Removed more property usage
This commit is contained in:
parent
ee6a7fafd4
commit
4ae72cfdb2
@ -810,7 +810,7 @@ namespace DS4Windows
|
|||||||
cState.L1 = (inputReport[6] & (1 << 0)) != 0;
|
cState.L1 = (inputReport[6] & (1 << 0)) != 0;
|
||||||
|
|
||||||
cState.PS = (inputReport[7] & (1 << 0)) != 0;
|
cState.PS = (inputReport[7] & (1 << 0)) != 0;
|
||||||
cState.TouchButton = (inputReport[7] & (1 << 2 - 1)) != 0;
|
cState.TouchButton = (inputReport[7] & 0x02) != 0;
|
||||||
cState.FrameCounter = (byte)(inputReport[7] >> 2);
|
cState.FrameCounter = (byte)(inputReport[7] >> 2);
|
||||||
|
|
||||||
try
|
try
|
||||||
@ -997,12 +997,12 @@ namespace DS4Windows
|
|||||||
//outputReportBuffer[1] = 0x84;
|
//outputReportBuffer[1] = 0x84;
|
||||||
outputReportBuffer[1] = (byte)(0x80 | btPollRate); // input report rate
|
outputReportBuffer[1] = (byte)(0x80 | btPollRate); // input report rate
|
||||||
// enable lightbar and rumble
|
// enable lightbar and rumble
|
||||||
outputReportBuffer[3] = 0x03;
|
outputReportBuffer[3] = 0x07;
|
||||||
outputReportBuffer[6] = rightLightFastRumble; // fast motor
|
outputReportBuffer[6] = rightLightFastRumble; // fast motor
|
||||||
outputReportBuffer[7] = leftHeavySlowRumble; // slow motor
|
outputReportBuffer[7] = leftHeavySlowRumble; // slow motor
|
||||||
outputReportBuffer[8] = LightBarColor.red; // red
|
outputReportBuffer[8] = ligtBarColor.red; // red
|
||||||
outputReportBuffer[9] = LightBarColor.green; // green
|
outputReportBuffer[9] = ligtBarColor.green; // green
|
||||||
outputReportBuffer[10] = LightBarColor.blue; // blue
|
outputReportBuffer[10] = ligtBarColor.blue; // blue
|
||||||
outputReportBuffer[11] = ledFlashOn; // flash on duration
|
outputReportBuffer[11] = ledFlashOn; // flash on duration
|
||||||
outputReportBuffer[12] = ledFlashOff; // flash off duration
|
outputReportBuffer[12] = ledFlashOff; // flash off duration
|
||||||
}
|
}
|
||||||
@ -1014,9 +1014,9 @@ namespace DS4Windows
|
|||||||
(byte)0x03 : (byte)(0x03 | (btPollRate << 4));
|
(byte)0x03 : (byte)(0x03 | (btPollRate << 4));
|
||||||
outputReportBuffer[4] = rightLightFastRumble; // fast motor
|
outputReportBuffer[4] = rightLightFastRumble; // fast motor
|
||||||
outputReportBuffer[5] = leftHeavySlowRumble; // slow motor
|
outputReportBuffer[5] = leftHeavySlowRumble; // slow motor
|
||||||
outputReportBuffer[6] = LightBarColor.red; // red
|
outputReportBuffer[6] = ligtBarColor.red; // red
|
||||||
outputReportBuffer[7] = LightBarColor.green; // green
|
outputReportBuffer[7] = ligtBarColor.green; // green
|
||||||
outputReportBuffer[8] = LightBarColor.blue; // blue
|
outputReportBuffer[8] = ligtBarColor.blue; // blue
|
||||||
outputReportBuffer[9] = ledFlashOn; // flash on duration
|
outputReportBuffer[9] = ledFlashOn; // flash on duration
|
||||||
outputReportBuffer[10] = ledFlashOff; // flash off duration
|
outputReportBuffer[10] = ledFlashOff; // flash off duration
|
||||||
if (conType == ConnectionType.SONYWA)
|
if (conType == ConnectionType.SONYWA)
|
||||||
@ -1249,9 +1249,10 @@ namespace DS4Windows
|
|||||||
// Use the "most recently set" haptic state for each of light bar/motor.
|
// Use the "most recently set" haptic state for each of light bar/motor.
|
||||||
private void setHapticState()
|
private void setHapticState()
|
||||||
{
|
{
|
||||||
DS4Color lightBarColor = LightBarColor;
|
DS4Color lightBarColor = ligtBarColor;
|
||||||
byte lightBarFlashDurationOn = LightBarOnDuration, lightBarFlashDurationOff = LightBarOffDuration;
|
byte lightBarFlashDurationOn = ledFlashOn, lightBarFlashDurationOff = ledFlashOff;
|
||||||
byte rumbleMotorStrengthLeftHeavySlow = LeftHeavySlowRumble, rumbleMotorStrengthRightLightFast = rightLightFastRumble;
|
byte rumbleMotorStrengthLeftHeavySlow = leftHeavySlowRumble,
|
||||||
|
rumbleMotorStrengthRightLightFast = rightLightFastRumble;
|
||||||
int hapticLen = hapticState.Length;
|
int hapticLen = hapticState.Length;
|
||||||
for (int i=0; i < hapticLen; i++)
|
for (int i=0; i < hapticLen; i++)
|
||||||
{
|
{
|
||||||
@ -1273,11 +1274,11 @@ namespace DS4Windows
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LightBarColor = lightBarColor;
|
ligtBarColor = lightBarColor;
|
||||||
LightBarOnDuration = lightBarFlashDurationOn;
|
ledFlashOn = lightBarFlashDurationOn;
|
||||||
LightBarOffDuration = lightBarFlashDurationOff;
|
ledFlashOff = lightBarFlashDurationOff;
|
||||||
LeftHeavySlowRumble = rumbleMotorStrengthLeftHeavySlow;
|
leftHeavySlowRumble = rumbleMotorStrengthLeftHeavySlow;
|
||||||
RightLightFastRumble = rumbleMotorStrengthRightLightFast;
|
rightLightFastRumble = rumbleMotorStrengthRightLightFast;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void pushHapticState(DS4HapticState hs)
|
public void pushHapticState(DS4HapticState hs)
|
||||||
|
Loading…
Reference in New Issue
Block a user