mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2025-01-23 13:41:15 +01:00
Use plain for loop instead of foreach.
There is a noticeable speed difference.
This commit is contained in:
parent
51dfa8b91b
commit
d363257205
@ -804,13 +804,14 @@ namespace DS4Windows
|
||||
// Use the "most recently set" haptic state for each of light bar/motor.
|
||||
private void setHapticState()
|
||||
{
|
||||
int i = 0;
|
||||
DS4Color lightBarColor = LightBarColor;
|
||||
byte lightBarFlashDurationOn = LightBarOnDuration, lightBarFlashDurationOff = LightBarOffDuration;
|
||||
byte rumbleMotorStrengthLeftHeavySlow = LeftHeavySlowRumble, rumbleMotorStrengthRightLightFast = rightLightFastRumble;
|
||||
foreach (DS4HapticState haptic in hapticState)
|
||||
int hapticLen = hapticState.Length;
|
||||
for (int i=0; i < hapticLen; i++)
|
||||
{
|
||||
if (i++ == hapticStackIndex)
|
||||
DS4HapticState haptic = hapticState[i];
|
||||
if (i == hapticStackIndex)
|
||||
break; // rest haven't been used this time
|
||||
if (haptic.IsLightBarSet())
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user