src/joystick/SDL_gamecontroller.c
changeset 8976 1a5d959d7b32
parent 8972 dfc759d7486f
child 9194 583176c5982f
equal deleted inserted replaced
8975:180271d72b1e 8976:1a5d959d7b32
   256 /*
   256 /*
   257  * Helper function to determine pre-calculated offset to certain joystick mappings
   257  * Helper function to determine pre-calculated offset to certain joystick mappings
   258  */
   258  */
   259 ControllerMapping_t *SDL_PrivateGetControllerMapping(int device_index)
   259 ControllerMapping_t *SDL_PrivateGetControllerMapping(int device_index)
   260 {
   260 {
       
   261 #if SDL_JOYSTICK_XINPUT
   261     if (SDL_SYS_IsXInputGamepad_DeviceIndex(device_index) && s_pXInputMapping) {
   262     if (SDL_SYS_IsXInputGamepad_DeviceIndex(device_index) && s_pXInputMapping) {
   262         return s_pXInputMapping;
   263         return s_pXInputMapping;
   263     }
   264     }
   264     else
   265     else
       
   266 #endif /* SDL_JOYSTICK_XINPUT */
   265     {
   267     {
   266         SDL_JoystickGUID jGUID = SDL_JoystickGetDeviceGUID(device_index);
   268         SDL_JoystickGUID jGUID = SDL_JoystickGetDeviceGUID(device_index);
   267         return SDL_PrivateGetControllerMappingForGUID(&jGUID);
   269         return SDL_PrivateGetControllerMappingForGUID(&jGUID);
   268     }
   270     }
   269 }
   271 }