Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Commit

Permalink
removing unnused vars
Browse files Browse the repository at this point in the history
  • Loading branch information
Valkirie committed Oct 14, 2021
1 parent 701697a commit 2cc6f76
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 deletions.
12 changes: 4 additions & 8 deletions AyaGyroAiming/HidHide.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ public void RegisterApplication(string path)
process.StartInfo.Arguments = $"--app-reg \"{path}\"";
process.Start();
process.WaitForExit();

string jsonString = process.StandardOutput.ReadToEnd();
process.StandardOutput.ReadToEnd();
}

public List<Device> GetDevices()
Expand Down Expand Up @@ -57,26 +56,23 @@ public void SetCloaking(bool status)
process.StartInfo.Arguments = status ? $"--cloak-on" : $"--cloak-off";
process.Start();
process.WaitForExit();

string jsonString = process.StandardOutput.ReadToEnd();
process.StandardOutput.ReadToEnd();
}

public void HideDevice(string deviceInstancePath)
{
process.StartInfo.Arguments = $"--dev-hide \"{deviceInstancePath}\"";
process.Start();
process.WaitForExit();

string jsonString = process.StandardOutput.ReadToEnd();
process.StandardOutput.ReadToEnd();
}

public void UnHideDevice(string deviceInstancePath)
{
process.StartInfo.Arguments = $"--dev-unhide \"{deviceInstancePath}\"";
process.Start();
process.WaitForExit();

string jsonString = process.StandardOutput.ReadToEnd();
process.StandardOutput.ReadToEnd();
}
}
}
7 changes: 2 additions & 5 deletions AyaGyroAiming/UdpServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,9 @@ private void SendPacket(IPEndPoint clientEP, byte[] usefulData, ushort reqProtoc
int currIdx = BeginPacket(packetData, reqProtocolVersion);
Array.Copy(usefulData, 0, packetData, currIdx, usefulData.Length);
FinishPacket(packetData);

//try { udpSock.SendTo(packetData, clientEP); }
int temp = 0;
poolLock.EnterWriteLock();
temp = listInd;
//try { udpSock.SendTo(packetData, clientEP); }
int temp = listInd;
listInd = ++listInd % ARG_BUFFER_LEN;
SocketAsyncEventArgs args = argsList[temp];
poolLock.ExitWriteLock();
Expand Down Expand Up @@ -678,7 +676,6 @@ public void NewReportIncoming(ref DualShockPadMeta padMeta, XInputController hid
}

clientsList.Clear();
clientsList = null;
}
}
}
3 changes: 1 addition & 2 deletions AyaGyroAiming/XInputGirometer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,9 @@ static Vector3 NormalizeReading(Vector3 input, float magnitude, float threshold,
float vector = (magnitude > 0 ? magnitude : 1);
var direction = input / vector;

float normalizedMagnitude = 0.0f;
if (magnitude - threshold > 0)
{
normalizedMagnitude = Math.Min((magnitude - threshold) / (short.MaxValue - threshold), 1);
float normalizedMagnitude = Math.Min((magnitude - threshold) / (short.MaxValue - threshold), 1);
normalizedMagnitude = normalizedMagnitude < alpha ? alpha : normalizedMagnitude;

return direction * normalizedMagnitude;
Expand Down

0 comments on commit 2cc6f76

Please sign in to comment.