Engine/lib/sdl/src/joystick/SDL_gamecontroller.c
/*
 * Helper function to refresh a mapping
 */
Helper function to refresh a mapping
Helper function to refresh a mapping
void SDL_PrivateGameControllerRefreshMapping(ControllerMapping_t *pControllerMapping)
{
    SDL_GameController *gamecontrollerlist = SDL_gamecontrollers;
    while (gamecontrollerlist) {
        if (!SDL_memcmp(&gamecontrollerlist->mapping.guid, &pControllerMapping->guid, sizeof(pControllerMapping->guid))) {
            SDL_Event event;
            event.type = SDL_CONTROLLERDEVICEREMAPPED;
            event.cdevice.which = gamecontrollerlist->joystick->instance_id;
            SDL_PushEvent(&event);
            SDL_PrivateLoadButtonMapping(&gamecontrollerlist->mapping, pControllerMapping->guid, pControllerMapping->name, pControllerMapping->mapping);
        }
        gamecontrollerlist = gamecontrollerlist->next;
    }
}
void SDL_PrivateGameControllerRefreshMapping ( ControllerMapping_t * pControllerMapping ) { SDL_GameController * gamecontrollerlist = SDL_gamecontrollers ; while ( gamecontrollerlist ) { if ( ! SDL_memcmp ( & gamecontrollerlist -> mapping . guid , & pControllerMapping -> guid , sizeof ( pControllerMapping -> guid ) ) ) { SDL_Event event ; event . type = SDL_CONTROLLERDEVICEREMAPPED ; event . cdevice . which = gamecontrollerlist -> joystick -> instance_id ; SDL_PushEvent ( & event ) ; SDL_PrivateLoadButtonMapping ( & gamecontrollerlist -> mapping , pControllerMapping -> guid , pControllerMapping -> name , pControllerMapping -> mapping ) ; } gamecontrollerlist = gamecontrollerlist -> next ; } }
Helper function to refresh a mapping
Helper function to refresh a mapping
/* Not really threadsafe.  Should this lock access within SDL_GameControllerEventWatcher? */