Initialize the raw_map before getting controller mappings from the driver
parent
2db049473b
commit
39c958bbaa
|
@ -1193,6 +1193,8 @@ static ControllerMapping_t *SDL_PrivateGetControllerMapping(int device_index)
|
||||||
mapping = SDL_PrivateGetControllerMappingForNameAndGUID(name, guid);
|
mapping = SDL_PrivateGetControllerMappingForNameAndGUID(name, guid);
|
||||||
if (!mapping) {
|
if (!mapping) {
|
||||||
SDL_GamepadMapping raw_map;
|
SDL_GamepadMapping raw_map;
|
||||||
|
|
||||||
|
SDL_zero(raw_map);
|
||||||
if (SDL_PrivateJoystickGetAutoGamepadMapping(device_index, &raw_map)) {
|
if (SDL_PrivateJoystickGetAutoGamepadMapping(device_index, &raw_map)) {
|
||||||
mapping = SDL_PrivateGenerateAutomaticControllerMapping(name, guid, &raw_map);
|
mapping = SDL_PrivateGenerateAutomaticControllerMapping(name, guid, &raw_map);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue