diff options
Diffstat (limited to 'src/setup/joystick.c')
-rw-r--r-- | src/setup/joystick.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/src/setup/joystick.c b/src/setup/joystick.c index 69c0e508..9b064905 100644 --- a/src/setup/joystick.c +++ b/src/setup/joystick.c @@ -23,6 +23,8 @@ #include <stdlib.h> #include "doomtype.h" +#include "m_config.h" +#include "m_controls.h" #include "textscreen.h" #include "txt_joybinput.h" @@ -41,16 +43,7 @@ static int joystick_initted = 0; // Joystick enable/disable -int usejoystick = 0; - -// Button mappings - -int joybfire = 0; -int joybstrafe = 1; -int joybuse = 2; -int joybspeed = 3; -int joybstrafeleft = -1; -int joybstraferight = -1; +static int usejoystick = 0; // Joystick to use, as an SDL joystick index: @@ -59,14 +52,14 @@ 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; static txt_button_t *joystick_button; @@ -438,3 +431,13 @@ void ConfigJoystick(void) SetJoystickButtonLabel(); } +void 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); +} + |