(gx_joypad.c) Declare variables at top

This commit is contained in:
twinaphex 2015-12-04 12:00:00 +01:00
parent 0b9df5a069
commit 35da6073df
1 changed files with 35 additions and 34 deletions

View File

@ -301,6 +301,7 @@ static int16_t WPAD_StickX(WPADData *data, u8 right)
static int16_t WPAD_StickY(WPADData *data, u8 right) static int16_t WPAD_StickY(WPADData *data, u8 right)
{ {
double val;
float mag = 0.0f; float mag = 0.0f;
float ang = 0.0f; float ang = 0.0f;
@ -337,7 +338,7 @@ static int16_t WPAD_StickY(WPADData *data, u8 right)
mag = 1.0f; mag = 1.0f;
else if (mag < -1.0f) else if (mag < -1.0f)
mag = -1.0f; mag = -1.0f;
double val = -mag * cos(PI * ang/180.0f); val = -mag * cos(PI * ang/180.0f);
return (int16_t)(val * 32767.0f); return (int16_t)(val * 32767.0f);
} }