Skip to content

Commit

Permalink
PFBA: fix analog controls (broke in last release)
Browse files Browse the repository at this point in the history
  • Loading branch information
rsn8887 committed Aug 4, 2017
1 parent 8a8e3d7 commit 7851a65
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pfba/deps/libcross2d/src/sdl2/sdl2_input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ void SDL2Input::process_axis(Input::Player &player, int rotate) {
if (magnitude=sqrt(analogX * analogX + analogY * analogY) >= deadZone) {

// analog control
scalingFactor=1.0f/magnitude * (magnitude-deadZone)/(32769.0f-deadZone);
scalingFactor=32767.0f/magnitude * (magnitude-deadZone)/(32769.0f-deadZone);
currentStickXAxis->value = (short) (analogX * scalingFactor);
currentStickYAxis->value = (short) (analogY * scalingFactor);

Expand Down

0 comments on commit 7851a65

Please sign in to comment.