diff options
author | Simon Howard | 2008-11-24 19:01:09 +0000 |
---|---|---|
committer | Simon Howard | 2008-11-24 19:01:09 +0000 |
commit | 2f67325278637a349bb86fa6fc388e527a75a5c9 (patch) | |
tree | 43654566eb557d5f909ed45b16b86c3346a1798c /src/setup/joystick.c | |
parent | 09f98f80fc8ed9e42ea937804618952f03244bde (diff) | |
download | chocolate-doom-2f67325278637a349bb86fa6fc388e527a75a5c9.tar.gz chocolate-doom-2f67325278637a349bb86fa6fc388e527a75a5c9.tar.bz2 chocolate-doom-2f67325278637a349bb86fa6fc388e527a75a5c9.zip |
Make chocolate-setup use m_controls.c definitions for config file
keyboard/mouse/joystick variables. Make other configuration file
variables static and add bind functions.
Subversion-branch: /branches/raven-branch
Subversion-revision: 1387
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); +} + |