mirror of
https://github.com/libretro/RetroArch
synced 2025-04-18 14:42:30 +00:00
(Menu) Cleanups pt. 4
This commit is contained in:
parent
d532fb4979
commit
5789fb44f4
@ -76,8 +76,9 @@ static int deferred_push_database_manager_list_deferred(menu_displaylist_info_t
|
|||||||
|
|
||||||
static int deferred_push_cursor_manager_list_deferred(menu_displaylist_info_t *info)
|
static int deferred_push_cursor_manager_list_deferred(menu_displaylist_info_t *info)
|
||||||
{
|
{
|
||||||
char *query = NULL, *rdb = NULL;
|
char *query = NULL;
|
||||||
char rdb_path[PATH_MAX_LENGTH];
|
char *rdb = NULL;
|
||||||
|
char rdb_path[PATH_MAX_LENGTH] = {0};
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
config_file_t *conf = config_file_new(info->path);
|
config_file_t *conf = config_file_new(info->path);
|
||||||
|
|
||||||
@ -113,7 +114,7 @@ static int deferred_push_cursor_manager_list_deferred_query_subsearch(menu_displ
|
|||||||
{
|
{
|
||||||
#ifdef HAVE_LIBRETRODB
|
#ifdef HAVE_LIBRETRODB
|
||||||
int ret;
|
int ret;
|
||||||
char query[PATH_MAX_LENGTH];
|
char query[PATH_MAX_LENGTH] = {0};
|
||||||
struct string_list *str_list = string_split(info->path, "|");
|
struct string_list *str_list = string_split(info->path, "|");
|
||||||
|
|
||||||
database_info_build_query(query, sizeof(query), info->label, str_list->elems[0].data);
|
database_info_build_query(query, sizeof(query), info->label, str_list->elems[0].data);
|
||||||
|
@ -32,7 +32,7 @@ extern char detect_content_path[PATH_MAX_LENGTH];
|
|||||||
|
|
||||||
static int archive_open(void)
|
static int archive_open(void)
|
||||||
{
|
{
|
||||||
char cat_path[PATH_MAX_LENGTH];
|
char cat_path[PATH_MAX_LENGTH] = {0};
|
||||||
menu_displaylist_info_t info = {0};
|
menu_displaylist_info_t info = {0};
|
||||||
const char *menu_path = NULL;
|
const char *menu_path = NULL;
|
||||||
const char *menu_label = NULL;
|
const char *menu_label = NULL;
|
||||||
@ -165,7 +165,7 @@ static int action_iterate_help(char *s, size_t len, const char *label)
|
|||||||
RETRO_DEVICE_ID_JOYPAD_X,
|
RETRO_DEVICE_ID_JOYPAD_X,
|
||||||
RETRO_DEVICE_ID_JOYPAD_Y,
|
RETRO_DEVICE_ID_JOYPAD_Y,
|
||||||
};
|
};
|
||||||
char desc[ARRAY_SIZE(binds)][64];
|
char desc[ARRAY_SIZE(binds)][64] = {0};
|
||||||
menu_handle_t *menu = menu_driver_get_ptr();
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
@ -216,7 +216,7 @@ static int action_iterate_help(char *s, size_t len, const char *label)
|
|||||||
static int action_iterate_info(char *s, size_t len, const char *label)
|
static int action_iterate_info(char *s, size_t len, const char *label)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
char needle[PATH_MAX_LENGTH];
|
char needle[PATH_MAX_LENGTH] = {0};
|
||||||
unsigned info_type = 0;
|
unsigned info_type = 0;
|
||||||
rarch_setting_t *current_setting = NULL;
|
rarch_setting_t *current_setting = NULL;
|
||||||
file_list_t *list = NULL;
|
file_list_t *list = NULL;
|
||||||
@ -492,10 +492,10 @@ static enum action_iterate_type action_iterate_type(uint32_t hash)
|
|||||||
|
|
||||||
static int action_iterate_main(const char *label, unsigned action)
|
static int action_iterate_main(const char *label, unsigned action)
|
||||||
{
|
{
|
||||||
static bool did_messagebox = false;
|
|
||||||
char msg[PATH_MAX_LENGTH];
|
|
||||||
enum action_iterate_type iterate_type;
|
|
||||||
menu_entry_t entry;
|
menu_entry_t entry;
|
||||||
|
static bool did_messagebox = false;
|
||||||
|
char msg[PATH_MAX_LENGTH] = {0};
|
||||||
|
enum action_iterate_type iterate_type;
|
||||||
size_t selected, *pop_selected = false;
|
size_t selected, *pop_selected = false;
|
||||||
bool do_messagebox = false;
|
bool do_messagebox = false;
|
||||||
bool do_pop_stack = false;
|
bool do_pop_stack = false;
|
||||||
|
@ -360,7 +360,7 @@ static int menu_cbs_init_bind_left_compare_label(menu_file_list_cbs_t *cbs,
|
|||||||
|
|
||||||
for (i = 0; i < MAX_USERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
{
|
{
|
||||||
char label_setting[PATH_MAX_LENGTH];
|
char label_setting[PATH_MAX_LENGTH] = {0};
|
||||||
snprintf(label_setting, sizeof(label_setting), "input_player%d_joypad_index", i + 1);
|
snprintf(label_setting, sizeof(label_setting), "input_player%d_joypad_index", i + 1);
|
||||||
|
|
||||||
if (!strcmp(label, label_setting))
|
if (!strcmp(label, label_setting))
|
||||||
|
@ -38,7 +38,7 @@ char core_updater_path[PATH_MAX_LENGTH];
|
|||||||
static int menu_action_setting_set_current_string_path(
|
static int menu_action_setting_set_current_string_path(
|
||||||
rarch_setting_t *setting, const char *dir, const char *path)
|
rarch_setting_t *setting, const char *dir, const char *path)
|
||||||
{
|
{
|
||||||
char s[PATH_MAX_LENGTH];
|
char s[PATH_MAX_LENGTH] = {0};
|
||||||
fill_pathname_join(s, dir, path, sizeof(s));
|
fill_pathname_join(s, dir, path, sizeof(s));
|
||||||
setting_set_with_string_representation(setting, s);
|
setting_set_with_string_representation(setting, s);
|
||||||
return menu_setting_generic(setting, false);
|
return menu_setting_generic(setting, false);
|
||||||
@ -467,7 +467,7 @@ static int action_ok_video_filter(const char *path,
|
|||||||
static int action_ok_core_updater_list(const char *path,
|
static int action_ok_core_updater_list(const char *path,
|
||||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||||
{
|
{
|
||||||
char url_path[PATH_MAX_LENGTH];
|
char url_path[PATH_MAX_LENGTH] = {0};
|
||||||
menu_displaylist_info_t info = {0};
|
menu_displaylist_info_t info = {0};
|
||||||
driver_t *driver = driver_get_ptr();
|
driver_t *driver = driver_get_ptr();
|
||||||
menu_handle_t *menu = menu_driver_get_ptr();
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
@ -616,7 +616,7 @@ static int action_ok_remap_file_load(const char *path,
|
|||||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||||
{
|
{
|
||||||
const char *menu_path = NULL;
|
const char *menu_path = NULL;
|
||||||
char remap_path[PATH_MAX_LENGTH];
|
char remap_path[PATH_MAX_LENGTH] = {0};
|
||||||
menu_handle_t *menu = menu_driver_get_ptr();
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
if (!menu)
|
if (!menu)
|
||||||
return -1;
|
return -1;
|
||||||
@ -638,8 +638,8 @@ static int action_ok_remap_file_load(const char *path,
|
|||||||
static int action_ok_video_filter_file_load(const char *path,
|
static int action_ok_video_filter_file_load(const char *path,
|
||||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||||
{
|
{
|
||||||
char filter_path[PATH_MAX_LENGTH];
|
|
||||||
const char *menu_path = NULL;
|
const char *menu_path = NULL;
|
||||||
|
char filter_path[PATH_MAX_LENGTH] = {0};
|
||||||
menu_handle_t *menu = menu_driver_get_ptr();
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
@ -668,7 +668,7 @@ static int action_ok_cheat_file_load(const char *path,
|
|||||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||||
{
|
{
|
||||||
const char *menu_path = NULL;
|
const char *menu_path = NULL;
|
||||||
char cheat_path[PATH_MAX_LENGTH];
|
char cheat_path[PATH_MAX_LENGTH] = {0};
|
||||||
menu_handle_t *menu = menu_driver_get_ptr();
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
global_t *global = global_get_ptr();
|
global_t *global = global_get_ptr();
|
||||||
if (!menu)
|
if (!menu)
|
||||||
@ -697,7 +697,7 @@ static int action_ok_cheat_file_load(const char *path,
|
|||||||
static int action_ok_menu_wallpaper_load(const char *path,
|
static int action_ok_menu_wallpaper_load(const char *path,
|
||||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||||
{
|
{
|
||||||
char wallpaper_path[PATH_MAX_LENGTH];
|
char wallpaper_path[PATH_MAX_LENGTH] = {0};
|
||||||
const char *menu_label = NULL;
|
const char *menu_label = NULL;
|
||||||
const char *menu_path = NULL;
|
const char *menu_path = NULL;
|
||||||
rarch_setting_t *setting = NULL;
|
rarch_setting_t *setting = NULL;
|
||||||
@ -733,7 +733,7 @@ static int action_ok_shader_preset_load(const char *path,
|
|||||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||||
{
|
{
|
||||||
const char *menu_path = NULL;
|
const char *menu_path = NULL;
|
||||||
char shader_path[PATH_MAX_LENGTH];
|
char shader_path[PATH_MAX_LENGTH] = {0};
|
||||||
menu_handle_t *menu = menu_driver_get_ptr();
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
if (!menu)
|
if (!menu)
|
||||||
return -1;
|
return -1;
|
||||||
@ -790,15 +790,14 @@ static int action_ok_remap_file_save_as(const char *path,
|
|||||||
static int action_ok_remap_file_save_core(const char *path,
|
static int action_ok_remap_file_save_core(const char *path,
|
||||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||||
{
|
{
|
||||||
|
char directory[PATH_MAX_LENGTH] = {0};
|
||||||
|
char file[PATH_MAX_LENGTH] = {0};
|
||||||
|
const char *core_name = NULL;
|
||||||
global_t *global = global_get_ptr();
|
global_t *global = global_get_ptr();
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
const char *core_name;
|
|
||||||
core_name = global->system.info.library_name;
|
core_name = global->system.info.library_name;
|
||||||
|
|
||||||
char directory[PATH_MAX_LENGTH];
|
|
||||||
char file[PATH_MAX_LENGTH];
|
|
||||||
|
|
||||||
fill_pathname_join(directory,settings->input_remapping_directory,core_name,PATH_MAX_LENGTH);
|
fill_pathname_join(directory,settings->input_remapping_directory,core_name,PATH_MAX_LENGTH);
|
||||||
fill_pathname_join(file,core_name,core_name,PATH_MAX_LENGTH);
|
fill_pathname_join(file,core_name,core_name,PATH_MAX_LENGTH);
|
||||||
|
|
||||||
@ -816,18 +815,16 @@ static int action_ok_remap_file_save_core(const char *path,
|
|||||||
static int action_ok_remap_file_save_game(const char *path,
|
static int action_ok_remap_file_save_game(const char *path,
|
||||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||||
{
|
{
|
||||||
|
const char *core_name = NULL;
|
||||||
|
const char *game_name = NULL;
|
||||||
|
char directory[PATH_MAX_LENGTH] = {0};
|
||||||
|
char file[PATH_MAX_LENGTH] = {0};
|
||||||
global_t *global = global_get_ptr();
|
global_t *global = global_get_ptr();
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
const char *core_name;
|
|
||||||
core_name = global->system.info.library_name;
|
core_name = global->system.info.library_name;
|
||||||
|
|
||||||
const char *game_name;
|
|
||||||
game_name = path_basename(global->basename);
|
game_name = path_basename(global->basename);
|
||||||
|
|
||||||
char directory[PATH_MAX_LENGTH];
|
|
||||||
char file[PATH_MAX_LENGTH];
|
|
||||||
|
|
||||||
fill_pathname_join(directory,settings->input_remapping_directory,core_name,PATH_MAX_LENGTH);
|
fill_pathname_join(directory,settings->input_remapping_directory,core_name,PATH_MAX_LENGTH);
|
||||||
fill_pathname_join(file,core_name,game_name,PATH_MAX_LENGTH);
|
fill_pathname_join(file,core_name,game_name,PATH_MAX_LENGTH);
|
||||||
|
|
||||||
@ -851,7 +848,7 @@ static int action_ok_path_use_directory(const char *path,
|
|||||||
static int action_ok_core_deferred_set(const char *path,
|
static int action_ok_core_deferred_set(const char *path,
|
||||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||||
{
|
{
|
||||||
char core_display_name[PATH_MAX_LENGTH];
|
char core_display_name[PATH_MAX_LENGTH] = {0};
|
||||||
menu_handle_t *menu = menu_driver_get_ptr();
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
if (!menu)
|
if (!menu)
|
||||||
return -1;
|
return -1;
|
||||||
@ -904,7 +901,7 @@ static int action_ok_database_manager_list_deferred(const char *path,
|
|||||||
static int action_ok_rdb_entry(const char *path,
|
static int action_ok_rdb_entry(const char *path,
|
||||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||||
{
|
{
|
||||||
char tmp[PATH_MAX_LENGTH];
|
char tmp[PATH_MAX_LENGTH] = {0};
|
||||||
menu_displaylist_info_t info = {0};
|
menu_displaylist_info_t info = {0};
|
||||||
menu_handle_t *menu = menu_driver_get_ptr();
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
if (!menu)
|
if (!menu)
|
||||||
@ -996,7 +993,7 @@ static int action_ok_directory_push(const char *path,
|
|||||||
menu_displaylist_info_t info = {0};
|
menu_displaylist_info_t info = {0};
|
||||||
const char *menu_path = NULL;
|
const char *menu_path = NULL;
|
||||||
const char *menu_label = NULL;
|
const char *menu_label = NULL;
|
||||||
char cat_path[PATH_MAX_LENGTH];
|
char cat_path[PATH_MAX_LENGTH] = {0};
|
||||||
menu_handle_t *menu = menu_driver_get_ptr();
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
if (!menu)
|
if (!menu)
|
||||||
return -1;
|
return -1;
|
||||||
@ -1021,7 +1018,7 @@ static int action_ok_directory_push(const char *path,
|
|||||||
static int action_ok_database_manager_list(const char *path,
|
static int action_ok_database_manager_list(const char *path,
|
||||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||||
{
|
{
|
||||||
char rdb_path[PATH_MAX_LENGTH];
|
char rdb_path[PATH_MAX_LENGTH] = {0};
|
||||||
menu_displaylist_info_t info = {0};
|
menu_displaylist_info_t info = {0};
|
||||||
menu_handle_t *menu = menu_driver_get_ptr();
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
@ -1048,7 +1045,7 @@ static int action_ok_database_manager_list(const char *path,
|
|||||||
static int action_ok_cursor_manager_list(const char *path,
|
static int action_ok_cursor_manager_list(const char *path,
|
||||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||||
{
|
{
|
||||||
char cursor_path[PATH_MAX_LENGTH];
|
char cursor_path[PATH_MAX_LENGTH] = {0};
|
||||||
menu_displaylist_info_t info = {0};
|
menu_displaylist_info_t info = {0};
|
||||||
menu_handle_t *menu = menu_driver_get_ptr();
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
@ -1072,7 +1069,7 @@ static int action_ok_config_load(const char *path,
|
|||||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||||
{
|
{
|
||||||
const char *menu_path = NULL;
|
const char *menu_path = NULL;
|
||||||
char config[PATH_MAX_LENGTH];
|
char config[PATH_MAX_LENGTH] = {0};
|
||||||
menu_handle_t *menu = menu_driver_get_ptr();
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
|
||||||
if (!menu)
|
if (!menu)
|
||||||
@ -1096,7 +1093,7 @@ static int action_ok_config_load(const char *path,
|
|||||||
static int action_ok_disk_image_append(const char *path,
|
static int action_ok_disk_image_append(const char *path,
|
||||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||||
{
|
{
|
||||||
char image[PATH_MAX_LENGTH];
|
char image[PATH_MAX_LENGTH] = {0};
|
||||||
const char *menu_path = NULL;
|
const char *menu_path = NULL;
|
||||||
menu_handle_t *menu = menu_driver_get_ptr();
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
|
||||||
@ -1239,7 +1236,8 @@ static int action_ok_core_updater_download(const char *path,
|
|||||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_NETWORKING
|
#ifdef HAVE_NETWORKING
|
||||||
char core_path[PATH_MAX_LENGTH], msg[PATH_MAX_LENGTH];
|
char core_path[PATH_MAX_LENGTH] = {0};
|
||||||
|
char msg[PATH_MAX_LENGTH] = {0};
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
fill_pathname_join(core_path, settings->network.buildbot_url,
|
fill_pathname_join(core_path, settings->network.buildbot_url,
|
||||||
@ -1336,7 +1334,7 @@ static int action_ok_rdb_entry_submenu(const char *path,
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
union string_list_elem_attr attr;
|
union string_list_elem_attr attr;
|
||||||
char new_label[PATH_MAX_LENGTH];
|
char new_label[PATH_MAX_LENGTH] = {0};
|
||||||
menu_displaylist_info_t info = {0};
|
menu_displaylist_info_t info = {0};
|
||||||
char *rdb = NULL;
|
char *rdb = NULL;
|
||||||
int len = 0;
|
int len = 0;
|
||||||
|
@ -432,7 +432,7 @@ static int menu_cbs_init_bind_right_compare_label(menu_file_list_cbs_t *cbs,
|
|||||||
|
|
||||||
for (i = 0; i < MAX_USERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
{
|
{
|
||||||
char label_setting[PATH_MAX_LENGTH];
|
char label_setting[PATH_MAX_LENGTH] = {0};
|
||||||
snprintf(label_setting, sizeof(label_setting), "input_player%d_joypad_index", i + 1);
|
snprintf(label_setting, sizeof(label_setting), "input_player%d_joypad_index", i + 1);
|
||||||
|
|
||||||
if (!strcmp(label, label_setting))
|
if (!strcmp(label, label_setting))
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
static int action_scan_file(const char *path,
|
static int action_scan_file(const char *path,
|
||||||
const char *label, unsigned type, size_t idx)
|
const char *label, unsigned type, size_t idx)
|
||||||
{
|
{
|
||||||
char fullpath[PATH_MAX_LENGTH];
|
char fullpath[PATH_MAX_LENGTH] = {0};
|
||||||
const char *menu_label = NULL;
|
const char *menu_label = NULL;
|
||||||
const char *menu_path = NULL;
|
const char *menu_path = NULL;
|
||||||
menu_handle_t *menu = menu_driver_get_ptr();
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
@ -42,7 +42,7 @@ static int action_scan_file(const char *path,
|
|||||||
static int action_scan_directory(const char *path,
|
static int action_scan_directory(const char *path,
|
||||||
const char *label, unsigned type, size_t idx)
|
const char *label, unsigned type, size_t idx)
|
||||||
{
|
{
|
||||||
char fullpath[PATH_MAX_LENGTH];
|
char fullpath[PATH_MAX_LENGTH] = {0};
|
||||||
const char *menu_label = NULL;
|
const char *menu_label = NULL;
|
||||||
const char *menu_path = NULL;
|
const char *menu_path = NULL;
|
||||||
menu_handle_t *menu = menu_driver_get_ptr();
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
@ -23,8 +23,8 @@
|
|||||||
static int action_select_default(const char *path, const char *label, unsigned type,
|
static int action_select_default(const char *path, const char *label, unsigned type,
|
||||||
size_t idx)
|
size_t idx)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
|
||||||
menu_entry_t entry;
|
menu_entry_t entry;
|
||||||
|
int ret = 0;
|
||||||
enum menu_action action = MENU_ACTION_NOOP;
|
enum menu_action action = MENU_ACTION_NOOP;
|
||||||
menu_file_list_cbs_t *cbs = NULL;
|
menu_file_list_cbs_t *cbs = NULL;
|
||||||
menu_list_t *menu_list = menu_list_get_ptr();
|
menu_list_t *menu_list = menu_list_get_ptr();
|
||||||
|
@ -27,6 +27,9 @@ static int action_start_remap_file_load(unsigned type, const char *label)
|
|||||||
{
|
{
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
|
if (!settings)
|
||||||
|
return -1;
|
||||||
|
|
||||||
settings->input.remapping_path[0] = '\0';
|
settings->input.remapping_path[0] = '\0';
|
||||||
input_remapping_set_defaults();
|
input_remapping_set_defaults();
|
||||||
return 0;
|
return 0;
|
||||||
@ -36,6 +39,9 @@ static int action_start_video_filter_file_load(unsigned type, const char *label)
|
|||||||
{
|
{
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
|
if (!settings)
|
||||||
|
return -1;
|
||||||
|
|
||||||
settings->video.softfilter_plugin[0] = '\0';
|
settings->video.softfilter_plugin[0] = '\0';
|
||||||
event_command(EVENT_CMD_REINIT);
|
event_command(EVENT_CMD_REINIT);
|
||||||
return 0;
|
return 0;
|
||||||
@ -259,9 +265,7 @@ static int action_start_core_setting(unsigned type,
|
|||||||
|
|
||||||
static int action_start_lookup_setting(unsigned type, const char *label)
|
static int action_start_lookup_setting(unsigned type, const char *label)
|
||||||
{
|
{
|
||||||
int ret = menu_setting_set(type, label, MENU_ACTION_START, false);
|
return menu_setting_set(type, label, MENU_ACTION_START, false);
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int menu_cbs_init_bind_start_compare_label(menu_file_list_cbs_t *cbs,
|
int menu_cbs_init_bind_start_compare_label(menu_file_list_cbs_t *cbs,
|
||||||
|
@ -21,14 +21,15 @@
|
|||||||
|
|
||||||
static INLINE void replace_chars(char *str, char c1, char c2)
|
static INLINE void replace_chars(char *str, char c1, char c2)
|
||||||
{
|
{
|
||||||
char *pos;
|
char *pos = NULL;
|
||||||
while((pos = strchr(str, c1)))
|
while((pos = strchr(str, c1)))
|
||||||
*pos = c2;
|
*pos = c2;
|
||||||
}
|
}
|
||||||
|
|
||||||
static INLINE void sanitize_to_string(char *s, const char *label, size_t len)
|
static INLINE void sanitize_to_string(char *s, const char *label, size_t len)
|
||||||
{
|
{
|
||||||
char new_label[PATH_MAX_LENGTH];
|
char new_label[PATH_MAX_LENGTH] = {0};
|
||||||
|
|
||||||
strlcpy(new_label, label, sizeof(new_label));
|
strlcpy(new_label, label, sizeof(new_label));
|
||||||
strlcpy(s, string_to_upper(new_label), len);
|
strlcpy(s, string_to_upper(new_label), len);
|
||||||
replace_chars(s, '_', ' ');
|
replace_chars(s, '_', ' ');
|
||||||
@ -135,11 +136,10 @@ static int action_get_title_video_shader_preset(const char *path, const char *la
|
|||||||
static int action_get_title_generic(char *s, size_t len, const char *path,
|
static int action_get_title_generic(char *s, size_t len, const char *path,
|
||||||
const char *text)
|
const char *text)
|
||||||
{
|
{
|
||||||
char elem0_path[PATH_MAX_LENGTH], elem1_path[PATH_MAX_LENGTH];
|
char elem0_path[PATH_MAX_LENGTH] = {0};
|
||||||
|
char elem1_path[PATH_MAX_LENGTH] = {0};
|
||||||
struct string_list *list_path = string_split(path, "|");
|
struct string_list *list_path = string_split(path, "|");
|
||||||
|
|
||||||
*elem0_path = *elem1_path = 0;
|
|
||||||
|
|
||||||
if (list_path)
|
if (list_path)
|
||||||
{
|
{
|
||||||
if (list_path->size > 0)
|
if (list_path->size > 0)
|
||||||
@ -150,6 +150,7 @@ static int action_get_title_generic(char *s, size_t len, const char *path,
|
|||||||
}
|
}
|
||||||
string_list_free(list_path);
|
string_list_free(list_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf(s, len, "%s - %s", text,
|
snprintf(s, len, "%s - %s", text,
|
||||||
(elem0_path[0] != '\0') ? path_basename(elem0_path) : "");
|
(elem0_path[0] != '\0') ? path_basename(elem0_path) : "");
|
||||||
|
|
||||||
@ -293,7 +294,8 @@ static int action_get_title_default(const char *path, const char *label,
|
|||||||
static int action_get_title_group_settings(const char *path, const char *label,
|
static int action_get_title_group_settings(const char *path, const char *label,
|
||||||
unsigned menu_type, char *s, size_t len)
|
unsigned menu_type, char *s, size_t len)
|
||||||
{
|
{
|
||||||
char elem0[PATH_MAX_LENGTH], elem1[PATH_MAX_LENGTH];
|
char elem0[PATH_MAX_LENGTH] = {0};
|
||||||
|
char elem1[PATH_MAX_LENGTH] = {0};
|
||||||
struct string_list *list_label = string_split(label, "|");
|
struct string_list *list_label = string_split(label, "|");
|
||||||
|
|
||||||
if (list_label)
|
if (list_label)
|
||||||
@ -308,11 +310,13 @@ static int action_get_title_group_settings(const char *path, const char *label,
|
|||||||
}
|
}
|
||||||
|
|
||||||
strlcpy(s, string_to_upper(elem0), len);
|
strlcpy(s, string_to_upper(elem0), len);
|
||||||
|
|
||||||
if (elem1[0] != '\0')
|
if (elem1[0] != '\0')
|
||||||
{
|
{
|
||||||
strlcat(s, " - ", len);
|
strlcat(s, " - ", len);
|
||||||
strlcat(s, string_to_upper(elem1), len);
|
strlcat(s, string_to_upper(elem1), len);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -203,23 +203,23 @@ void menu_display_free_main_font(menu_handle_t *menu)
|
|||||||
bool menu_display_init_main_font(menu_handle_t *menu,
|
bool menu_display_init_main_font(menu_handle_t *menu,
|
||||||
const char *font_path, float font_size)
|
const char *font_path, float font_size)
|
||||||
{
|
{
|
||||||
|
bool ret;
|
||||||
driver_t *driver = driver_get_ptr();
|
driver_t *driver = driver_get_ptr();
|
||||||
void *video = video_driver_get_ptr(NULL);
|
void *video = video_driver_get_ptr(NULL);
|
||||||
bool result;
|
|
||||||
|
|
||||||
if (menu->font.buf)
|
if (menu->font.buf)
|
||||||
menu_display_free_main_font(menu);
|
menu_display_free_main_font(menu);
|
||||||
|
|
||||||
result = menu_display_font_init_first(
|
ret = menu_display_font_init_first(
|
||||||
(const void**)&driver->font_osd_driver, &menu->font.buf, video,
|
(const void**)&driver->font_osd_driver, &menu->font.buf, video,
|
||||||
font_path, font_size);
|
font_path, font_size);
|
||||||
|
|
||||||
if (result)
|
if (ret)
|
||||||
menu->font.size = font_size;
|
menu->font.size = font_size;
|
||||||
else
|
else
|
||||||
menu->font.buf = NULL;
|
menu->font.buf = NULL;
|
||||||
|
|
||||||
return result;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void menu_display_set_viewport(void)
|
void menu_display_set_viewport(void)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user