diff --git a/include/QF/joystick.h b/include/QF/joystick.h index bc9d7f68f..0d622515b 100644 --- a/include/QF/joystick.h +++ b/include/QF/joystick.h @@ -29,6 +29,7 @@ #define __QF_joystick_h_ #include +#include "QF/quakeio.h" #define JOY_MAX_AXES 8 #define JOY_MAX_BUTTONS 18 @@ -147,4 +148,7 @@ int JOY_GetOption_i (const char *c); const char * JOY_GetDest_c (int i); int JOY_GetDest_i (const char *c); + +void Joy_WriteBindings (QFile *f); + #endif // __QF_joystick_h_ diff --git a/libs/video/targets/joy.c b/libs/video/targets/joy.c index aafc46beb..5276c0005 100644 --- a/libs/video/targets/joy.c +++ b/libs/video/targets/joy.c @@ -264,8 +264,22 @@ in_joy_f (void) { int i, ax, c = Cmd_Argc(); - if (c < 3) { + if (c == 2) { + ax = strtol(Cmd_Argv(1), NULL ,0); + + Sys_Printf ("<=====> AXIS %i <=====>\n", ax); + Sys_Printf ("amp: %f\n", joy_axes[ax].amp); + Sys_Printf ("pre_amp: %f\n", joy_axes[ax].pre_amp); + Sys_Printf ("deadzone: %i\n", joy_axes[ax].deadzone); + Sys_Printf ("offset: %f\n", joy_axes[ax].offset); + Sys_Printf ("type: %s\n", JOY_GetDest_c(joy_axes[ax].dest)); + Sys_Printf ("<====================>\n"); + + + } + else if (c < 4) { Sys_Printf ("in_joy [ ]* : Configures the joystick behaviour\n"); + return; } ax = strtol(Cmd_Argv(1), NULL ,0); @@ -278,7 +292,6 @@ in_joy_f (void) switch (var) { case js_amp: joy_axes[ax].amp = strtof (Cmd_Argv(i++), NULL); - Sys_Printf("Set axis %i's amp to %f\n", ax, joy_axes[ax].amp); break; case js_pre_amp: joy_axes[ax].pre_amp = strtof (Cmd_Argv(i++), NULL); @@ -293,6 +306,8 @@ in_joy_f (void) joy_axes[ax].dest = JOY_GetDest_i (Cmd_Argv(i++)); joy_axes[ax].axis = strtol (Cmd_Argv(i++), NULL, 10); break; + case js_axis_button: + break; default: Sys_Printf ("Unknown option %s.\n", Cmd_Argv(i-1)); break; @@ -315,6 +330,19 @@ JOY_Init_Cvars (void) Cmd_AddCommand("in_joy", in_joy_f, "Configures the joystick behaviour"); } + +void +Joy_WriteBindings (QFile *f) +{ + int i; + for (i=0;i