/* Returns 1 if the joystick has been opened, or 0 if it has not.  */
int SDL_JoystickOpened(int device_index)
/* Returns 1 if the joystick has been opened, or 0 if it has not.  */
int SDL_JoystickOpened(int device_index)
{
	int i, opened;
	opened = 0;
	for ( i=0; SDL_joysticks[i]; ++i ) {
		if ( SDL_joysticks[i]->index == (Uint8)device_index ) {
			opened = 1;
			break;
		}
	}
	return(opened);
}