diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index cc93ce60ab..5c24ddf285 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -528,7 +528,7 @@ static int action_ok_playlist_entry(const char *path, return action_ok_file_load_with_detect_core(entry_path, label, type, selection_ptr, entry_idx); } - rarch_playlist_load_content(playlist, selection_ptr); + rarch_playlist_load_content(playlist, NULL, selection_ptr); if (is_history) { diff --git a/menu/drivers/glui.c b/menu/drivers/glui.c index 859d2dd72e..f0d6297547 100644 --- a/menu/drivers/glui.c +++ b/menu/drivers/glui.c @@ -688,6 +688,7 @@ static void glui_frame(void) const uint32_t title_color = 0xffffffff; const uint32_t activetab_color = 0x0096f2ff; const uint32_t passivetab_color = 0x9e9e9eff; + bool libretro_running = menu_display_ctl(MENU_DISPLAY_CTL_LIBRETRO_RUNNING, NULL); (void)passivetab_color; (void)activetab_color; @@ -711,6 +712,18 @@ static void glui_frame(void) menu_display_ctl(MENU_DISPLAY_CTL_SET_VIEWPORT, NULL); menu_display_ctl(MENU_DISPLAY_CTL_HEADER_HEIGHT, &header_height); + /* Set opacity of transposed background in case + * libretro_running is true so that the white background + * looks better */ + + if (libretro_running) + { + white_transp_bg[3] = 0.90; + white_transp_bg[7] = 0.90; + white_transp_bg[11] = 0.90; + white_transp_bg[15] = 0.90; + } + menu_display_frame_background(menu, settings, gl, width, height, glui->textures.white, 0.75f, false, @@ -718,13 +731,25 @@ static void glui_frame(void) &glui_vertexes[0], &glui_tex_coords[0], 4, MENU_DISPLAY_PRIM_TRIANGLESTRIP); - if (glui->textures.bg.id) - menu_display_frame_background(menu, settings, - gl, width, height, - glui->textures.bg.id, 0.75f, true, - &white_transp_bg[0], &white_bg[0], - &glui_vertexes[0], &glui_tex_coords[0], 4, - MENU_DISPLAY_PRIM_TRIANGLESTRIP); + + if (!libretro_running) + { + if (glui->textures.bg.id) + menu_display_frame_background(menu, settings, + gl, width, height, + glui->textures.bg.id, 0.75f, true, + &white_transp_bg[0], &white_bg[0], + &glui_vertexes[0], &glui_tex_coords[0], 4, + MENU_DISPLAY_PRIM_TRIANGLESTRIP); + } + + /* Restore opacity of transposed background in case + * libretro_running is true */ + + white_transp_bg[3] = 0.30; + white_transp_bg[7] = 0.30; + white_transp_bg[11] = 0.30; + white_transp_bg[15] = 0.30; menu_entries_get_title(title, sizeof(title)); diff --git a/menu/menu_display.c b/menu/menu_display.c index ad409159e7..d0e2443a2c 100644 --- a/menu/menu_display.c +++ b/menu/menu_display.c @@ -253,22 +253,27 @@ bool menu_display_ctl(enum menu_display_ctl_state state, void *data) disp->font.framebuf = *ptr; } return true; - case MENU_DISPLAY_CTL_LIBRETRO: - video_driver_set_texture_enable(true, false); - - if (!settings->menu.pause_libretro) + case MENU_DISPLAY_CTL_LIBRETRO_RUNNING: { driver_t *driver = driver_get_ptr(); global_t *global = global_get_ptr(); + if (!settings->menu.pause_libretro) + if (global->inited.main && (global->inited.core.type != CORE_TYPE_DUMMY)) + return true; + } + break; + case MENU_DISPLAY_CTL_LIBRETRO: + video_driver_set_texture_enable(true, false); - if (global->inited.main && (global->inited.core.type != CORE_TYPE_DUMMY)) - { - bool block_libretro_input = driver->block_libretro_input; - driver->block_libretro_input = true; - core.retro_run(); - driver->block_libretro_input = block_libretro_input; - return true; - } + if (menu_display_ctl(MENU_DISPLAY_CTL_LIBRETRO_RUNNING, NULL)) + { + driver_t *driver = driver_get_ptr(); + bool block_libretro_input = driver->block_libretro_input; + + driver->block_libretro_input = true; + core.retro_run(); + driver->block_libretro_input = block_libretro_input; + return true; } video_driver_cached_frame(); diff --git a/menu/menu_display.h b/menu/menu_display.h index 98e70ae127..d36a28c7eb 100644 --- a/menu/menu_display.h +++ b/menu/menu_display.h @@ -46,6 +46,7 @@ enum menu_display_ctl_state MENU_DISPLAY_CTL_FB_PITCH, MENU_DISPLAY_CTL_SET_FB_PITCH, MENU_DISPLAY_CTL_LIBRETRO, + MENU_DISPLAY_CTL_LIBRETRO_RUNNING, MENU_DISPLAY_CTL_FONT_DATA_INIT, MENU_DISPLAY_CTL_SET_FONT_DATA_INIT, MENU_DISPLAY_CTL_FONT_SIZE, diff --git a/retroarch.c b/retroarch.c index 62559b66ad..ae2d043f36 100644 --- a/retroarch.c +++ b/retroarch.c @@ -1491,11 +1491,10 @@ void rarch_main_deinit(void) * * Initializes core and loads content based on playlist entry. **/ -void rarch_playlist_load_content(void *data, unsigned idx) +void rarch_playlist_load_content(void *data, const char *core_path, unsigned idx) { unsigned i; const char *path = NULL; - const char *core_path = NULL; char *path_check = NULL; char *path_tolower = NULL; RFILE *fp = NULL; @@ -1509,7 +1508,7 @@ void rarch_playlist_load_content(void *data, unsigned idx) return; content_playlist_get_index(playlist, - idx, &path, NULL, &core_path, NULL, NULL, NULL); + idx, &path, NULL, core_path ? NULL : &core_path, NULL, NULL, NULL); path_tolower = strdup(path); diff --git a/retroarch.h b/retroarch.h index 5fa9a679b7..1a75e01789 100644 --- a/retroarch.h +++ b/retroarch.h @@ -165,11 +165,12 @@ void rarch_main_deinit(void); /** * rarch_playlist_load_content: * @playlist : Playlist handle. + * @path : Path to associated core (optional). * @idx : Index in playlist. * * Initializes core and loads content based on playlist entry. **/ -void rarch_playlist_load_content(void *data, unsigned index); +void rarch_playlist_load_content(void *data, const char *core_path, unsigned index); /** * rarch_defer_core: