Mercurial > repos > blastem
comparison render_sdl.c @ 1608:419a0a133b5c
Allow a gamepad mapping to apply to all controllers, controllers of a particular type (i.e.e 6-button PS4 controllers) or specific controllers (based on SDL2 GUID) in addition to the controller in a certain slot
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Fri, 03 Aug 2018 19:32:21 -0700 |
parents | c0727712d529 |
children | 18a946ec74c8 |
comparison
equal
deleted
inserted
replaced
1607:0174759e559f | 1608:419a0a133b5c |
---|---|
812 return NULL; | 812 return NULL; |
813 } | 813 } |
814 return joysticks[index]; | 814 return joysticks[index]; |
815 } | 815 } |
816 | 816 |
817 char* render_joystick_type_id(int index) | |
818 { | |
819 SDL_Joystick *stick = render_get_joystick(index); | |
820 if (!stick) { | |
821 return NULL; | |
822 } | |
823 char *guid_string = malloc(33); | |
824 SDL_JoystickGetGUIDString(SDL_JoystickGetGUID(stick), guid_string, 33); | |
825 return guid_string; | |
826 } | |
827 | |
817 SDL_GameController *render_get_controller(int index) | 828 SDL_GameController *render_get_controller(int index) |
818 { | 829 { |
819 if (index >= MAX_JOYSTICKS) { | 830 if (index >= MAX_JOYSTICKS) { |
820 return NULL; | 831 return NULL; |
821 } | 832 } |