mirror of
https://github.com/libretro/RetroArch.git
synced 2025-02-25 20:32:22 +00:00
Cleanups
This commit is contained in:
parent
b3d3e5dd06
commit
068529929b
@ -393,6 +393,7 @@ static int playlist_association_left(unsigned type, const char *label,
|
||||
char core_path[PATH_MAX_LENGTH];
|
||||
size_t i, next, current = 0;
|
||||
settings_t *settings = config_get_ptr();
|
||||
bool playlist_use_old_format = settings->bools.playlist_use_old_format;
|
||||
playlist_t *playlist = playlist_get_cached();
|
||||
core_info_list_t *core_info_list = NULL;
|
||||
core_info_t *core_info = NULL;
|
||||
@ -451,7 +452,7 @@ static int playlist_association_left(unsigned type, const char *label,
|
||||
/* Update playlist */
|
||||
playlist_set_default_core_path(playlist, core_info->path);
|
||||
playlist_set_default_core_name(playlist, core_info->display_name);
|
||||
playlist_write_file(playlist, settings->bools.playlist_use_old_format);
|
||||
playlist_write_file(playlist, playlist_use_old_format);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -461,6 +462,7 @@ static int playlist_label_display_mode_left(unsigned type, const char *label,
|
||||
{
|
||||
enum playlist_label_display_mode label_display_mode;
|
||||
settings_t *settings = config_get_ptr();
|
||||
bool playlist_use_old_format = settings->bools.playlist_use_old_format;
|
||||
playlist_t *playlist = playlist_get_cached();
|
||||
|
||||
if (!playlist)
|
||||
@ -474,7 +476,7 @@ static int playlist_label_display_mode_left(unsigned type, const char *label,
|
||||
label_display_mode = LABEL_DISPLAY_MODE_KEEP_REGION_AND_DISC_INDEX;
|
||||
|
||||
playlist_set_label_display_mode(playlist, label_display_mode);
|
||||
playlist_write_file(playlist, settings->bools.playlist_use_old_format);
|
||||
playlist_write_file(playlist, playlist_use_old_format);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -483,6 +485,7 @@ static void playlist_thumbnail_mode_left(playlist_t *playlist, enum playlist_thu
|
||||
bool wraparound)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
bool playlist_use_old_format = settings->bools.playlist_use_old_format;
|
||||
enum playlist_thumbnail_mode thumbnail_mode =
|
||||
playlist_get_thumbnail_mode(playlist, thumbnail_id);
|
||||
|
||||
@ -492,7 +495,7 @@ static void playlist_thumbnail_mode_left(playlist_t *playlist, enum playlist_thu
|
||||
thumbnail_mode = PLAYLIST_THUMBNAIL_MODE_BOXARTS;
|
||||
|
||||
playlist_set_thumbnail_mode(playlist, thumbnail_id, thumbnail_mode);
|
||||
playlist_write_file(playlist, settings->bools.playlist_use_old_format);
|
||||
playlist_write_file(playlist, playlist_use_old_format);
|
||||
}
|
||||
|
||||
static int playlist_right_thumbnail_mode_left(unsigned type, const char *label,
|
||||
@ -521,16 +524,19 @@ static int playlist_left_thumbnail_mode_left(unsigned type, const char *label,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int manual_content_scan_system_name_left(unsigned type, const char *label,
|
||||
static int manual_content_scan_system_name_left(
|
||||
unsigned type, const char *label,
|
||||
bool wraparound)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
settings_t *settings = config_get_ptr();
|
||||
bool show_hidden_files = settings->bools.show_hidden_files;
|
||||
#ifdef HAVE_LIBRETRODB
|
||||
const char *path_content_database = settings->paths.path_content_database;
|
||||
struct string_list *system_name_list =
|
||||
manual_content_scan_get_menu_system_name_list(settings->paths.path_content_database, settings->bools.show_hidden_files);
|
||||
manual_content_scan_get_menu_system_name_list(path_content_database, show_hidden_files);
|
||||
#else
|
||||
struct string_list *system_name_list =
|
||||
manual_content_scan_get_menu_system_name_list(NULL, settings->bools.show_hidden_files);
|
||||
manual_content_scan_get_menu_system_name_list(NULL, show_hidden_files);
|
||||
#endif
|
||||
const char *current_system_name = NULL;
|
||||
enum manual_content_scan_system_name_type next_system_name_type =
|
||||
|
@ -383,6 +383,10 @@ int generic_action_ok_displaylist_push(const char *path,
|
||||
settings_t *settings = config_get_ptr();
|
||||
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0);
|
||||
char *menu_driver = settings->arrays.menu_driver;
|
||||
#ifdef HAVE_AUDIOMIXER
|
||||
bool audio_enable_menu = settings->bools.audio_enable_menu;
|
||||
bool audio_enable_menu_ok = settings->bools.audio_enable_menu_ok;
|
||||
#endif
|
||||
|
||||
if (!menu || string_is_equal(menu_driver, "null"))
|
||||
{
|
||||
@ -391,7 +395,7 @@ int generic_action_ok_displaylist_push(const char *path,
|
||||
}
|
||||
|
||||
#ifdef HAVE_AUDIOMIXER
|
||||
if (settings->bools.audio_enable_menu && settings->bools.audio_enable_menu_ok)
|
||||
if (audio_enable_menu && audio_enable_menu_ok)
|
||||
audio_driver_mixer_play_menu_sound(AUDIO_MIXER_SYSTEM_SLOT_OK);
|
||||
#endif
|
||||
|
||||
@ -1511,9 +1515,11 @@ static int set_path_generic(const char *label, const char *action_path)
|
||||
int generic_action_ok_command(enum event_command cmd)
|
||||
{
|
||||
#ifdef HAVE_AUDIOMIXER
|
||||
settings_t *settings = config_get_ptr();
|
||||
settings_t *settings = config_get_ptr();
|
||||
bool audio_enable_menu = settings->bools.audio_enable_menu;
|
||||
bool audio_enable_menu_ok = settings->bools.audio_enable_menu_ok;
|
||||
|
||||
if (settings->bools.audio_enable_menu && settings->bools.audio_enable_menu_ok)
|
||||
if (audio_enable_menu && audio_enable_menu_ok)
|
||||
audio_driver_mixer_play_menu_sound(AUDIO_MIXER_SYSTEM_SLOT_OK);
|
||||
#endif
|
||||
|
||||
@ -1618,8 +1624,10 @@ static int generic_action_ok(const char *path,
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
#ifdef HAVE_AUDIOMIXER
|
||||
settings_t *settings = config_get_ptr();
|
||||
bool audio_enable_menu = settings->bools.audio_enable_menu;
|
||||
bool audio_enable_menu_ok = settings->bools.audio_enable_menu_ok;
|
||||
|
||||
if (settings->bools.audio_enable_menu && settings->bools.audio_enable_menu_ok)
|
||||
if (audio_enable_menu && audio_enable_menu_ok)
|
||||
audio_driver_mixer_play_menu_sound(AUDIO_MIXER_SYSTEM_SLOT_OK);
|
||||
#endif
|
||||
|
||||
@ -1680,11 +1688,12 @@ static int generic_action_ok(const char *path,
|
||||
#ifdef HAVE_CONFIGFILE
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
bool config_save_on_exit = settings->bools.config_save_on_exit;
|
||||
flush_type = MENU_SETTINGS;
|
||||
|
||||
gfx_display_set_msg_force(true);
|
||||
|
||||
if (config_replace(settings->bools.config_save_on_exit, action_path))
|
||||
if (config_replace(config_save_on_exit, action_path))
|
||||
{
|
||||
bool pending_push = false;
|
||||
menu_driver_ctl(MENU_NAVIGATION_CTL_CLEAR, &pending_push);
|
||||
@ -1738,7 +1747,7 @@ static int generic_action_ok(const char *path,
|
||||
case ACTION_OK_LOAD_RECORD_CONFIGFILE:
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
flush_char = msg_hash_to_str(flush_id);
|
||||
flush_char = msg_hash_to_str(flush_id);
|
||||
|
||||
if (settings)
|
||||
strlcpy(settings->paths.path_record_config, action_path,
|
||||
@ -1784,7 +1793,8 @@ static int generic_action_ok(const char *path,
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
flush_char = msg_hash_to_str(MENU_ENUM_LABEL_DISK_OPTIONS);
|
||||
flush_char = msg_hash_to_str(
|
||||
MENU_ENUM_LABEL_DISK_OPTIONS);
|
||||
command_event(CMD_EVENT_DISK_APPEND_IMAGE, action_path);
|
||||
|
||||
if (settings)
|
||||
@ -2566,6 +2576,8 @@ static int action_ok_audio_add_to_mixer_and_collection_and_play(const char *path
|
||||
char combined_path[PATH_MAX_LENGTH];
|
||||
struct playlist_entry entry = {0};
|
||||
settings_t *settings = config_get_ptr();
|
||||
bool playlist_fuzzy_archive_match = settings->bools.playlist_fuzzy_archive_match;
|
||||
bool playlist_use_old_format = settings->bools.playlist_use_old_format;
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
|
||||
combined_path[0] = '\0';
|
||||
@ -2582,8 +2594,8 @@ static int action_ok_audio_add_to_mixer_and_collection_and_play(const char *path
|
||||
entry.core_name = (char*)"musicplayer";
|
||||
|
||||
command_playlist_push_write(g_defaults.music_history, &entry,
|
||||
settings->bools.playlist_fuzzy_archive_match,
|
||||
settings->bools.playlist_use_old_format
|
||||
playlist_fuzzy_archive_match,
|
||||
playlist_use_old_format
|
||||
);
|
||||
|
||||
if (filestream_exists(combined_path))
|
||||
@ -2645,6 +2657,7 @@ static void menu_input_st_string_cb_rename_entry(void *userdata,
|
||||
const char *str)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
bool playlist_use_old_format = settings->bools.playlist_use_old_format;
|
||||
if (str && *str)
|
||||
{
|
||||
const char *label = menu_input_dialog_get_buffer();
|
||||
@ -2653,13 +2666,14 @@ static void menu_input_st_string_cb_rename_entry(void *userdata,
|
||||
{
|
||||
struct playlist_entry entry = {0};
|
||||
|
||||
/* the update function reads our entry as const, so these casts are safe */
|
||||
/* the update function reads our entry as const,
|
||||
* so these casts are safe */
|
||||
entry.label = (char*)label;
|
||||
|
||||
command_playlist_update_write(NULL,
|
||||
menu_input_dialog_get_kb_idx(),
|
||||
&entry,
|
||||
settings->bools.playlist_use_old_format);
|
||||
playlist_use_old_format);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2671,10 +2685,12 @@ static void menu_input_st_string_cb_disable_kiosk_mode(void *userdata,
|
||||
{
|
||||
if (str && *str)
|
||||
{
|
||||
const char *label = menu_input_dialog_get_buffer();
|
||||
settings_t *settings = config_get_ptr();
|
||||
const char *label = menu_input_dialog_get_buffer();
|
||||
settings_t *settings = config_get_ptr();
|
||||
const char *path_kiosk_mode_password =
|
||||
settings->paths.kiosk_mode_password;
|
||||
|
||||
if (string_is_equal(label, settings->paths.kiosk_mode_password))
|
||||
if (string_is_equal(label, path_kiosk_mode_password))
|
||||
{
|
||||
settings->bools.kiosk_mode_enable = false;
|
||||
|
||||
@ -2700,10 +2716,12 @@ static void menu_input_st_string_cb_enable_settings(void *userdata,
|
||||
{
|
||||
if (str && *str)
|
||||
{
|
||||
const char *label = menu_input_dialog_get_buffer();
|
||||
settings_t *settings = config_get_ptr();
|
||||
const char *label =
|
||||
menu_input_dialog_get_buffer();
|
||||
settings_t *settings = config_get_ptr();
|
||||
const char *menu_content_show_settings_password = settings->paths.menu_content_show_settings_password;
|
||||
|
||||
if (string_is_equal(label, settings->paths.menu_content_show_settings_password))
|
||||
if (string_is_equal(label, menu_content_show_settings_password))
|
||||
{
|
||||
settings->bools.menu_content_show_settings = true;
|
||||
|
||||
@ -2730,10 +2748,12 @@ static void menu_input_st_string_cb_save_preset(void *userdata,
|
||||
{
|
||||
if (!string_is_empty(str))
|
||||
{
|
||||
rarch_setting_t *setting = NULL;
|
||||
settings_t *settings = config_get_ptr();
|
||||
bool ret = false;
|
||||
const char *label = menu_input_dialog_get_label_buffer();
|
||||
rarch_setting_t *setting = NULL;
|
||||
bool ret = false;
|
||||
const char *label = menu_input_dialog_get_label_buffer();
|
||||
settings_t *settings = config_get_ptr();
|
||||
const char *dir_video_shader = settings->paths.directory_video_shader;
|
||||
const char *dir_menu_config = settings->paths.directory_menu_config;
|
||||
|
||||
if (!string_is_empty(label))
|
||||
setting = menu_setting_find(label);
|
||||
@ -2744,10 +2764,11 @@ static void menu_input_st_string_cb_save_preset(void *userdata,
|
||||
menu_setting_generic(setting, false);
|
||||
}
|
||||
else if (!string_is_empty(label))
|
||||
ret = menu_shader_manager_save_preset(menu_shader_get(),
|
||||
ret = menu_shader_manager_save_preset(
|
||||
menu_shader_get(),
|
||||
str,
|
||||
settings->paths.directory_video_shader,
|
||||
settings->paths.directory_menu_config,
|
||||
dir_video_shader,
|
||||
dir_menu_config,
|
||||
true);
|
||||
|
||||
if (ret)
|
||||
@ -2771,9 +2792,10 @@ static void menu_input_st_string_cb_cheat_file_save_as(
|
||||
{
|
||||
if (str && *str)
|
||||
{
|
||||
rarch_setting_t *setting = NULL;
|
||||
settings_t *settings = config_get_ptr();
|
||||
const char *label = menu_input_dialog_get_label_buffer();
|
||||
rarch_setting_t *setting = NULL;
|
||||
const char *label = menu_input_dialog_get_label_buffer();
|
||||
settings_t *settings = config_get_ptr();
|
||||
const char *path_cheat_database = settings->paths.path_cheat_database;
|
||||
|
||||
if (!string_is_empty(label))
|
||||
setting = menu_setting_find(label);
|
||||
@ -2784,7 +2806,8 @@ static void menu_input_st_string_cb_cheat_file_save_as(
|
||||
menu_setting_generic(setting, false);
|
||||
}
|
||||
else if (!string_is_empty(label))
|
||||
cheat_manager_save(str, settings->paths.path_cheat_database,false);
|
||||
cheat_manager_save(str, path_cheat_database,
|
||||
false);
|
||||
}
|
||||
|
||||
menu_input_dialog_end();
|
||||
@ -2901,6 +2924,8 @@ static int generic_action_ok_shader_preset_save(const char *path,
|
||||
{
|
||||
enum auto_shader_type preset_type;
|
||||
settings_t *settings = config_get_ptr();
|
||||
const char *dir_video_shader = settings->paths.directory_video_shader;
|
||||
const char *dir_menu_config = settings->paths.directory_menu_config;
|
||||
|
||||
switch (action_type)
|
||||
{
|
||||
@ -2921,8 +2946,7 @@ static int generic_action_ok_shader_preset_save(const char *path,
|
||||
}
|
||||
|
||||
if (menu_shader_manager_save_auto_preset(menu_shader_get(), preset_type,
|
||||
settings->paths.directory_video_shader,
|
||||
settings->paths.directory_menu_config,
|
||||
dir_video_shader, dir_menu_config,
|
||||
true))
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MSG_SHADER_PRESET_SAVED_SUCCESSFULLY),
|
||||
@ -3002,16 +3026,17 @@ static int generic_action_ok_remap_file_operation(const char *path,
|
||||
char directory[PATH_MAX_LENGTH];
|
||||
char file[PATH_MAX_LENGTH];
|
||||
char content_dir[PATH_MAX_LENGTH];
|
||||
settings_t *settings = config_get_ptr();
|
||||
struct retro_system_info *system = runloop_get_libretro_system_info();
|
||||
const char *core_name = system ? system->library_name : NULL;
|
||||
struct retro_system_info *system = runloop_get_libretro_system_info();
|
||||
const char *core_name = system ? system->library_name : NULL;
|
||||
settings_t *settings = config_get_ptr();
|
||||
const char *path_dir_input_remapping = settings->paths.directory_input_remapping;
|
||||
|
||||
directory[0] = file[0] = '\0';
|
||||
|
||||
if (!string_is_empty(core_name))
|
||||
fill_pathname_join(
|
||||
directory,
|
||||
settings->paths.directory_input_remapping,
|
||||
path_dir_input_remapping,
|
||||
core_name,
|
||||
sizeof(directory));
|
||||
|
||||
@ -3074,9 +3099,7 @@ static int generic_action_ok_remap_file_operation(const char *path,
|
||||
}
|
||||
else
|
||||
{
|
||||
if (input_remapping_remove_file(file,
|
||||
settings->paths.directory_input_remapping
|
||||
))
|
||||
if (input_remapping_remove_file(file, path_dir_input_remapping))
|
||||
{
|
||||
#ifdef HAVE_CONFIGFILE
|
||||
switch (action_type)
|
||||
@ -3232,10 +3255,14 @@ static int action_ok_core_deferred_set(const char *new_core_path,
|
||||
char core_display_name[PATH_MAX_LENGTH];
|
||||
char resolved_core_path[PATH_MAX_LENGTH];
|
||||
char msg[PATH_MAX_LENGTH];
|
||||
settings_t *settings = config_get_ptr();
|
||||
size_t selection = menu_navigation_get_selection();
|
||||
struct playlist_entry entry = {0};
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
settings_t *settings = config_get_ptr();
|
||||
const char *path_libretro_info = settings->paths.path_libretro_info;
|
||||
const char *path_dir_libretro = settings->paths.directory_libretro;
|
||||
bool show_hidden_files = settings->bools.show_hidden_files;
|
||||
bool playlist_use_old_format = settings->bools.playlist_use_old_format;
|
||||
|
||||
ext_name[0] = '\0';
|
||||
core_display_name[0] = '\0';
|
||||
@ -3250,10 +3277,10 @@ static int action_ok_core_deferred_set(const char *new_core_path,
|
||||
|
||||
core_info_get_name(new_core_path,
|
||||
core_display_name, sizeof(core_display_name),
|
||||
settings->paths.path_libretro_info,
|
||||
settings->paths.directory_libretro,
|
||||
path_libretro_info,
|
||||
path_dir_libretro,
|
||||
ext_name,
|
||||
settings->bools.show_hidden_files,
|
||||
show_hidden_files,
|
||||
true);
|
||||
|
||||
strlcpy(resolved_core_path, new_core_path, sizeof(resolved_core_path));
|
||||
@ -3268,7 +3295,7 @@ static int action_ok_core_deferred_set(const char *new_core_path,
|
||||
NULL,
|
||||
menu->scratchpad.unsigned_var,
|
||||
&entry,
|
||||
settings->bools.playlist_use_old_format);
|
||||
playlist_use_old_format);
|
||||
|
||||
/* Provide visual feedback */
|
||||
strlcpy(msg, msg_hash_to_str(MSG_SET_CORE_ASSOCIATION), sizeof(msg));
|
||||
@ -3471,13 +3498,14 @@ int action_ok_core_option_dropdown_list(const char *path,
|
||||
static int action_ok_cheat_reload_cheats(const char *path,
|
||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||
{
|
||||
bool refresh = false;
|
||||
settings_t *settings = config_get_ptr();
|
||||
bool refresh = false;
|
||||
settings_t *settings = config_get_ptr();
|
||||
const char *path_cheat_database = settings->paths.path_cheat_database;
|
||||
|
||||
cheat_manager_realloc(0, CHEAT_HANDLER_TYPE_EMU);
|
||||
|
||||
cheat_manager_load_game_specific_cheats(
|
||||
settings->paths.path_cheat_database);
|
||||
path_cheat_database);
|
||||
|
||||
menu_entries_ctl(MENU_ENTRIES_CTL_SET_REFRESH, &refresh);
|
||||
menu_driver_ctl(RARCH_MENU_CTL_SET_PREVENT_POPULATE, NULL);
|
||||
@ -3968,13 +3996,15 @@ static int generic_action_ok_network(const char *path,
|
||||
{
|
||||
char url_path[PATH_MAX_LENGTH];
|
||||
char url_path_encoded[PATH_MAX_LENGTH];
|
||||
settings_t *settings = config_get_ptr();
|
||||
unsigned type_id2 = 0;
|
||||
file_transfer_t *transf = NULL;
|
||||
const char *url_label = NULL;
|
||||
retro_task_callback_t callback = NULL;
|
||||
bool refresh = true;
|
||||
bool suppress_msg = false;
|
||||
unsigned type_id2 = 0;
|
||||
file_transfer_t *transf = NULL;
|
||||
const char *url_label = NULL;
|
||||
retro_task_callback_t callback = NULL;
|
||||
bool refresh = true;
|
||||
bool suppress_msg = false;
|
||||
settings_t *settings = config_get_ptr();
|
||||
const char *network_buildbot_assets_url =
|
||||
settings->paths.network_buildbot_assets_url;
|
||||
|
||||
url_path[0] = '\0';
|
||||
url_path_encoded[0] = '\0';
|
||||
@ -3983,11 +4013,11 @@ static int generic_action_ok_network(const char *path,
|
||||
{
|
||||
case MENU_ENUM_LABEL_CB_CORE_CONTENT_DIRS_LIST:
|
||||
|
||||
if (string_is_empty(settings->paths.network_buildbot_assets_url))
|
||||
if (string_is_empty(network_buildbot_assets_url))
|
||||
return menu_cbs_exit();
|
||||
|
||||
fill_pathname_join(url_path,
|
||||
settings->paths.network_buildbot_assets_url,
|
||||
network_buildbot_assets_url,
|
||||
"cores/.index-dirs", sizeof(url_path));
|
||||
url_label = msg_hash_to_str(enum_idx);
|
||||
type_id2 = ACTION_OK_DL_CORE_CONTENT_DIRS_LIST;
|
||||
@ -4124,20 +4154,27 @@ void cb_generic_download(retro_task_t *task,
|
||||
case MENU_ENUM_LABEL_CB_UPDATE_SHADERS_SLANG:
|
||||
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_SLANG) || defined(HAVE_HLSL)
|
||||
{
|
||||
static char shaderdir[PATH_MAX_LENGTH] = {0};
|
||||
const char *dirname = NULL;
|
||||
static char shaderdir[PATH_MAX_LENGTH] = {0};
|
||||
const char *dirname = NULL;
|
||||
const char *dir_video_shader = settings->paths.directory_video_shader;
|
||||
|
||||
if (transf->enum_idx == MENU_ENUM_LABEL_CB_UPDATE_SHADERS_CG)
|
||||
dirname = "shaders_cg";
|
||||
else if (transf->enum_idx == MENU_ENUM_LABEL_CB_UPDATE_SHADERS_GLSL)
|
||||
dirname = "shaders_glsl";
|
||||
else if (transf->enum_idx == MENU_ENUM_LABEL_CB_UPDATE_SHADERS_SLANG)
|
||||
dirname = "shaders_slang";
|
||||
switch (transf->enum_idx)
|
||||
{
|
||||
case MENU_ENUM_LABEL_CB_UPDATE_SHADERS_CG:
|
||||
dirname = "shaders_cg";
|
||||
break;
|
||||
case MENU_ENUM_LABEL_CB_UPDATE_SHADERS_GLSL:
|
||||
dirname = "shaders_glsl";
|
||||
break;
|
||||
case MENU_ENUM_LABEL_CB_UPDATE_SHADERS_SLANG:
|
||||
dirname = "shaders_slang";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
fill_pathname_join(shaderdir,
|
||||
settings->paths.directory_video_shader,
|
||||
dirname,
|
||||
sizeof(shaderdir));
|
||||
fill_pathname_join(shaderdir, dir_video_shader,
|
||||
dirname, sizeof(shaderdir));
|
||||
|
||||
if (!path_is_directory(shaderdir) && !path_mkdir(shaderdir))
|
||||
goto finish;
|
||||
@ -4259,14 +4296,17 @@ static int action_ok_download_generic(const char *path,
|
||||
char s2[PATH_MAX_LENGTH];
|
||||
char s3[PATH_MAX_LENGTH];
|
||||
file_transfer_t *transf = NULL;
|
||||
settings_t *settings = config_get_ptr();
|
||||
bool suppress_msg = false;
|
||||
retro_task_callback_t cb = cb_generic_download;
|
||||
settings_t *settings = config_get_ptr();
|
||||
const char *network_buildbot_assets_url =
|
||||
settings->paths.network_buildbot_assets_url;
|
||||
const char *network_buildbot_url = settings->paths.network_buildbot_url;
|
||||
|
||||
s[0] = s2[0] = s3[0] = '\0';
|
||||
|
||||
fill_pathname_join(s,
|
||||
settings->paths.network_buildbot_assets_url,
|
||||
network_buildbot_assets_url,
|
||||
"frontend", sizeof(s));
|
||||
|
||||
switch (enum_idx)
|
||||
@ -4323,7 +4363,7 @@ static int action_ok_download_generic(const char *path,
|
||||
strlcpy(s, "http://thumbnailpacks.libretro.com", sizeof(s));
|
||||
break;
|
||||
default:
|
||||
strlcpy(s, settings->paths.network_buildbot_url, sizeof(s));
|
||||
strlcpy(s, network_buildbot_url, sizeof(s));
|
||||
break;
|
||||
}
|
||||
|
||||
@ -4338,7 +4378,8 @@ static int action_ok_download_generic(const char *path,
|
||||
else
|
||||
net_http_urlencode_full(s3, s2, sizeof(s3));
|
||||
|
||||
task_push_http_transfer_file(s3, suppress_msg, msg_hash_to_str(enum_idx), cb, transf);
|
||||
task_push_http_transfer_file(s3, suppress_msg,
|
||||
msg_hash_to_str(enum_idx), cb, transf);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
@ -4350,7 +4391,8 @@ static int action_ok_core_content_download(const char *path,
|
||||
const char *menu_label = NULL;
|
||||
enum msg_hash_enums enum_idx = MSG_UNKNOWN;
|
||||
|
||||
menu_entries_get_last_stack(&menu_path, &menu_label, NULL, &enum_idx, NULL);
|
||||
menu_entries_get_last_stack(&menu_path, &menu_label,
|
||||
NULL, &enum_idx, NULL);
|
||||
|
||||
return action_ok_download_generic(path, label,
|
||||
menu_path, type, idx, entry_idx,
|
||||
@ -4363,13 +4405,14 @@ static int action_ok_core_updater_download(const char *path,
|
||||
#ifdef HAVE_NETWORKING
|
||||
core_updater_list_t *core_list = core_updater_list_get_cached();
|
||||
settings_t *settings = config_get_ptr();
|
||||
const char *path_dir_libretro = settings->paths.directory_libretro;
|
||||
|
||||
if (!core_list)
|
||||
return menu_cbs_exit();
|
||||
|
||||
task_push_core_updater_download(
|
||||
core_list, path, false, true,
|
||||
settings->paths.directory_libretro);
|
||||
path_dir_libretro);
|
||||
|
||||
#endif
|
||||
return 0;
|
||||
@ -4379,13 +4422,14 @@ static int action_ok_core_updater_download(const char *path,
|
||||
static int action_ok_update_installed_cores(const char *path,
|
||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
settings_t *settings = config_get_ptr();
|
||||
const char *path_dir_libretro = settings->paths.directory_libretro;
|
||||
|
||||
/* Ensure networking is initialised */
|
||||
generic_action_ok_command(CMD_EVENT_NETWORK_INIT);
|
||||
|
||||
/* Push update task */
|
||||
task_push_update_installed_cores(settings->paths.directory_libretro);
|
||||
task_push_update_installed_cores(path_dir_libretro);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -4394,14 +4438,15 @@ static int action_ok_update_installed_cores(const char *path,
|
||||
static int action_ok_sideload_core(const char *path,
|
||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
const char *menu_path = NULL;
|
||||
const char *core_file = path;
|
||||
int ret = -1;
|
||||
char src_path[PATH_MAX_LENGTH];
|
||||
char dst_path[PATH_MAX_LENGTH];
|
||||
char msg[PATH_MAX_LENGTH];
|
||||
const char *menu_path = NULL;
|
||||
const char *core_file = path;
|
||||
int ret = -1;
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
settings_t *settings = config_get_ptr();
|
||||
const char *dir_libretro = settings->paths.directory_libretro;
|
||||
|
||||
src_path[0] = '\0';
|
||||
dst_path[0] = '\0';
|
||||
@ -4414,7 +4459,7 @@ static int action_ok_sideload_core(const char *path,
|
||||
if (!settings || string_is_empty(core_file))
|
||||
goto end;
|
||||
|
||||
if (string_is_empty(settings->paths.directory_libretro))
|
||||
if (string_is_empty(dir_libretro))
|
||||
goto end;
|
||||
|
||||
/* Get source core path */
|
||||
@ -4429,7 +4474,7 @@ static int action_ok_sideload_core(const char *path,
|
||||
|
||||
/* Get destination core path */
|
||||
fill_pathname_join(
|
||||
dst_path, settings->paths.directory_libretro,
|
||||
dst_path, dir_libretro,
|
||||
core_file, sizeof(dst_path));
|
||||
|
||||
/* Copy core file from source to destination */
|
||||
@ -4813,19 +4858,20 @@ static int action_ok_delete_entry(const char *path,
|
||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||
{
|
||||
size_t new_selection_ptr;
|
||||
char *conf_path = NULL;
|
||||
char *def_conf_path = NULL;
|
||||
char *def_conf_music_path = NULL;
|
||||
char *conf_path = NULL;
|
||||
char *def_conf_path = NULL;
|
||||
char *def_conf_music_path = NULL;
|
||||
#if defined(HAVE_FFMPEG) || defined(HAVE_MPV)
|
||||
char *def_conf_video_path = NULL;
|
||||
char *def_conf_video_path = NULL;
|
||||
#endif
|
||||
#ifdef HAVE_IMAGEVIEWER
|
||||
char *def_conf_img_path = NULL;
|
||||
char *def_conf_img_path = NULL;
|
||||
#endif
|
||||
char *def_conf_fav_path = NULL;
|
||||
settings_t *settings = config_get_ptr();
|
||||
playlist_t *playlist = playlist_get_cached();
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
char *def_conf_fav_path = NULL;
|
||||
settings_t *settings = config_get_ptr();
|
||||
bool playlist_use_old_format = settings->bools.playlist_use_old_format;
|
||||
playlist_t *playlist = playlist_get_cached();
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
|
||||
if (!menu)
|
||||
return menu_cbs_exit();
|
||||
@ -4859,7 +4905,7 @@ static int action_ok_delete_entry(const char *path,
|
||||
if (playlist)
|
||||
{
|
||||
playlist_delete_index(playlist, menu->rpl_entry_selection_ptr);
|
||||
playlist_write_file(playlist, settings->bools.playlist_use_old_format);
|
||||
playlist_write_file(playlist, playlist_use_old_format);
|
||||
}
|
||||
|
||||
new_selection_ptr = menu_navigation_get_selection();
|
||||
@ -5404,10 +5450,11 @@ static int action_ok_scan_directory_list(const char *path,
|
||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
const char *dir_menu_content = settings->paths.directory_menu_content;
|
||||
|
||||
filebrowser_clear_type();
|
||||
return generic_action_ok_displaylist_push(path,
|
||||
settings->paths.directory_menu_content, label, type, idx,
|
||||
dir_menu_content, label, type, idx,
|
||||
entry_idx, ACTION_OK_DL_SCAN_DIR_LIST);
|
||||
}
|
||||
|
||||
@ -5424,10 +5471,11 @@ static int action_ok_push_downloads_dir(const char *path,
|
||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
const char *dir_core_assets = settings->paths.directory_core_assets;
|
||||
|
||||
filebrowser_set_type(FILEBROWSER_SELECT_FILE);
|
||||
return generic_action_ok_displaylist_push(path,
|
||||
settings->paths.directory_core_assets,
|
||||
dir_core_assets,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_FAVORITES),
|
||||
type, idx,
|
||||
entry_idx, ACTION_OK_DL_CONTENT_LIST);
|
||||
@ -5465,15 +5513,17 @@ int action_ok_push_manual_content_scan_dir_select(const char *path,
|
||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
const char *dir_menu_content = settings->paths.directory_menu_content;
|
||||
|
||||
filebrowser_clear_type();
|
||||
return generic_action_ok_displaylist_push(path,
|
||||
settings->paths.directory_menu_content, label, type, idx,
|
||||
dir_menu_content, label, type, idx,
|
||||
entry_idx, ACTION_OK_DL_MANUAL_SCAN_DIR_LIST);
|
||||
}
|
||||
|
||||
/* TODO/FIXME */
|
||||
static int action_ok_push_dropdown_setting_core_options_item_special(const char *path,
|
||||
static int action_ok_push_dropdown_setting_core_options_item_special(
|
||||
const char *path,
|
||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||
{
|
||||
core_option_manager_t *coreopts = NULL;
|
||||
@ -5721,9 +5771,10 @@ static int action_ok_push_dropdown_item_playlist_default_core(const char *path,
|
||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||
{
|
||||
core_info_list_t *core_info_list = NULL;
|
||||
settings_t *settings = config_get_ptr();
|
||||
playlist_t *playlist = playlist_get_cached();
|
||||
const char* core_name = path;
|
||||
settings_t *settings = config_get_ptr();
|
||||
bool playlist_use_old_format = settings->bools.playlist_use_old_format;
|
||||
|
||||
(void)label;
|
||||
(void)type;
|
||||
@ -5778,39 +5829,40 @@ static int action_ok_push_dropdown_item_playlist_default_core(const char *path,
|
||||
}
|
||||
|
||||
/* In all cases, update file on disk */
|
||||
playlist_write_file(playlist,
|
||||
settings->bools.playlist_use_old_format);
|
||||
playlist_write_file(playlist, playlist_use_old_format);
|
||||
|
||||
return action_cancel_pop_default(NULL, NULL, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
static int action_ok_push_dropdown_item_playlist_label_display_mode(const char *path,
|
||||
static int action_ok_push_dropdown_item_playlist_label_display_mode(
|
||||
const char *path,
|
||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
playlist_t *playlist = playlist_get_cached();
|
||||
settings_t *settings = config_get_ptr();
|
||||
playlist_t *playlist = playlist_get_cached();
|
||||
bool playlist_use_old_format = settings->bools.playlist_use_old_format;
|
||||
|
||||
playlist_set_label_display_mode(playlist, (enum playlist_label_display_mode)idx);
|
||||
|
||||
/* In all cases, update file on disk */
|
||||
playlist_write_file(playlist,
|
||||
settings->bools.playlist_use_old_format);
|
||||
playlist_write_file(playlist, playlist_use_old_format);
|
||||
|
||||
return action_cancel_pop_default(NULL, NULL, 0, 0);
|
||||
}
|
||||
|
||||
static int generic_set_thumbnail_mode(enum playlist_thumbnail_id thumbnail_id, size_t idx)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
playlist_t *playlist = playlist_get_cached();
|
||||
settings_t *settings = config_get_ptr();
|
||||
playlist_t *playlist = playlist_get_cached();
|
||||
bool playlist_use_old_format = settings->bools.playlist_use_old_format;
|
||||
|
||||
if (!playlist)
|
||||
return -1;
|
||||
|
||||
playlist_set_thumbnail_mode(playlist, thumbnail_id, (enum playlist_thumbnail_mode)idx);
|
||||
playlist_write_file(playlist,
|
||||
settings->bools.playlist_use_old_format);
|
||||
playlist_set_thumbnail_mode(playlist, thumbnail_id,
|
||||
(enum playlist_thumbnail_mode)idx);
|
||||
playlist_write_file(playlist, playlist_use_old_format);
|
||||
|
||||
return action_cancel_pop_default(NULL, NULL, 0, 0);
|
||||
}
|
||||
@ -6163,12 +6215,17 @@ static int action_ok_disk_cycle_tray_status(const char *path,
|
||||
bool print_log = false;
|
||||
rarch_system_info_t *sys_info = runloop_get_system_info();
|
||||
settings_t *settings = config_get_ptr();
|
||||
#ifdef HAVE_AUDIOMIXER
|
||||
bool audio_enable_menu = settings->bools.audio_enable_menu;
|
||||
bool audio_enable_menu_ok = settings->bools.audio_enable_menu_ok;
|
||||
#endif
|
||||
bool menu_insert_disk_resume = settings->bools.menu_insert_disk_resume;
|
||||
|
||||
if (!settings)
|
||||
return menu_cbs_exit();
|
||||
|
||||
#ifdef HAVE_AUDIOMIXER
|
||||
if (settings->bools.audio_enable_menu && settings->bools.audio_enable_menu_ok)
|
||||
if (audio_enable_menu && audio_enable_menu_ok)
|
||||
audio_driver_mixer_play_menu_sound(AUDIO_MIXER_SYSTEM_SLOT_OK);
|
||||
#endif
|
||||
|
||||
@ -6181,7 +6238,7 @@ static int action_ok_disk_cycle_tray_status(const char *path,
|
||||
* inserting a disk (i.e. if quick menu remains
|
||||
* open, there is sufficient visual feedback
|
||||
* without a notification) */
|
||||
print_log = settings->bools.menu_insert_disk_resume && disk_ejected;
|
||||
print_log = menu_insert_disk_resume && disk_ejected;
|
||||
|
||||
if (!command_event(CMD_EVENT_DISK_EJECT_TOGGLE, &print_log))
|
||||
return menu_cbs_exit();
|
||||
@ -6198,7 +6255,7 @@ static int action_ok_disk_cycle_tray_status(const char *path,
|
||||
|
||||
/* If disk is now inserted and user has enabled
|
||||
* 'menu_insert_disk_resume', resume running content */
|
||||
if (!disk_ejected && settings->bools.menu_insert_disk_resume)
|
||||
if (!disk_ejected && menu_insert_disk_resume)
|
||||
generic_action_ok_command(CMD_EVENT_RESUME);
|
||||
|
||||
return 0;
|
||||
@ -6267,15 +6324,17 @@ static int action_ok_netplay_enable_client(const char *path,
|
||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||
{
|
||||
#ifdef HAVE_NETWORKING
|
||||
settings_t *settings = config_get_ptr();
|
||||
menu_input_ctx_line_t line;
|
||||
settings_t *settings = config_get_ptr();
|
||||
const char *netplay_server = settings->paths.netplay_server;
|
||||
|
||||
if (netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_DATA_INITED, NULL))
|
||||
generic_action_ok_command(CMD_EVENT_NETPLAY_DEINIT);
|
||||
netplay_driver_ctl(RARCH_NETPLAY_CTL_ENABLE_CLIENT, NULL);
|
||||
|
||||
if (!string_is_empty(settings->paths.netplay_server))
|
||||
if (!string_is_empty(netplay_server))
|
||||
{
|
||||
action_ok_netplay_enable_client_hostname_cb(NULL, settings->paths.netplay_server);
|
||||
action_ok_netplay_enable_client_hostname_cb(NULL, netplay_server);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
@ -6359,22 +6418,25 @@ static int action_ok_pl_content_thumbnails(const char *path,
|
||||
|
||||
playlist_path[0] = '\0';
|
||||
|
||||
if (!settings)
|
||||
return -1;
|
||||
if (settings)
|
||||
{
|
||||
const char *path_dir_playlist = settings->paths.directory_playlist;
|
||||
const char *path_dir_thumbnails = settings->paths.directory_thumbnails;
|
||||
|
||||
if (string_is_empty(settings->paths.directory_playlist))
|
||||
return -1;
|
||||
if (!string_is_empty(path_dir_playlist))
|
||||
{
|
||||
fill_pathname_join(
|
||||
playlist_path,
|
||||
path_dir_playlist, label,
|
||||
sizeof(playlist_path));
|
||||
|
||||
fill_pathname_join(
|
||||
playlist_path,
|
||||
settings->paths.directory_playlist, label,
|
||||
sizeof(playlist_path));
|
||||
|
||||
task_push_pl_thumbnail_download(path, playlist_path, settings->paths.directory_thumbnails);
|
||||
return 0;
|
||||
#else
|
||||
return -1;
|
||||
task_push_pl_thumbnail_download(path, playlist_path,
|
||||
path_dir_thumbnails);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifdef HAVE_NETWORKING
|
||||
|
Loading…
x
Reference in New Issue
Block a user