Merge remote-tracking branch 'refs/remotes/libretro/master'

This commit is contained in:
lugaidster 2015-10-29 23:45:32 -03:00
commit a0050dd5bb
13 changed files with 449 additions and 17 deletions

View File

@ -64,6 +64,13 @@ void gl_load_texture_data(GLuint id,
glBindTexture(GL_TEXTURE_2D, id); glBindTexture(GL_TEXTURE_2D, id);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, wrap); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, wrap);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrap); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrap);
#ifdef IOS
if (filter_type == TEXTURE_FILTER_MIPMAP_LINEAR)
filter_type = TEXTURE_FILTER_LINEAR;
if (filter_type == TEXTURE_FILTER_MIPMAP_NEAREST)
filter_type = TEXTURE_FILTER_NEAREST;
#endif
switch (filter_type) switch (filter_type)
{ {

View File

@ -158,6 +158,9 @@ static const char *stock_fragment_legacy =
"}"; "}";
static const char *stock_vertex_modern_blend = static const char *stock_vertex_modern_blend =
"#ifdef GL_ES\n"
"precision mediump float;\n"
"#endif\n"
"attribute vec2 TexCoord;\n" "attribute vec2 TexCoord;\n"
"attribute vec2 VertexCoord;\n" "attribute vec2 VertexCoord;\n"
"attribute vec4 Color;\n" "attribute vec4 Color;\n"

View File

@ -74,6 +74,10 @@ static int net_http_new_socket(const char *domain, int port)
#endif #endif
struct addrinfo hints, *addr = NULL; struct addrinfo hints, *addr = NULL;
char portstr[16] = {0}; char portstr[16] = {0};
/* Initialize the network. */
if (!network_init())
return -1;
snprintf(portstr, sizeof(portstr), "%i", port); snprintf(portstr, sizeof(portstr), "%i", port);

View File

@ -496,6 +496,7 @@ static int menu_cbs_init_bind_left_compare_type(menu_file_list_cbs_t *cbs,
case MENU_VALUE_MAIN_MENU: case MENU_VALUE_MAIN_MENU:
case MENU_VALUE_HISTORY_TAB: case MENU_VALUE_HISTORY_TAB:
case MENU_VALUE_ADD_TAB: case MENU_VALUE_ADD_TAB:
case MENU_VALUE_PLAYLISTS_TAB:
BIND_ACTION_LEFT(cbs, action_left_mainmenu); BIND_ACTION_LEFT(cbs, action_left_mainmenu);
break; break;
default: default:
@ -525,6 +526,20 @@ int menu_cbs_init_bind_left(menu_file_list_cbs_t *cbs,
BIND_ACTION_LEFT(cbs, bind_left_generic); BIND_ACTION_LEFT(cbs, bind_left_generic);
if (type == MENU_SETTING_NO_ITEM)
{
switch (menu_label_hash)
{
case MENU_VALUE_HORIZONTAL_MENU:
case MENU_VALUE_MAIN_MENU:
case 153956705: /* TODO/FIXME - dehardcode */
BIND_ACTION_LEFT(cbs, action_left_mainmenu);
return 0;
default:
break;
}
}
if (menu_cbs_init_bind_left_compare_label(cbs, label, label_hash, menu_label_hash, elem0) == 0) if (menu_cbs_init_bind_left_compare_label(cbs, label, label_hash, menu_label_hash, elem0) == 0)
return 0; return 0;

View File

@ -552,6 +552,20 @@ int menu_cbs_init_bind_right(menu_file_list_cbs_t *cbs,
return -1; return -1;
BIND_ACTION_RIGHT(cbs, bind_right_generic); BIND_ACTION_RIGHT(cbs, bind_right_generic);
if (type == MENU_SETTING_NO_ITEM)
{
switch (menu_label_hash)
{
case MENU_VALUE_HORIZONTAL_MENU:
case MENU_VALUE_MAIN_MENU:
case 153956705: /* TODO/FIXME - dehardcode */
BIND_ACTION_RIGHT(cbs, action_right_mainmenu);
return 0;
default:
break;
}
}
if (menu_cbs_init_bind_right_compare_label(cbs, label, label_hash, menu_label_hash, elem0) == 0) if (menu_cbs_init_bind_right_compare_label(cbs, label, label_hash, menu_label_hash, elem0) == 0)
return 0; return 0;

View File

@ -19,6 +19,7 @@
#include <stddef.h> #include <stddef.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <string/stdstring.h>
#include <limits.h> #include <limits.h>
#include <retro_log.h> #include <retro_log.h>
@ -43,9 +44,24 @@ enum
GLUI_TEXTURE_BACK, GLUI_TEXTURE_BACK,
GLUI_TEXTURE_SWITCH_ON, GLUI_TEXTURE_SWITCH_ON,
GLUI_TEXTURE_SWITCH_OFF, GLUI_TEXTURE_SWITCH_OFF,
GLUI_TEXTURE_TAB_MAIN_ACTIVE,
GLUI_TEXTURE_TAB_PLAYLISTS_ACTIVE,
GLUI_TEXTURE_TAB_SETTINGS_ACTIVE,
GLUI_TEXTURE_TAB_MAIN_PASSIVE,
GLUI_TEXTURE_TAB_PLAYLISTS_PASSIVE,
GLUI_TEXTURE_TAB_SETTINGS_PASSIVE,
GLUI_TEXTURE_LAST GLUI_TEXTURE_LAST
}; };
enum
{
GLUI_SYSTEM_TAB_MAIN = 0,
GLUI_SYSTEM_TAB_PLAYLISTS,
GLUI_SYSTEM_TAB_SETTINGS
};
#define GLUI_SYSTEM_TAB_END GLUI_SYSTEM_TAB_SETTINGS
struct glui_texture_item struct glui_texture_item
{ {
GRuint id; GRuint id;
@ -53,6 +69,7 @@ struct glui_texture_item
typedef struct glui_handle typedef struct glui_handle
{ {
unsigned tabs_height;
unsigned line_height; unsigned line_height;
unsigned icon_size; unsigned icon_size;
unsigned margin; unsigned margin;
@ -71,6 +88,19 @@ typedef struct glui_handle
GRuint white; GRuint white;
} textures; } textures;
struct
{
struct
{
unsigned idx;
unsigned idx_old;
} active;
float x_pos;
size_t selection_ptr_old;
size_t selection_ptr;
} categories;
gfx_font_raster_block_t list_block; gfx_font_raster_block_t list_block;
} glui_handle_t; } glui_handle_t;
@ -111,6 +141,24 @@ static void glui_context_reset_textures(glui_handle_t *glui, const char *iconpat
case GLUI_TEXTURE_SWITCH_OFF: case GLUI_TEXTURE_SWITCH_OFF:
fill_pathname_join(path, iconpath, "off.png", sizeof(path)); fill_pathname_join(path, iconpath, "off.png", sizeof(path));
break; break;
case GLUI_TEXTURE_TAB_MAIN_ACTIVE:
fill_pathname_join(path, iconpath, "main_tab_active.png", sizeof(path));
break;
case GLUI_TEXTURE_TAB_PLAYLISTS_ACTIVE:
fill_pathname_join(path, iconpath, "playlists_tab_active.png", sizeof(path));
break;
case GLUI_TEXTURE_TAB_SETTINGS_ACTIVE:
fill_pathname_join(path, iconpath, "settings_tab_active.png", sizeof(path));
break;
case GLUI_TEXTURE_TAB_MAIN_PASSIVE:
fill_pathname_join(path, iconpath, "main_tab_passive.png", sizeof(path));
break;
case GLUI_TEXTURE_TAB_PLAYLISTS_PASSIVE:
fill_pathname_join(path, iconpath, "playlists_tab_passive.png", sizeof(path));
break;
case GLUI_TEXTURE_TAB_SETTINGS_PASSIVE:
fill_pathname_join(path, iconpath, "settings_tab_passive.png", sizeof(path));
break;
} }
if (path[0] == '\0' || !path_file_exists(path)) if (path[0] == '\0' || !path_file_exists(path))
@ -233,7 +281,7 @@ static void glui_draw_scrollbar(gl_t *gl, unsigned width, unsigned height, GRflo
glui = (glui_handle_t*)menu->userdata; glui = (glui_handle_t*)menu->userdata;
content_height = menu_entries_get_end() * glui->line_height; content_height = menu_entries_get_end() * glui->line_height;
total_height = height - header_height; total_height = height - header_height - glui->tabs_height;
scrollbar_height = total_height / (content_height / total_height) - (header_height / 6); scrollbar_height = total_height / (content_height / total_height) - (header_height / 6);
y = total_height * menu->scroll_y / content_height; y = total_height * menu->scroll_y / content_height;
@ -370,12 +418,12 @@ static void glui_render(void)
menu->scroll_y = 0; menu->scroll_y = 0;
bottom = menu_entries_get_end() * glui->line_height bottom = menu_entries_get_end() * glui->line_height
- height + header_height; - height + header_height + glui->tabs_height;
if (menu->scroll_y > bottom) if (menu->scroll_y > bottom)
menu->scroll_y = bottom; menu->scroll_y = bottom;
if (menu_entries_get_end() * glui->line_height if (menu_entries_get_end() * glui->line_height
< height - header_height) < height - header_height - glui->tabs_height)
menu->scroll_y = 0; menu->scroll_y = 0;
if (menu_entries_get_end() < height / glui->line_height) if (menu_entries_get_end() < height / glui->line_height)
@ -551,6 +599,20 @@ static void glui_draw_cursor(gl_t *gl, glui_handle_t *glui,
MENU_DISPLAY_PRIM_TRIANGLESTRIP); MENU_DISPLAY_PRIM_TRIANGLESTRIP);
} }
static size_t glui_list_get_size(void *data, menu_list_type_t type)
{
size_t list_size = 0;
/*switch (type)
{
case MENU_LIST_PLAIN:*/
list_size = menu_entries_get_stack_size(0);
/*break;
}*/
return list_size;
}
static void glui_frame(void) static void glui_frame(void)
{ {
unsigned header_height; unsigned header_height;
@ -603,7 +665,7 @@ static void glui_frame(void)
0, 0, 0, 0.2, 0, 0, 0, 0.2,
0, 0, 0, 0.2, 0, 0, 0, 0.2,
}; };
unsigned width, height, ticker_limit; unsigned width, height, ticker_limit, i, tab_width;
char msg[PATH_MAX_LENGTH]; char msg[PATH_MAX_LENGTH];
char title[PATH_MAX_LENGTH]; char title[PATH_MAX_LENGTH];
char title_buf[PATH_MAX_LENGTH]; char title_buf[PATH_MAX_LENGTH];
@ -619,6 +681,11 @@ static void glui_frame(void)
const uint32_t normal_color = 0x212121ff; const uint32_t normal_color = 0x212121ff;
const uint32_t hover_color = 0x212121ff; const uint32_t hover_color = 0x212121ff;
const uint32_t title_color = 0xffffffff; const uint32_t title_color = 0xffffffff;
const uint32_t activetab_color = 0x0096f2ff;
const uint32_t passivetab_color = 0x9e9e9eff;
(void)passivetab_color;
(void)activetab_color;
if (!menu || !menu->userdata) if (!menu || !menu->userdata)
return; return;
@ -674,7 +741,68 @@ static void glui_frame(void)
width, height, width, height,
&blue_bg[0]); &blue_bg[0]);
/* shadow underneath header */ /* display tabs if depth equal one, if not hide them */
if (glui_list_get_size(menu, MENU_LIST_PLAIN) == 1)
{
float scale_factor;
menu_display_ctl(MENU_DISPLAY_CTL_GET_DPI, &scale_factor);
glui->tabs_height = scale_factor / 3;
/* tabs background */
glui_render_quad(gl, 0, height - glui->tabs_height, width,
glui->tabs_height,
width, height,
&white_bg[0]);
/* tabs separator */
glui_render_quad(gl, 0, height - glui->tabs_height, width,
1,
width, height,
&grey_bg[0]);
for (i = 0; i <= GLUI_SYSTEM_TAB_END; i++)
{
unsigned tab_icon = GLUI_TEXTURE_TAB_MAIN_PASSIVE;
switch (i)
{
case GLUI_SYSTEM_TAB_MAIN:
tab_icon = (i == glui->categories.selection_ptr)
? GLUI_TEXTURE_TAB_MAIN_ACTIVE
: GLUI_TEXTURE_TAB_MAIN_PASSIVE;
break;
case GLUI_SYSTEM_TAB_PLAYLISTS:
tab_icon = (i == glui->categories.selection_ptr)
? GLUI_TEXTURE_TAB_PLAYLISTS_ACTIVE
: GLUI_TEXTURE_TAB_PLAYLISTS_PASSIVE;
break;
case GLUI_SYSTEM_TAB_SETTINGS:
tab_icon = (i == glui->categories.selection_ptr)
? GLUI_TEXTURE_TAB_SETTINGS_ACTIVE
: GLUI_TEXTURE_TAB_SETTINGS_PASSIVE;
break;
}
glui_draw_icon(gl, glui, glui->textures.list[tab_icon].id,
width / (GLUI_SYSTEM_TAB_END+1) * (i+0.5) - glui->icon_size/2,
height - glui->tabs_height,
width, height, 0, 1, &pure_white[0]);
}
/* active tab marker */
tab_width = width / (GLUI_SYSTEM_TAB_END+1);
glui_render_quad(gl, glui->categories.selection_ptr * tab_width,
height - (header_height/16),
tab_width,
header_height/16,
width, height,
&blue_bg[0]);
}
else
{
glui->tabs_height = 0;
}
glui_render_quad(gl, 0, header_height, width, glui_render_quad(gl, 0, header_height, width,
header_height/12, header_height/12,
width, height, width, height,
@ -686,7 +814,7 @@ static void glui_frame(void)
{ {
title_margin = glui->icon_size; title_margin = glui->icon_size;
glui_draw_icon(gl, glui, glui->textures.list[GLUI_TEXTURE_BACK].id, glui_draw_icon(gl, glui, glui->textures.list[GLUI_TEXTURE_BACK].id,
0, 0, width, height, 0, 1, &white_bg[0]); 0, 0, width, height, 0, 1, &pure_white[0]);
} }
ticker_limit = (width - glui->margin*2) / glui->glyph_width; ticker_limit = (width - glui->margin*2) / glui->glyph_width;
@ -780,6 +908,7 @@ static void glui_layout(menu_handle_t *menu, glui_handle_t *glui)
new_header_height = scale_factor / 3; new_header_height = scale_factor / 3;
new_font_size = scale_factor / 9; new_font_size = scale_factor / 9;
glui->tabs_height = scale_factor / 3;
glui->line_height = scale_factor / 3; glui->line_height = scale_factor / 3;
glui->margin = scale_factor / 9; glui->margin = scale_factor / 9;
glui->icon_size = scale_factor / 3; glui->icon_size = scale_factor / 3;
@ -873,16 +1002,21 @@ static void glui_context_bg_destroy(glui_handle_t *glui)
static void glui_context_destroy(void) static void glui_context_destroy(void)
{ {
gl_t *gl = (gl_t*)video_driver_get_ptr(NULL); unsigned i;
glui_handle_t *glui = NULL; glui_handle_t *glui = NULL;
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
driver_t *driver = driver_get_ptr();
if (!menu || !menu->userdata || !gl || !driver) if (!menu || !menu->userdata)
return; return;
glui = (glui_handle_t*)menu->userdata; glui = (glui_handle_t*)menu->userdata;
if (!glui)
return;
for (i = 0; i < GLUI_TEXTURE_LAST; i++)
video_texture_unload((uintptr_t*)&glui->textures.list[i].id);
menu_display_free_main_font(); menu_display_free_main_font();
glui_context_bg_destroy(glui); glui_context_bg_destroy(glui);
@ -1027,6 +1161,141 @@ static int glui_environ(menu_environ_cb_t type, void *data)
return -1; return -1;
} }
static void glui_list_cache(menu_list_type_t type, unsigned action)
{
size_t stack_size, list_size;
glui_handle_t *glui = NULL;
menu_handle_t *menu = menu_driver_get_ptr();
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0);
if (!menu)
return;
glui = (glui_handle_t*)menu->userdata;
if (!glui)
return;
list_size = GLUI_SYSTEM_TAB_END;
switch (type)
{
case MENU_LIST_PLAIN:
break;
case MENU_LIST_HORIZONTAL:
glui->categories.selection_ptr_old = glui->categories.selection_ptr;
switch (action)
{
case MENU_ACTION_LEFT:
if (glui->categories.selection_ptr == 0)
{
glui->categories.selection_ptr = list_size;
glui->categories.active.idx = list_size - 1;
}
else
glui->categories.selection_ptr--;
break;
default:
if (glui->categories.selection_ptr == list_size)
{
glui->categories.selection_ptr = 0;
glui->categories.active.idx = 1;
}
else
glui->categories.selection_ptr++;
break;
}
stack_size = menu_stack->size;
if (menu_stack->list[stack_size - 1].label)
free(menu_stack->list[stack_size - 1].label);
menu_stack->list[stack_size - 1].label = NULL;
switch (glui->categories.selection_ptr)
{
case GLUI_SYSTEM_TAB_MAIN:
menu_stack->list[stack_size - 1].label =
strdup(menu_hash_to_str(MENU_VALUE_MAIN_MENU));
menu_stack->list[stack_size - 1].type =
MENU_SETTINGS;
break;
case GLUI_SYSTEM_TAB_PLAYLISTS:
menu_stack->list[stack_size - 1].label =
strdup(menu_hash_to_str(MENU_VALUE_PLAYLISTS_TAB));
menu_stack->list[stack_size - 1].label =
strdup(menu_hash_to_str(MENU_VALUE_PLAYLISTS_TAB));
menu_stack->list[stack_size - 1].type =
MENU_PLAYLISTS_TAB;
break;
case GLUI_SYSTEM_TAB_SETTINGS:
menu_stack->list[stack_size - 1].label =
strdup(menu_hash_to_str(MENU_VALUE_SETTINGS_TAB));
menu_stack->list[stack_size - 1].type =
MENU_SETTINGS;
break;
}
break;
}
}
static int glui_list_push(menu_displaylist_info_t *info, unsigned type)
{
int ret = -1;
menu_handle_t *menu = menu_driver_get_ptr();
global_t *global = global_get_ptr();
switch (type)
{
case DISPLAYLIST_MAIN_MENU:
menu_entries_clear(info->list);
if (global->inited.main && (global->inited.core.type != CORE_TYPE_DUMMY))
menu_displaylist_parse_settings(menu, info,
menu_hash_to_str(MENU_LABEL_CONTENT_SETTINGS), PARSE_ACTION, false);
#if defined(HAVE_DYNAMIC) || defined(HAVE_LIBRETRO_MANAGEMENT)
menu_displaylist_parse_settings(menu, info,
menu_hash_to_str(MENU_LABEL_CORE_LIST), PARSE_ACTION, false);
#endif
menu_displaylist_parse_settings(menu, info,
menu_hash_to_str(MENU_LABEL_LOAD_CONTENT_LIST), PARSE_ACTION, false);
menu_displaylist_parse_settings(menu, info,
menu_hash_to_str(MENU_LABEL_LOAD_CONTENT_HISTORY), PARSE_ACTION, false);
#if defined(HAVE_NETWORKING)
#if defined(HAVE_LIBRETRODB)
menu_displaylist_parse_settings(menu, info,
menu_hash_to_str(MENU_LABEL_ADD_CONTENT_LIST), PARSE_ACTION, false);
#endif
menu_displaylist_parse_settings(menu, info,
menu_hash_to_str(MENU_LABEL_ONLINE_UPDATER), PARSE_ACTION, false);
#endif
menu_displaylist_parse_settings(menu, info,
menu_hash_to_str(MENU_LABEL_INFORMATION_LIST), PARSE_ACTION, false);
#ifndef HAVE_DYNAMIC
menu_displaylist_parse_settings(menu, info,
menu_hash_to_str(MENU_LABEL_RESTART_RETROARCH), PARSE_ACTION, false);
#endif
menu_displaylist_parse_settings(menu, info,
menu_hash_to_str(MENU_LABEL_CONFIGURATIONS), PARSE_ACTION, false);
menu_displaylist_parse_settings(menu, info,
menu_hash_to_str(MENU_LABEL_SAVE_NEW_CONFIG), PARSE_ACTION, false);
menu_displaylist_parse_settings(menu, info,
menu_hash_to_str(MENU_LABEL_HELP_LIST), PARSE_ACTION, false);
#if !defined(IOS)
menu_displaylist_parse_settings(menu, info,
menu_hash_to_str(MENU_LABEL_QUIT_RETROARCH), PARSE_ACTION, false);
#endif
menu_displaylist_parse_settings(menu, info,
menu_hash_to_str(MENU_LABEL_SHUTDOWN), PARSE_ACTION, false);
info->need_push = true;
ret = 0;
break;
}
return ret;
}
menu_ctx_driver_t menu_ctx_glui = { menu_ctx_driver_t menu_ctx_glui = {
NULL, NULL,
glui_get_message, glui_get_message,
@ -1050,10 +1319,10 @@ menu_ctx_driver_t menu_ctx_glui = {
NULL, NULL,
NULL, NULL,
NULL, NULL,
glui_list_cache,
glui_list_push,
NULL, NULL,
NULL, glui_list_get_size,
NULL,
NULL,
NULL, NULL,
glui_list_set_selection, glui_list_set_selection,
NULL, NULL,

View File

@ -780,6 +780,8 @@ const char *menu_hash_to_str_us(uint32_t hash)
return "History tab"; return "History tab";
case MENU_VALUE_ADD_TAB: case MENU_VALUE_ADD_TAB:
return "Add tab"; return "Add tab";
case MENU_VALUE_PLAYLISTS_TAB:
return "Playlists tab";
case MENU_LABEL_VALUE_NO_SETTINGS_FOUND: case MENU_LABEL_VALUE_NO_SETTINGS_FOUND:
return "No settings found."; return "No settings found.";
case MENU_LABEL_VALUE_NO_PERFORMANCE_COUNTERS: case MENU_LABEL_VALUE_NO_PERFORMANCE_COUNTERS:

View File

@ -104,6 +104,8 @@ typedef enum
MENU_SETTINGS_TAB, MENU_SETTINGS_TAB,
MENU_HISTORY_TAB, MENU_HISTORY_TAB,
MENU_ADD_TAB, MENU_ADD_TAB,
MENU_PLAYLISTS_TAB,
MENU_SETTING_NO_ITEM,
MENU_SETTING_DRIVER, MENU_SETTING_DRIVER,
MENU_SETTING_ACTION, MENU_SETTING_ACTION,
MENU_SETTING_ACTION_RUN, MENU_SETTING_ACTION_RUN,

View File

@ -514,6 +514,10 @@ void menu_display_draw_frame(
const shader_backend_t *shader = (const shader_backend_t*)shader_data; const shader_backend_t *shader = (const shader_backend_t*)shader_data;
driver_t *driver = driver_get_ptr(); driver_t *driver = driver_get_ptr();
/* TODO - edge case */
if (height <= 0)
height = 1;
glViewport(x, y, width, height); glViewport(x, y, width, height);
glBindTexture(GL_TEXTURE_2D, texture); glBindTexture(GL_TEXTURE_2D, texture);

View File

@ -1706,7 +1706,7 @@ static int menu_displaylist_parse_load_content_settings(menu_displaylist_info_t
else else
menu_entries_push(info->list, menu_entries_push(info->list,
menu_hash_to_str(MENU_LABEL_VALUE_NO_ITEMS), menu_hash_to_str(MENU_LABEL_VALUE_NO_ITEMS),
"", 0, 0, 0); "", MENU_SETTING_NO_ITEM, 0, 0);
return 0; return 0;
} }
@ -1929,7 +1929,7 @@ static int menu_displaylist_parse_options(menu_displaylist_info_t *info)
#else #else
menu_entries_push(info->list, menu_entries_push(info->list,
menu_hash_to_str(MENU_LABEL_VALUE_NO_ITEMS), menu_hash_to_str(MENU_LABEL_VALUE_NO_ITEMS),
"", 0, 0, 0); "", MENU_SETTING_NO_ITEM, 0, 0);
#endif #endif
return 0; return 0;
@ -2125,7 +2125,7 @@ static int menu_displaylist_parse_generic(menu_displaylist_info_t *info, bool ho
{ {
menu_entries_push(info->list, menu_entries_push(info->list,
menu_hash_to_str(MENU_LABEL_VALUE_NO_ITEMS), menu_hash_to_str(MENU_LABEL_VALUE_NO_ITEMS),
"", 0, 0, 0); "", MENU_SETTING_NO_ITEM, 0, 0);
} }
string_list_free(str_list); string_list_free(str_list);
@ -2402,7 +2402,7 @@ int menu_displaylist_push_list(menu_displaylist_info_t *info, unsigned type)
#else #else
menu_entries_push(info->list, menu_entries_push(info->list,
menu_hash_to_str(MENU_LABEL_VALUE_NO_ITEMS), menu_hash_to_str(MENU_LABEL_VALUE_NO_ITEMS),
"", 0, 0, 0); "", MENU_SETTING_NO_ITEM, 0, 0);
ret = 0; ret = 0;
#endif #endif
info->need_refresh = true; info->need_refresh = true;
@ -3027,6 +3027,7 @@ int menu_displaylist_push_list(menu_displaylist_info_t *info, unsigned type)
case DISPLAYLIST_DATABASE_PLAYLISTS_HORIZONTAL: case DISPLAYLIST_DATABASE_PLAYLISTS_HORIZONTAL:
{ {
bool horizontal = (type == DISPLAYLIST_DATABASE_PLAYLISTS_HORIZONTAL); bool horizontal = (type == DISPLAYLIST_DATABASE_PLAYLISTS_HORIZONTAL);
if (menu_displaylist_parse_generic(info, horizontal) == 0) if (menu_displaylist_parse_generic(info, horizontal) == 0)
{ {
info->need_refresh = true; info->need_refresh = true;
@ -3074,6 +3075,7 @@ int menu_displaylist_push(file_list_t *list, file_list_t *menu_list)
uint32_t hash_label = 0; uint32_t hash_label = 0;
unsigned type = 0; unsigned type = 0;
menu_displaylist_info_t info = {0}; menu_displaylist_info_t info = {0};
settings_t *settings = config_get_ptr();
menu_entries_get_last_stack(&path, &label, &type, NULL); menu_entries_get_last_stack(&path, &label, &type, NULL);
@ -3110,6 +3112,31 @@ int menu_displaylist_push(file_list_t *list, file_list_t *menu_list)
return -1; return -1;
menu_displaylist_push_list_process(&info); menu_displaylist_push_list_process(&info);
return 0; return 0;
case MENU_VALUE_PLAYLISTS_TAB:
info.type = 42;
strlcpy(info.exts, "lpl", sizeof(info.exts));
strlcpy(info.label, menu_hash_to_str(MENU_LABEL_CONTENT_COLLECTION_LIST),
sizeof(info.label));
if (settings->playlist_directory[0] != '\0')
{
strlcpy(info.path, settings->playlist_directory,
sizeof(info.path));
if (menu_displaylist_push_list(&info, DISPLAYLIST_DATABASE_PLAYLISTS_HORIZONTAL) != 0)
return -1;
}
else
{
menu_entries_clear(info.list);
menu_entries_push(info.list,
menu_hash_to_str(MENU_LABEL_VALUE_NO_PLAYLIST_ENTRIES_AVAILABLE),
menu_hash_to_str(MENU_LABEL_NO_PLAYLIST_ENTRIES_AVAILABLE),
MENU_INFO_MESSAGE, 0, 0);
info.need_refresh = true;
info.need_push = true;
}
menu_displaylist_push_list_process(&info);
return 0;
case MENU_VALUE_HORIZONTAL_MENU: case MENU_VALUE_HORIZONTAL_MENU:
if (menu_displaylist_push_list(&info, DISPLAYLIST_HORIZONTAL) != 0) if (menu_displaylist_push_list(&info, DISPLAYLIST_HORIZONTAL) != 0)
return -1; return -1;

View File

@ -572,6 +572,7 @@ extern "C" {
#define MENU_VALUE_SETTINGS_TAB 0x6548d16dU #define MENU_VALUE_SETTINGS_TAB 0x6548d16dU
#define MENU_VALUE_HISTORY_TAB 0xea9b0ceeU #define MENU_VALUE_HISTORY_TAB 0xea9b0ceeU
#define MENU_VALUE_ADD_TAB 0x7fb20225U #define MENU_VALUE_ADD_TAB 0x7fb20225U
#define MENU_VALUE_PLAYLISTS_TAB 0x092d3161U
#define MENU_VALUE_MAIN_MENU 0x1625971fU #define MENU_VALUE_MAIN_MENU 0x1625971fU
#define MENU_LABEL_VALUE_SETTINGS 0x8aca3ff6U #define MENU_LABEL_VALUE_SETTINGS 0x8aca3ff6U
#define MENU_VALUE_INPUT_SETTINGS 0xddd30846U #define MENU_VALUE_INPUT_SETTINGS 0xddd30846U

View File

@ -482,7 +482,6 @@ rarch_setting_t *menu_setting_find(const char *label)
int menu_setting_set_flags(rarch_setting_t *setting) int menu_setting_set_flags(rarch_setting_t *setting)
{ {
uint64_t flags = menu_setting_get_flags(setting);
if (!setting) if (!setting)
return 0; return 0;

View File

@ -0,0 +1,85 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := retroarch-jni
RARCH_DIR := ../../../..
LOCAL_CFLAGS += -std=gnu99 -Wall -DRARCH_DUMMY_LOG -DHAVE_ZLIB -DHAVE_MMAP -DRARCH_INTERNAL
LOCAL_LDLIBS := -llog -lz
LOCAL_SRC_FILES := apk-extract/apk-extract.c \
$(RARCH_DIR)/libretro-common/file/file_extract.c \
$(RARCH_DIR)/libretro-common/file/file_path.c \
$(RARCH_DIR)/file_ops.c \
$(RARCH_DIR)/libretro-common/string/string_list.c \
$(RARCH_DIR)/libretro-common/compat/compat_strl.c \
$(RARCH_DIR)/libretro-common/file/retro_file.c \
$(RARCH_DIR)/libretro-common/file/retro_stat.c
LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(RARCH_DIR)/libretro-common/include/
include $(BUILD_SHARED_LIBRARY)
HAVE_NEON := 1
HAVE_LOGGER := 0
include $(CLEAR_VARS)
ifeq ($(TARGET_ARCH),arm)
LOCAL_CFLAGS += -DANDROID_ARM -marm
LOCAL_ARM_MODE := arm
endif
ifeq ($(TARGET_ARCH),x86)
LOCAL_CFLAGS += -DANDROID_X86 -DHAVE_SSSE3
endif
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
ifeq ($(HAVE_NEON),1)
LOCAL_CFLAGS += -D__ARM_NEON__
LOCAL_SRC_FILES += $(RARCH_DIR)/audio/audio_utils_neon.S.neon
LOCAL_SRC_FILES += $(RARCH_DIR)/audio/drivers_resampler/sinc_neon.S.neon
LOCAL_SRC_FILES += $(RARCH_DIR)/audio/drivers_resampler/cc_resampler_neon.S.neon
endif
LOCAL_CFLAGS += -DSINC_LOWER_QUALITY
LOCAL_CFLAGS += -DANDROID_ARM_V7
endif
ifeq ($(TARGET_ARCH),mips)
LOCAL_CFLAGS += -DANDROID_MIPS -D__mips__ -D__MIPSEL__
endif
LOCAL_MODULE := retroarch-activity
LOCAL_SRC_FILES += $(RARCH_DIR)/griffin/griffin.c
ifeq ($(HAVE_LOGGER), 1)
LOCAL_CFLAGS += -DHAVE_LOGGER
endif
LOGGER_LDLIBS := -llog
ifeq ($(GLES),3)
GLES_LIB := -lGLESv3
LOCAL_CFLAGS += -DHAVE_OPENGLES3
else
GLES_LIB := -lGLESv2
endif
LOCAL_CFLAGS += -Wall -pthread -Wno-unused-function -fno-stack-protector -funroll-loops -DRARCH_MOBILE -DHAVE_GRIFFIN -DANDROID -DHAVE_DYNAMIC -DHAVE_OPENGL -DHAVE_FBO -DHAVE_OVERLAY -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DGLSL_DEBUG -DHAVE_DYLIB -DHAVE_GLSL -DHAVE_MENU -DHAVE_RGUI -DHAVE_ZLIB -DHAVE_RPNG -DINLINE=inline -DHAVE_THREADS -D__LIBRETRO__ -DHAVE_RSOUND -DHAVE_NETPLAY -DHAVE_NETWORKING -DRARCH_INTERNAL -DHAVE_FILTERS_BUILTIN -DHAVE_GLUI -DHAVE_XMB -std=gnu99 -DHAVE_LIBRETRODB -DHAVE_STB_FONT
LOCAL_CFLAGS += -DHAVE_7ZIP
LOCAL_CFLAGS += -DDEBUG_ANDROID
ifeq ($(NDK_DEBUG),1)
LOCAL_CFLAGS += -O0 -g
else
LOCAL_CFLAGS += -O2 -DNDEBUG
endif
LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -landroid -lEGL $(GLES_LIB) $(LOGGER_LDLIBS) -ldl
LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(RARCH_DIR)/libretro-common/include/
LOCAL_CFLAGS += -DHAVE_SL
LOCAL_LDLIBS += -lOpenSLES -lz
include $(BUILD_SHARED_LIBRARY)