mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-11-29 12:34:18 +01:00
Change haptic changing routine to skip always searching for existing device
This commit is contained in:
parent
a4d7372e7b
commit
425b1dd47a
@ -1109,7 +1109,7 @@ namespace DS4Windows
|
|||||||
|
|
||||||
if (processingData[ind].Rumble[1] == 0x08)
|
if (processingData[ind].Rumble[1] == 0x08)
|
||||||
{
|
{
|
||||||
setRumble(Big, Small, ind);
|
SetDevRumble(device, Big, Small, ind);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1304,8 +1304,22 @@ namespace DS4Windows
|
|||||||
Debug(this, args);
|
Debug(this, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
//sets the rumble adjusted with rumble boost
|
// sets the rumble adjusted with rumble boost. General use method
|
||||||
public virtual void setRumble(byte heavyMotor, byte lightMotor, int deviceNum)
|
public virtual void setRumble(byte heavyMotor, byte lightMotor, int deviceNum)
|
||||||
|
{
|
||||||
|
if (deviceNum < 4)
|
||||||
|
{
|
||||||
|
DS4Device device = DS4Controllers[deviceNum];
|
||||||
|
if (device != null)
|
||||||
|
SetDevRumble(device, heavyMotor, lightMotor, deviceNum);
|
||||||
|
//device.setRumble((byte)lightBoosted, (byte)heavyBoosted);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// sets the rumble adjusted with rumble boost. Method more used for
|
||||||
|
// report handling. Avoid constant checking for a device.
|
||||||
|
public void SetDevRumble(DS4Device device,
|
||||||
|
byte heavyMotor, byte lightMotor, int deviceNum)
|
||||||
{
|
{
|
||||||
byte boost = getRumbleBoost(deviceNum);
|
byte boost = getRumbleBoost(deviceNum);
|
||||||
uint lightBoosted = ((uint)lightMotor * (uint)boost) / 100;
|
uint lightBoosted = ((uint)lightMotor * (uint)boost) / 100;
|
||||||
@ -1315,13 +1329,8 @@ namespace DS4Windows
|
|||||||
if (heavyBoosted > 255)
|
if (heavyBoosted > 255)
|
||||||
heavyBoosted = 255;
|
heavyBoosted = 255;
|
||||||
|
|
||||||
if (deviceNum < 4)
|
|
||||||
{
|
|
||||||
DS4Device device = DS4Controllers[deviceNum];
|
|
||||||
if (device != null)
|
|
||||||
device.setRumble((byte)lightBoosted, (byte)heavyBoosted);
|
device.setRumble((byte)lightBoosted, (byte)heavyBoosted);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public DS4State getDS4State(int ind)
|
public DS4State getDS4State(int ind)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user