Skip to content

Commit

Permalink
Vita: use sqrtf instead of sqrt
Browse files Browse the repository at this point in the history
  • Loading branch information
rsn8887 committed Sep 11, 2018
1 parent 8b1b63d commit 649b9ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/psp2/psp2_input.c
Expand Up @@ -232,7 +232,7 @@ void rescaleAnalog(int *x, int *y, int dead) {
float analogY = (float) *y;
float deadZone = (float) dead;

float magnitude = sqrt(analogX * analogX + analogY * analogY);
float magnitude = sqrtf(analogX * analogX + analogY * analogY);
if (magnitude >= deadZone){
//adjust maximum magnitude
float absAnalogX = fabs(analogX);
Expand All @@ -246,7 +246,7 @@ void rescaleAnalog(int *x, int *y, int dead) {
maxX = (maxAxis * analogX) / absAnalogY;
maxY = maxAxis;
}
float maximum = sqrt(maxX * maxX + maxY * maxY);
float maximum = sqrtf(maxX * maxX + maxY * maxY);
if (maximum > 1.25f * maxAxis) maximum = 1.25f * maxAxis;
if (maximum < magnitude) maximum = magnitude;

Expand Down

0 comments on commit 649b9ae

Please sign in to comment.