Mercurial > repos > blastem
comparison controller_info.c @ 1859:52f136052ab0
Allow changing SDL2 mapping and controller type after initial configuration
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Fri, 03 May 2019 18:33:26 -0700 |
parents | a4cae960fd08 |
children | fc05f49075c2 |
comparison
equal
deleted
inserted
replaced
1858:dda7479f3bbb | 1859:52f136052ab0 |
---|---|
193 { | 193 { |
194 #ifndef USE_FBDEV | 194 #ifndef USE_FBDEV |
195 char guid_string[33]; | 195 char guid_string[33]; |
196 SDL_JoystickGetGUIDString(SDL_JoystickGetGUID(render_get_joystick(joystick)), guid_string, sizeof(guid_string)); | 196 SDL_JoystickGetGUIDString(SDL_JoystickGetGUID(render_get_joystick(joystick)), guid_string, sizeof(guid_string)); |
197 tern_node *existing = tern_find_node(info_config, guid_string); | 197 tern_node *existing = tern_find_node(info_config, guid_string); |
198 existing = tern_insert_ptr(existing, "subtype", (void *)subtype_names[info->subtype]); | 198 existing = tern_insert_ptr(existing, "subtype", strdup(subtype_names[info->subtype])); |
199 existing = tern_insert_ptr(existing, "variant", (void *)variant_names[info->variant]); | 199 existing = tern_insert_ptr(existing, "variant", strdup(variant_names[info->variant])); |
200 info_config = tern_insert_node(info_config, guid_string, existing); | 200 info_config = tern_insert_node(info_config, guid_string, existing); |
201 persist_config_at(config, info_config, "controller_types.cfg"); | 201 persist_config_at(config, info_config, "controller_types.cfg"); |
202 #endif | 202 #endif |
203 } | 203 } |
204 | 204 |