Cleanups in the joystick code.
Removed some redundant state and other confusions. Fixes Bugzilla #2738. --HG-- extra : rebase_source : 35dd561553379e00eb8d169ce12ecc99393b2f84
This commit is contained in:
parent
e03d7a79a9
commit
3ff618a9c7
15 changed files with 24 additions and 59 deletions
|
@ -624,7 +624,7 @@ SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index)
|
|||
/* Function to determine is this joystick is attached to the system right now */
|
||||
SDL_bool SDL_SYS_JoystickAttached(SDL_Joystick *joystick)
|
||||
{
|
||||
return !joystick->closed && (joystick->hwdata->item != NULL);
|
||||
return joystick->hwdata->item != NULL;
|
||||
}
|
||||
|
||||
static SDL_INLINE void
|
||||
|
@ -841,9 +841,7 @@ SDL_SYS_JoystickClose(SDL_Joystick * joystick)
|
|||
SDL_free(joystick->hwdata->balls);
|
||||
SDL_free(joystick->hwdata->fname);
|
||||
SDL_free(joystick->hwdata);
|
||||
joystick->hwdata = NULL;
|
||||
}
|
||||
joystick->closed = 1;
|
||||
}
|
||||
|
||||
/* Function to perform any system-specific joystick related cleanup */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue