Unified code to standardize joystick names

This commit is contained in:
Sam Lantinga 2020-03-12 19:47:30 -07:00
parent db3b3a1d84
commit c44473ba73
11 changed files with 182 additions and 173 deletions

View file

@ -60,7 +60,7 @@ Emscripten_JoyStickConnected(int eventType, const EmscriptenGamepadEvent *gamepa
SDL_zerop(item);
item->index = gamepadEvent->index;
item->name = SDL_strdup(gamepadEvent->id);
item->name = SDL_CreateJoystickName(0, 0, NULL, gamepadEvent->id);
if ( item->name == NULL ) {
SDL_free(item);
return 1;