Skip to content

Commit

Permalink
Get rid of nbr_joy
Browse files Browse the repository at this point in the history
  • Loading branch information
thesourcehim committed Oct 30, 2024
1 parent 8d112ac commit 67069ee
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion desmume/src/frontend/interface/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ EXPORTED void desmume_input_joy_uninit(void)

EXPORTED u16 desmume_input_joy_number_connected(void)
{
return nbr_joy;
return get_number_of_joysticks();
}

EXPORTED u16 desmume_input_joy_get_key(int index)
Expand Down
4 changes: 1 addition & 3 deletions desmume/src/frontend/posix/shared/ctrlssdl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ u32 joypad_cfg[NB_KEYS];

static_assert(sizeof(keyboard_cfg) == sizeof(joypad_cfg), "");

u16 nbr_joy;
mouse_status mouse;
static int fullscreen;

Expand Down Expand Up @@ -120,7 +119,7 @@ BOOL init_joy( void) {
for(i=0; i<MAX_JOYSTICKS; ++i)
open_joysticks[i]=std::make_pair((SDL_Joystick*)NULL, 0);

nbr_joy = std::min(SDL_NumJoysticks(), MAX_JOYSTICKS);
int nbr_joy = std::min(SDL_NumJoysticks(), MAX_JOYSTICKS);

if ( nbr_joy > 0) {
printf("Found %d joysticks\n", nbr_joy);
Expand Down Expand Up @@ -156,7 +155,6 @@ void uninit_joy( void)
}
}

nbr_joy = 0;
SDL_QuitSubSystem(SDL_INIT_JOYSTICK);
}

Expand Down
2 changes: 0 additions & 2 deletions desmume/src/frontend/posix/shared/ctrlssdl.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ extern const char *key_names[NB_KEYS];
extern u32 keyboard_cfg[NB_KEYS];
/* Current joypad configuration */
extern u32 joypad_cfg[NB_KEYS];
/* Number of detected joypads */
extern u16 nbr_joy;

#ifndef GTK_UI
struct mouse_status
Expand Down

0 comments on commit 67069ee

Please sign in to comment.