Lines Matching refs:player_index

125     int player_index;  in SDL_FindFreePlayerIndex()  local
127 for (player_index = 0; player_index < SDL_joystick_player_count; ++player_index) { in SDL_FindFreePlayerIndex()
128 if (SDL_joystick_players[player_index] == -1) { in SDL_FindFreePlayerIndex()
129 return player_index; in SDL_FindFreePlayerIndex()
132 return player_index; in SDL_FindFreePlayerIndex()
138 int player_index; in SDL_GetPlayerIndexForJoystickID() local
140 for (player_index = 0; player_index < SDL_joystick_player_count; ++player_index) { in SDL_GetPlayerIndexForJoystickID()
141 if (instance_id == SDL_joystick_players[player_index]) { in SDL_GetPlayerIndexForJoystickID()
145 if (player_index == SDL_joystick_player_count) { in SDL_GetPlayerIndexForJoystickID()
146 player_index = -1; in SDL_GetPlayerIndexForJoystickID()
148 return player_index; in SDL_GetPlayerIndexForJoystickID()
152 SDL_GetJoystickIDForPlayerIndex(int player_index) in SDL_GetJoystickIDForPlayerIndex() argument
154 if (player_index < 0 || player_index >= SDL_joystick_player_count) { in SDL_GetJoystickIDForPlayerIndex()
157 return SDL_joystick_players[player_index]; in SDL_GetJoystickIDForPlayerIndex()
161 SDL_SetJoystickIDForPlayerIndex(int player_index, SDL_JoystickID instance_id) in SDL_SetJoystickIDForPlayerIndex() argument
163 SDL_JoystickID existing_instance = SDL_GetJoystickIDForPlayerIndex(player_index); in SDL_SetJoystickIDForPlayerIndex()
168 if (player_index < 0) { in SDL_SetJoystickIDForPlayerIndex()
171 if (player_index >= SDL_joystick_player_count) { in SDL_SetJoystickIDForPlayerIndex()
172 …D *new_players = (SDL_JoystickID *)SDL_realloc(SDL_joystick_players, (player_index + 1)*sizeof(*SD… in SDL_SetJoystickIDForPlayerIndex()
179 …SDL_memset(&SDL_joystick_players[SDL_joystick_player_count], 0xFF, (player_index - SDL_joystick_pl… in SDL_SetJoystickIDForPlayerIndex()
180 SDL_joystick_player_count = player_index + 1; in SDL_SetJoystickIDForPlayerIndex()
181 } else if (SDL_joystick_players[player_index] == instance_id) { in SDL_SetJoystickIDForPlayerIndex()
192 SDL_joystick_players[player_index] = instance_id; in SDL_SetJoystickIDForPlayerIndex()
197 driver->SetDevicePlayerIndex(device_index, player_index); in SDL_SetJoystickIDForPlayerIndex()
323 int player_index; in SDL_JoystickGetDevicePlayerIndex() local
326 player_index = SDL_GetPlayerIndexForJoystickID(SDL_JoystickGetDeviceInstanceID(device_index)); in SDL_JoystickGetDevicePlayerIndex()
329 return player_index; in SDL_JoystickGetDevicePlayerIndex()
812 SDL_JoystickFromPlayerIndex(int player_index) in SDL_JoystickFromPlayerIndex() argument
818 instance_id = SDL_GetJoystickIDForPlayerIndex(player_index); in SDL_JoystickFromPlayerIndex()
847 int player_index; in SDL_JoystickGetPlayerIndex() local
854 player_index = SDL_GetPlayerIndexForJoystickID(joystick->instance_id); in SDL_JoystickGetPlayerIndex()
857 return player_index; in SDL_JoystickGetPlayerIndex()
864 SDL_JoystickSetPlayerIndex(SDL_Joystick * joystick, int player_index) in SDL_JoystickSetPlayerIndex() argument
871 SDL_SetJoystickIDForPlayerIndex(player_index, joystick->instance_id); in SDL_JoystickSetPlayerIndex()
1039 int player_index = -1; in SDL_PrivateJoystickAdded() local
1049 player_index = driver->GetDevicePlayerIndex(driver_device_index); in SDL_PrivateJoystickAdded()
1051 if (player_index < 0 && SDL_IsGameController(device_index)) { in SDL_PrivateJoystickAdded()
1052 player_index = SDL_FindFreePlayerIndex(); in SDL_PrivateJoystickAdded()
1054 if (player_index >= 0) { in SDL_PrivateJoystickAdded()
1055 SDL_SetJoystickIDForPlayerIndex(player_index, device_instance); in SDL_PrivateJoystickAdded()
1128 int player_index; in SDL_PrivateJoystickRemoved() local
1155 player_index = SDL_GetPlayerIndexForJoystickID(device_instance); in SDL_PrivateJoystickRemoved()
1156 if (player_index >= 0) { in SDL_PrivateJoystickRemoved()
1157 SDL_joystick_players[player_index] = -1; in SDL_PrivateJoystickRemoved()