comparison nuklear_ui/blastem_nuklear.c @ 1483:001120e91fed nuklear_ui

Skip loading menu ROM if Nuklear UI is enabled. Allow disabling Nuklear UI in favor of old menu ROM both at compile time and in config. Fall back to ROM UI if GL is unavailable
author Michael Pavone <pavone@retrodev.com>
date Sat, 25 Nov 2017 20:43:20 -0800
parents 2d203bf73dbd
children d82af64c94d2
comparison
equal deleted inserted replaced
1482:2d203bf73dbd 1483:001120e91fed
60 free(current_path); 60 free(current_path);
61 current_path = full_path; 61 current_path = full_path;
62 free_dir_list(entries, num_entries); 62 free_dir_list(entries, num_entries);
63 entries = NULL; 63 entries = NULL;
64 } else { 64 } else {
65 current_system->next_rom = full_path; 65 if (current_system) {
66 current_system->request_exit(current_system); 66 current_system->next_rom = full_path;
67 current_system->request_exit(current_system);
68 } else {
69 init_system_with_media(full_path, SYSTEM_UNKNOWN);
70 free(full_path);
71 }
67 current_view = view_play; 72 current_view = view_play;
68 } 73 }
69 } 74 }
70 nk_end(context); 75 nk_end(context);
71 } 76 }
252 uint8_t is_nuklear_active(void) 257 uint8_t is_nuklear_active(void)
253 { 258 {
254 return active; 259 return active;
255 } 260 }
256 261
262 uint8_t is_nuklear_available(void)
263 {
264 if (!render_has_gl()) {
265 //currently no fallback if GL2 unavailable
266 return 0;
267 }
268 char *style = tern_find_path(config, "ui\0style\0", TVAL_PTR).ptrval;
269 if (!style) {
270 return 1;
271 }
272 return strcmp(style, "rom") != 0;
273 }
274
257 void blastem_nuklear_init(uint8_t file_loaded) 275 void blastem_nuklear_init(uint8_t file_loaded)
258 { 276 {
259 context = nk_sdl_init(render_get_window()); 277 context = nk_sdl_init(render_get_window());
260 278
261 struct nk_font_atlas *atlas; 279 struct nk_font_atlas *atlas;