Mercurial > repos > blastem
comparison render_sdl.c @ 2018:193b804c9845
Add a UI button to reset config to defaults
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 09 Nov 2020 00:29:47 -0800 |
parents | 66f08024d9e9 |
children | 0757da8ee702 |
comparison
equal
deleted
inserted
replaced
2017:8e7b06ade815 | 2018:193b804c9845 |
---|---|
1201 | 1201 |
1202 render_set_video_standard(VID_NTSC); | 1202 render_set_video_standard(VID_NTSC); |
1203 | 1203 |
1204 atexit(render_quit); | 1204 atexit(render_quit); |
1205 } | 1205 } |
1206 | |
1207 void render_reset_mappings(void) | |
1208 { | |
1209 SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER); | |
1210 SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER); | |
1211 uint32_t db_size; | |
1212 char *db_data = read_bundled_file("gamecontrollerdb.txt", &db_size); | |
1213 if (db_data) { | |
1214 int added = SDL_GameControllerAddMappingsFromRW(SDL_RWFromMem(db_data, db_size), 1); | |
1215 free(db_data); | |
1216 debug_message("Added %d game controller mappings from gamecontrollerdb.txt\n", added); | |
1217 } | |
1218 } | |
1206 static int in_toggle; | 1219 static int in_toggle; |
1207 | 1220 |
1208 void render_config_updated(void) | 1221 void render_config_updated(void) |
1209 { | 1222 { |
1210 free_surfaces(); | 1223 free_surfaces(); |