mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-30 15:08:31 +00:00
Added a single source of SDL object IDs
This ensures that we don't accidentally interpret an ID from one system as an ID in another system. Audio device IDs are not covered here, since they have a unique numbering system.
This commit is contained in:
@@ -116,7 +116,6 @@ static SDL_bool SDL_joysticks_initialized;
|
||||
static SDL_bool SDL_joysticks_quitting;
|
||||
static SDL_bool SDL_joystick_being_added;
|
||||
static SDL_Joystick *SDL_joysticks SDL_GUARDED_BY(SDL_joystick_lock) = NULL;
|
||||
static SDL_AtomicInt SDL_last_joystick_instance_id;
|
||||
static int SDL_joystick_player_count SDL_GUARDED_BY(SDL_joystick_lock) = 0;
|
||||
static SDL_JoystickID *SDL_joystick_players SDL_GUARDED_BY(SDL_joystick_lock) = NULL;
|
||||
static SDL_bool SDL_joystick_allows_background_events = SDL_FALSE;
|
||||
@@ -413,15 +412,6 @@ SDL_JoystickID *SDL_GetJoysticks(int *count)
|
||||
return joysticks;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the next available joystick instance ID
|
||||
* This may be called by drivers from multiple threads, unprotected by any locks
|
||||
*/
|
||||
SDL_JoystickID SDL_GetNextJoystickInstanceID(void)
|
||||
{
|
||||
return SDL_AtomicIncRef(&SDL_last_joystick_instance_id) + 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the implementation dependent name of a joystick
|
||||
*/
|
||||
|
Reference in New Issue
Block a user