parent
d8778aa232
commit
57e60453f6
|
@ -305,9 +305,9 @@ namespace BizHawk.Emulation.Cores.Waterbox
|
|||
// so these thunks are called after the frame has advanced
|
||||
_rumblers.Add((c, b) =>
|
||||
{
|
||||
const double S32_MAX_AS_F64 = int.MaxValue;
|
||||
const double SCALE_FACTOR = (double) int.MaxValue / (double) byte.MaxValue;
|
||||
static int Scale(byte b)
|
||||
=> (b * S32_MAX_AS_F64).RoundToInt();
|
||||
=> (b * SCALE_FACTOR).RoundToInt();
|
||||
//TODO double-check order
|
||||
c.SetHapticChannelStrength(nameRight, Scale(b[byteStart]));
|
||||
c.SetHapticChannelStrength(nameLeft, Scale(b[byteStart + 1]));
|
||||
|
|
Loading…
Reference in New Issue