Added nbr_joy variable for interfaces using joysticks.

This commit is contained in:
evilynux 2007-01-12 23:44:23 +00:00
parent 96040fecb6
commit 12b0460342
2 changed files with 5 additions and 4 deletions

View File

@ -24,7 +24,7 @@
/* Initialize joysticks */
BOOL init_joy(u16 joyCfg[]) {
int i, nbJoysticks;
int i;
/* Joystick configuration */
memcpy(joypadCfg, joyCfg, sizeof(joypadCfg));
@ -36,10 +36,10 @@ BOOL init_joy(u16 joyCfg[]) {
return FALSE;
}
nbJoysticks = SDL_NumJoysticks();
printf("Nbr of joysticks: %d\n\n", nbJoysticks);
nbr_joy = SDL_NumJoysticks();
printf("Nbr of joysticks: %d\n\n", nbr_joy);
for (i = 0; i < nbJoysticks; i++)
for (i = 0; i < nbr_joy; i++)
{
SDL_Joystick * joy = SDL_JoystickOpen(i);
printf("Joystick %s\n", i, SDL_JoystickName(i));

View File

@ -38,6 +38,7 @@
#define KEYMASK_(k) (1 << k)
u16 joypadCfg[NB_KEYS];
u16 nbr_joy;
#ifndef GTK_UI
struct mouse_status