mirror of
https://github.com/libretro/RetroArch
synced 2025-03-02 19:13:34 +00:00
Settings cleanups
This commit is contained in:
parent
8f65c2cf72
commit
d5985c35ae
@ -681,10 +681,20 @@ static int action_left_video_gpu_index(unsigned type, const char *label,
|
||||
if (list)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
if (settings->ints.vulkan_gpu_index > 0)
|
||||
settings->ints.vulkan_gpu_index--;
|
||||
int vulkan_gpu_index = settings->ints.vulkan_gpu_index;
|
||||
|
||||
if (vulkan_gpu_index > 0)
|
||||
{
|
||||
configuration_set_int(settings,
|
||||
settings->ints.vulkan_gpu_index,
|
||||
vulkan_gpu_index - 1);
|
||||
}
|
||||
else
|
||||
settings->ints.vulkan_gpu_index = list->size - 1;
|
||||
{
|
||||
configuration_set_int(settings,
|
||||
settings->ints.vulkan_gpu_index,
|
||||
list->size - 1);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
@ -698,10 +708,19 @@ static int action_left_video_gpu_index(unsigned type, const char *label,
|
||||
if (list)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
if (settings->ints.d3d10_gpu_index > 0)
|
||||
settings->ints.d3d10_gpu_index--;
|
||||
int d3d10_gpu_index = settings->ints.d3d10_gpu_index;
|
||||
if (d3d10_gpu_index > 0)
|
||||
{
|
||||
configuration_set_int(settings,
|
||||
settings->ints.d3d10_gpu_index,
|
||||
settings->ints.d3d10_gpu_index - 1);
|
||||
}
|
||||
else
|
||||
settings->ints.d3d10_gpu_index = list->size - 1;
|
||||
{
|
||||
configuration_set_int(settings,
|
||||
settings->ints.d3d10_gpu_index,
|
||||
list->size - 1);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
@ -715,10 +734,19 @@ static int action_left_video_gpu_index(unsigned type, const char *label,
|
||||
if (list)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
if (settings->ints.d3d11_gpu_index > 0)
|
||||
settings->ints.d3d11_gpu_index--;
|
||||
int d3d11_gpu_index = settings->ints.d3d11_gpu_index;
|
||||
if (d3d11_gpu_index > 0)
|
||||
{
|
||||
configuration_set_int(settings,
|
||||
settings->ints.d3d11_gpu_index,
|
||||
settings->ints.d3d11_gpu_index - 1);
|
||||
}
|
||||
else
|
||||
settings->ints.d3d11_gpu_index = list->size - 1;
|
||||
{
|
||||
configuration_set_int(settings,
|
||||
settings->ints.d3d11_gpu_index,
|
||||
list->size - 1);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
@ -732,10 +760,19 @@ static int action_left_video_gpu_index(unsigned type, const char *label,
|
||||
if (list)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
if (settings->ints.d3d12_gpu_index > 0)
|
||||
settings->ints.d3d12_gpu_index--;
|
||||
int d3d12_gpu_index = settings->ints.d3d12_gpu_index;
|
||||
if (d3d12_gpu_index > 0)
|
||||
{
|
||||
configuration_set_int(settings,
|
||||
settings->ints.d3d12_gpu_index,
|
||||
settings->ints.d3d12_gpu_index - 1);
|
||||
}
|
||||
else
|
||||
settings->ints.d3d12_gpu_index = list->size - 1;
|
||||
{
|
||||
configuration_set_int(settings,
|
||||
settings->ints.d3d12_gpu_index,
|
||||
list->size - 1);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -104,9 +104,11 @@ int shader_action_preset_parameter_right(unsigned type, const char *label, bool
|
||||
int generic_action_cheat_toggle(size_t idx, unsigned type, const char *label,
|
||||
bool wraparound)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
settings_t *settings = config_get_ptr();
|
||||
bool apply_cheats_after_toggle = settings->bools.apply_cheats_after_toggle;
|
||||
|
||||
cheat_manager_toggle_index(
|
||||
settings->bools.apply_cheats_after_toggle,
|
||||
apply_cheats_after_toggle,
|
||||
(unsigned)idx);
|
||||
|
||||
return 0;
|
||||
@ -478,13 +480,13 @@ static int action_right_video_resolution(unsigned type, const char *label,
|
||||
|
||||
static int playlist_association_right(unsigned type, const char *label,
|
||||
bool wraparound)
|
||||
{
|
||||
char core_path[PATH_MAX_LENGTH];
|
||||
{ char core_path[PATH_MAX_LENGTH];
|
||||
size_t i, next, current = 0;
|
||||
core_info_list_t *core_info_list = NULL;
|
||||
core_info_t *core_info = NULL;
|
||||
settings_t *settings = config_get_ptr();
|
||||
playlist_t *playlist = playlist_get_cached();
|
||||
bool playlist_use_old_format = settings->bools.playlist_use_old_format;
|
||||
|
||||
core_path[0] = '\0';
|
||||
|
||||
@ -547,7 +549,7 @@ static int playlist_association_right(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;
|
||||
}
|
||||
@ -558,6 +560,7 @@ static int playlist_label_display_mode_right(unsigned type, const char *label,
|
||||
enum playlist_label_display_mode label_display_mode;
|
||||
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;
|
||||
@ -570,7 +573,7 @@ static int playlist_label_display_mode_right(unsigned type, const char *label,
|
||||
label_display_mode = LABEL_DISPLAY_MODE_DEFAULT;
|
||||
|
||||
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;
|
||||
}
|
||||
@ -579,6 +582,7 @@ static void playlist_thumbnail_mode_right(playlist_t *playlist, enum playlist_th
|
||||
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);
|
||||
|
||||
@ -588,7 +592,7 @@ static void playlist_thumbnail_mode_right(playlist_t *playlist, enum playlist_th
|
||||
thumbnail_mode = PLAYLIST_THUMBNAIL_MODE_DEFAULT;
|
||||
|
||||
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_right(unsigned type, const char *label,
|
||||
@ -620,16 +624,18 @@ static int playlist_left_thumbnail_mode_right(unsigned type, const char *label,
|
||||
static int manual_content_scan_system_name_right(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);
|
||||
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);
|
||||
show_hidden_files);
|
||||
#endif
|
||||
const char *current_system_name = NULL;
|
||||
enum manual_content_scan_system_name_type next_system_name_type =
|
||||
|
@ -53,6 +53,9 @@ int action_scan_file(const char *path,
|
||||
char fullpath[PATH_MAX_LENGTH];
|
||||
const char *menu_path = NULL;
|
||||
settings_t *settings = config_get_ptr();
|
||||
bool show_hidden_files = settings->bools.show_hidden_files;
|
||||
const char *directory_playlist = settings->paths.directory_playlist;
|
||||
const char *path_content_db = settings->paths.path_content_database;
|
||||
|
||||
fullpath[0] = '\0';
|
||||
|
||||
@ -61,10 +64,10 @@ int action_scan_file(const char *path,
|
||||
fill_pathname_join(fullpath, menu_path, path, sizeof(fullpath));
|
||||
|
||||
task_push_dbscan(
|
||||
settings->paths.directory_playlist,
|
||||
settings->paths.path_content_database,
|
||||
directory_playlist,
|
||||
path_content_db,
|
||||
fullpath, false,
|
||||
settings->bools.show_hidden_files,
|
||||
show_hidden_files,
|
||||
handle_dbscan_finished);
|
||||
|
||||
return 0;
|
||||
@ -76,6 +79,9 @@ int action_scan_directory(const char *path,
|
||||
char fullpath[PATH_MAX_LENGTH];
|
||||
const char *menu_path = NULL;
|
||||
settings_t *settings = config_get_ptr();
|
||||
bool show_hidden_files = settings->bools.show_hidden_files;
|
||||
const char *directory_playlist = settings->paths.directory_playlist;
|
||||
const char *path_content_db = settings->paths.path_content_database;
|
||||
|
||||
fullpath[0] = '\0';
|
||||
|
||||
@ -87,10 +93,10 @@ int action_scan_directory(const char *path,
|
||||
strlcpy(fullpath, menu_path, sizeof(fullpath));
|
||||
|
||||
task_push_dbscan(
|
||||
settings->paths.directory_playlist,
|
||||
settings->paths.path_content_database,
|
||||
directory_playlist,
|
||||
path_content_db,
|
||||
fullpath, true,
|
||||
settings->bools.show_hidden_files,
|
||||
show_hidden_files,
|
||||
handle_dbscan_finished);
|
||||
|
||||
return 0;
|
||||
@ -123,9 +129,15 @@ int action_switch_thumbnail(const char *path,
|
||||
* types. */
|
||||
if (special_case)
|
||||
{
|
||||
settings->uints.menu_left_thumbnails++;
|
||||
configuration_set_uint(settings,
|
||||
settings->uints.menu_left_thumbnails,
|
||||
settings->uints.menu_left_thumbnails + 1);
|
||||
|
||||
if (settings->uints.menu_left_thumbnails > 3)
|
||||
settings->uints.menu_left_thumbnails = 1;
|
||||
{
|
||||
configuration_set_uint(settings,
|
||||
settings->uints.menu_left_thumbnails, 1);
|
||||
}
|
||||
menu_driver_ctl(RARCH_MENU_CTL_UPDATE_THUMBNAIL_PATH, NULL);
|
||||
menu_driver_ctl(RARCH_MENU_CTL_UPDATE_THUMBNAIL_IMAGE, NULL);
|
||||
}
|
||||
@ -140,9 +152,15 @@ int action_switch_thumbnail(const char *path,
|
||||
* types. */
|
||||
if (special_case)
|
||||
{
|
||||
settings->uints.gfx_thumbnails++;
|
||||
configuration_set_uint(settings,
|
||||
settings->uints.menu_left_thumbnails,
|
||||
settings->uints.menu_left_thumbnails + 1);
|
||||
|
||||
if (settings->uints.gfx_thumbnails > 3)
|
||||
settings->uints.gfx_thumbnails = 1;
|
||||
{
|
||||
configuration_set_uint(settings,
|
||||
settings->uints.gfx_thumbnails, 1);
|
||||
}
|
||||
}
|
||||
menu_driver_ctl(RARCH_MENU_CTL_UPDATE_THUMBNAIL_PATH, NULL);
|
||||
menu_driver_ctl(RARCH_MENU_CTL_UPDATE_THUMBNAIL_IMAGE, NULL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user