Mercurial > repos > blastem
comparison blastem.c @ 1573:a051d8ee4528
Only save config file if something has changed. Re-initialize audio and video with new settings if config has changed
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Fri, 27 Apr 2018 20:08:47 -0700 |
parents | b525491b4e5b |
children | 7121daaa48c2 |
comparison
equal
deleted
inserted
replaced
1572:5efeca06d942 | 1573:a051d8ee4528 |
---|---|
275 persist_save_registered = 1; | 275 persist_save_registered = 1; |
276 } | 276 } |
277 } | 277 } |
278 } | 278 } |
279 | 279 |
280 void apply_updated_config(void) | |
281 { | |
282 render_config_updated(); | |
283 } | |
284 | |
280 static void on_drag_drop(const char *filename) | 285 static void on_drag_drop(const char *filename) |
281 { | 286 { |
282 if (current_system->next_rom) { | 287 if (current_system->next_rom) { |
283 free(current_system->next_rom); | 288 free(current_system->next_rom); |
284 } | 289 } |
373 menu_system->next_context = game_system; | 378 menu_system->next_context = game_system; |
374 } | 379 } |
375 game_system->next_context = menu_system; | 380 game_system->next_context = menu_system; |
376 setup_saves(&cart, &info, game_system); | 381 setup_saves(&cart, &info, game_system); |
377 update_title(info.name); | 382 update_title(info.name); |
378 } | |
379 | |
380 static void save_config(void) | |
381 { | |
382 persist_config(config); | |
383 } | 383 } |
384 | 384 |
385 int main(int argc, char ** argv) | 385 int main(int argc, char ** argv) |
386 { | 386 { |
387 set_exe_str(argv[0]); | 387 set_exe_str(argv[0]); |
614 menu_system = current_system; | 614 menu_system = current_system; |
615 } else { | 615 } else { |
616 game_system = current_system; | 616 game_system = current_system; |
617 } | 617 } |
618 } | 618 } |
619 | |
620 atexit(save_config); | |
621 | 619 |
622 #ifndef DISABLE_NUKLEAR | 620 #ifndef DISABLE_NUKLEAR |
623 if (use_nuklear) { | 621 if (use_nuklear) { |
624 blastem_nuklear_init(!menu); | 622 blastem_nuklear_init(!menu); |
625 current_system = game_system; | 623 current_system = game_system; |