Use define instead of hardcoded number.
This commit is contained in:
parent
2fabf5302b
commit
a351849f5c
|
@ -27,22 +27,22 @@ int isControl(int type)
|
|||
key = app.config.keyControls[type];
|
||||
btn = app.config.joypadControls[type];
|
||||
|
||||
if (type == CONTROL_LEFT && app.joypadAxis[JOYPAD_AXIS_X] <= -16384)
|
||||
if (type == CONTROL_LEFT && app.joypadAxis[JOYPAD_AXIS_X] <= -AXIS_MAX / 2)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (type == CONTROL_RIGHT && app.joypadAxis[JOYPAD_AXIS_X] >= 16384)
|
||||
if (type == CONTROL_RIGHT && app.joypadAxis[JOYPAD_AXIS_X] >= AXIS_MAX / 2)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (type == CONTROL_UP && app.joypadAxis[JOYPAD_AXIS_Y] <= -16384)
|
||||
if (type == CONTROL_UP && app.joypadAxis[JOYPAD_AXIS_Y] <= -AXIS_MAX / 2)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (type == CONTROL_DOWN && app.joypadAxis[JOYPAD_AXIS_Y] >= 16384)
|
||||
if (type == CONTROL_DOWN && app.joypadAxis[JOYPAD_AXIS_Y] >= AXIS_MAX / 2)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -20,4 +20,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#include "../common.h"
|
||||
|
||||
#define AXIS_MAX 32767
|
||||
|
||||
extern App app;
|
||||
|
|
Loading…
Reference in New Issue