diff options
Diffstat (limited to 'src/i_joystick.c')
-rw-r--r-- | src/i_joystick.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/src/i_joystick.c b/src/i_joystick.c index d48e8409..7767c19d 100644 --- a/src/i_joystick.c +++ b/src/i_joystick.c @@ -31,12 +31,12 @@ #include <stdio.h> #include <string.h> -#include "doomdef.h" #include "doomtype.h" #include "d_event.h" -#include "d_main.h" #include "i_joystick.h" +#include "m_config.h" + // When an axis is within the dead zone, it is set to zero. // This is 5% of the full range: @@ -48,23 +48,23 @@ static SDL_Joystick *joystick = NULL; // Standard default.cfg Joystick enable/disable -extern int usejoystick; +static int usejoystick = 0; // Joystick to use, as an SDL joystick index: -int joystick_index = -1; +static int joystick_index = -1; // Which joystick axis to use for horizontal movement, and whether to // invert the direction: -int joystick_x_axis = 0; -int joystick_x_invert = 0; +static int joystick_x_axis = 0; +static int joystick_x_invert = 0; // Which joystick axis to use for vertical movement, and whether to // invert the direction: -int joystick_y_axis = 1; -int joystick_y_invert = 0; +static int joystick_y_axis = 1; +static int joystick_y_invert = 0; void I_InitJoystick(void) { @@ -186,3 +186,13 @@ void I_UpdateJoystick(void) } } +void I_BindJoystickVariables(void) +{ + M_BindVariable("use_joystick", &usejoystick); + M_BindVariable("joystick_index", &joystick_index); + M_BindVariable("joystick_x_axis", &joystick_x_axis); + M_BindVariable("joystick_y_axis", &joystick_y_axis); + M_BindVariable("joystick_x_invert", &joystick_x_invert); + M_BindVariable("joystick_y_invert", &joystick_y_invert); +} + |