1) rarch_playlist_load_content - add argument

2) GLUI - handle libretro_pause being false better - hide
background and make white background look better
This commit is contained in:
twinaphex 2015-10-31 17:06:08 +01:00
parent a509fc50b1
commit 1ddd33336a
6 changed files with 55 additions and 24 deletions

View File

@ -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)
{

View File

@ -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));

View File

@ -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();

View File

@ -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,

View File

@ -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);

View File

@ -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: