Skip to content

Commit

Permalink
Remove superfluous casts (thanks @jwmelto).
Browse files Browse the repository at this point in the history
  • Loading branch information
macsforme committed Apr 12, 2021
1 parent 74442bd commit a43268e
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/platform/DXJoystick.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -261,23 +261,23 @@ void DXJoystick::getJoy(float& x, float& y)

DIJOYSTATE state = pollDevice();

if (xAxis == "X") x = float(state.lX) / 1000.0f;
else if (xAxis == "Y") x = float(state.lY) / 1000.0f;
else if (xAxis == "Z") x = float(state.lZ) / 1000.0f;
else if (xAxis == "Rx") x = float(state.lRx) / 1000.0f;
else if (xAxis == "Ry") x = float(state.lRy) / 1000.0f;
else if (xAxis == "Rz") x = float(state.lRz) / 1000.0f;
else if (xAxis == "Slider 1") x = float(state.rglSlider[0]) / 1000.0f;
else if (xAxis == "Slider 2") x = float(state.rglSlider[1]) / 1000.0f;

if (yAxis == "X") y = float(state.lX) / 1000.0f;
else if (yAxis == "Y") y = float(state.lY) / 1000.0f;
else if (yAxis == "Z") y = float(state.lZ) / 1000.0f;
else if (yAxis == "Rx") y = float(state.lRx) / 1000.0f;
else if (yAxis == "Ry") y = float(state.lRy) / 1000.0f;
else if (yAxis == "Rz") y = float(state.lRz) / 1000.0f;
else if (yAxis == "Slider 1") y = float(state.rglSlider[0]) / 1000.0f;
else if (yAxis == "Slider 2") y = float(state.rglSlider[1]) / 1000.0f;
if (xAxis == "X") x = state.lX / 1000.0f;
else if (xAxis == "Y") x = state.lY / 1000.0f;
else if (xAxis == "Z") x = state.lZ / 1000.0f;
else if (xAxis == "Rx") x = state.lRx / 1000.0f;
else if (xAxis == "Ry") x = state.lRy / 1000.0f;
else if (xAxis == "Rz") x = state.lRz / 1000.0f;
else if (xAxis == "Slider 1") x = state.rglSlider[0] / 1000.0f;
else if (xAxis == "Slider 2") x = state.rglSlider[1] / 1000.0f;

if (yAxis == "X") y = state.lX / 1000.0f;
else if (yAxis == "Y") y = state.lY / 1000.0f;
else if (yAxis == "Z") y = state.lZ / 1000.0f;
else if (yAxis == "Rx") y = state.lRx / 1000.0f;
else if (yAxis == "Ry") y = state.lRy / 1000.0f;
else if (yAxis == "Rz") y = state.lRz / 1000.0f;
else if (yAxis == "Slider 1") y = state.rglSlider[0] / 1000.0f;
else if (yAxis == "Slider 2") y = state.rglSlider[1] / 1000.0f;

return;
}
Expand Down

0 comments on commit a43268e

Please sign in to comment.