diff --git a/configuration.c b/configuration.c index 24d628a198..eff1e82834 100644 --- a/configuration.c +++ b/configuration.c @@ -3816,7 +3816,7 @@ bool config_save_autoconf_profile(const char *path, unsigned user) path_size); } - conf = config_file_new(autoconf_file); + conf = config_file_read(autoconf_file); if (!conf) { diff --git a/gfx/common/metal_common.m b/gfx/common/metal_common.m index 705445709e..f5b7e883bd 100644 --- a/gfx/common/metal_common.m +++ b/gfx/common/metal_common.m @@ -1,9 +1,9 @@ -// -// metal_common.m -// RetroArch_Metal -// -// Created by Stuart Carnie on 5/14/18. -// +/* + * metal_common.m + * RetroArch_Metal + * + * Created by Stuart Carnie on 5/14/18. + */ #import #import @@ -1133,7 +1133,7 @@ typedef struct MTLALIGN(16) [self _freeVideoShader:_shader]; _shader = nil; - config_file_t *conf = config_file_new(path.UTF8String); + config_file_t *conf = config_file_read(path.UTF8String); struct video_shader *shader = (struct video_shader *)calloc(1, sizeof(*shader)); @try diff --git a/gfx/drivers_shader/shader_gl_cg.c b/gfx/drivers_shader/shader_gl_cg.c index 71e805b76e..c9c2ad5a7c 100644 --- a/gfx/drivers_shader/shader_gl_cg.c +++ b/gfx/drivers_shader/shader_gl_cg.c @@ -773,7 +773,7 @@ static bool gl_cg_load_preset(void *data, const char *path) return false; RARCH_LOG("[CG]: Loading Cg meta-shader: %s\n", path); - conf = config_file_new(path); + conf = config_file_read(path); if (!conf) { RARCH_ERR("Failed to load preset.\n"); diff --git a/gfx/drivers_shader/shader_gl_core.cpp b/gfx/drivers_shader/shader_gl_core.cpp index 259cc46d0a..9aed2ea154 100644 --- a/gfx/drivers_shader/shader_gl_core.cpp +++ b/gfx/drivers_shader/shader_gl_core.cpp @@ -2265,7 +2265,7 @@ gl_core_filter_chain_t *gl_core_filter_chain_create_from_preset( if (!shader) return nullptr; - unique_ptr conf{ config_file_new(path) }; + unique_ptr conf{ config_file_read(path) }; if (!conf) return nullptr; @@ -2328,11 +2328,11 @@ gl_core_filter_chain_t *gl_core_filter_chain_create_from_preset( { /* Allow duplicate #pragma parameter, but * only if they are exactly the same. */ - if (meta_param.desc != itr->desc || + if (meta_param.desc != itr->desc || meta_param.initial != itr->initial || meta_param.minimum != itr->minimum || meta_param.maximum != itr->maximum || - meta_param.step != itr->step) + meta_param.step != itr->step) { RARCH_ERR("[GLCore]: Duplicate parameters found for \"%s\", but arguments do not match.\n", itr->id); diff --git a/gfx/drivers_shader/shader_glsl.c b/gfx/drivers_shader/shader_glsl.c index 3550074eae..b34277ff4f 100644 --- a/gfx/drivers_shader/shader_glsl.c +++ b/gfx/drivers_shader/shader_glsl.c @@ -896,7 +896,7 @@ static void *gl_glsl_init(void *data, const char *path) if (string_is_equal(path_ext, "glslp")) { - conf = config_file_new(path); + conf = config_file_read(path); if (conf) { ret = video_shader_read_conf_cgp(conf, glsl->shader); diff --git a/gfx/drivers_shader/shader_vulkan.cpp b/gfx/drivers_shader/shader_vulkan.cpp index ec3be3d1bd..f85500267c 100644 --- a/gfx/drivers_shader/shader_vulkan.cpp +++ b/gfx/drivers_shader/shader_vulkan.cpp @@ -2822,7 +2822,7 @@ vulkan_filter_chain_t *vulkan_filter_chain_create_from_preset( if (!shader) return nullptr; - unique_ptr conf{ config_file_new(path) }; + unique_ptr conf{ config_file_read(path) }; if (!conf) return nullptr; diff --git a/menu/cbs/menu_cbs_deferred_push.c b/menu/cbs/menu_cbs_deferred_push.c index 76434fcce2..ad82b5eff1 100644 --- a/menu/cbs/menu_cbs_deferred_push.c +++ b/menu/cbs/menu_cbs_deferred_push.c @@ -207,7 +207,7 @@ static int deferred_push_cursor_manager_list_deferred( char *rdb = NULL; settings_t *settings = config_get_ptr(); const char *path = info->path; - config_file_t *conf = path ? config_file_new(path) : NULL; + config_file_t *conf = path ? config_file_read(path) : NULL; if (!conf || !settings) goto end; diff --git a/menu/drivers/rgui.c b/menu/drivers/rgui.c index 3ec24529e7..176a64b40d 100644 --- a/menu/drivers/rgui.c +++ b/menu/drivers/rgui.c @@ -1379,15 +1379,15 @@ static const rgui_theme_t *get_theme(rgui_t *rgui) static void load_custom_theme(rgui_t *rgui, rgui_theme_t *theme_colors, const char *theme_path) { - settings_t *settings = config_get_ptr(); - config_file_t *conf = NULL; - char *wallpaper_key = NULL; unsigned normal_color, hover_color, title_color, bg_dark_color, bg_light_color, border_dark_color, border_light_color, shadow_color; char wallpaper_file[PATH_MAX_LENGTH]; - bool success = false; + config_file_t *conf = NULL; + char *wallpaper_key = NULL; + settings_t *settings = config_get_ptr(); + bool success = false; /* Determine which type of wallpaper to load */ switch (settings->uints.menu_rgui_aspect_ratio) @@ -1415,7 +1415,7 @@ static void load_custom_theme(rgui_t *rgui, rgui_theme_t *theme_colors, const ch goto end; /* Open config file */ - conf = config_file_new(theme_path); + conf = config_file_read(theme_path); if (!conf) goto end; @@ -1447,7 +1447,8 @@ static void load_custom_theme(rgui_t *rgui, rgui_theme_t *theme_colors, const ch if(!config_get_hex(conf, "rgui_shadow_color", &shadow_color)) shadow_color = 0xFF000000; - config_get_array(conf, wallpaper_key, wallpaper_file, sizeof(wallpaper_file)); + config_get_array(conf, wallpaper_key, + wallpaper_file, sizeof(wallpaper_file)); success = true; @@ -1455,14 +1456,14 @@ end: if (success) { - theme_colors->normal_color = (uint32_t)normal_color; - theme_colors->hover_color = (uint32_t)hover_color; - theme_colors->title_color = (uint32_t)title_color; - theme_colors->bg_dark_color = (uint32_t)bg_dark_color; - theme_colors->bg_light_color = (uint32_t)bg_light_color; - theme_colors->border_dark_color = (uint32_t)border_dark_color; + theme_colors->normal_color = (uint32_t)normal_color; + theme_colors->hover_color = (uint32_t)hover_color; + theme_colors->title_color = (uint32_t)title_color; + theme_colors->bg_dark_color = (uint32_t)bg_dark_color; + theme_colors->bg_light_color = (uint32_t)bg_light_color; + theme_colors->border_dark_color = (uint32_t)border_dark_color; theme_colors->border_light_color = (uint32_t)border_light_color; - theme_colors->shadow_color = (uint32_t)shadow_color; + theme_colors->shadow_color = (uint32_t)shadow_color; /* Load wallpaper, if required */ if (!string_is_empty(wallpaper_file)) @@ -1477,14 +1478,14 @@ end: else { /* Use 'Classic Green' fallback */ - theme_colors->normal_color = rgui_theme_classic_green.normal_color; - theme_colors->hover_color = rgui_theme_classic_green.hover_color; - theme_colors->title_color = rgui_theme_classic_green.title_color; - theme_colors->bg_dark_color = rgui_theme_classic_green.bg_dark_color; - theme_colors->bg_light_color = rgui_theme_classic_green.bg_light_color; - theme_colors->border_dark_color = rgui_theme_classic_green.border_dark_color; + theme_colors->normal_color = rgui_theme_classic_green.normal_color; + theme_colors->hover_color = rgui_theme_classic_green.hover_color; + theme_colors->title_color = rgui_theme_classic_green.title_color; + theme_colors->bg_dark_color = rgui_theme_classic_green.bg_dark_color; + theme_colors->bg_light_color = rgui_theme_classic_green.bg_light_color; + theme_colors->border_dark_color = rgui_theme_classic_green.border_dark_color; theme_colors->border_light_color = rgui_theme_classic_green.border_light_color; - theme_colors->shadow_color = rgui_theme_classic_green.shadow_color; + theme_colors->shadow_color = rgui_theme_classic_green.shadow_color; } if (conf) @@ -1509,9 +1510,9 @@ static void rgui_cache_background(rgui_t *rgui) &fb_pitch); /* Sanity check */ - if ((fb_width != rgui_background_buf.width) || - (fb_height != rgui_background_buf.height) || - (fb_pitch != rgui_background_buf.width << 1) || + if ((fb_width != rgui_background_buf.width) || + (fb_height != rgui_background_buf.height) || + (fb_pitch != rgui_background_buf.width << 1) || !rgui_background_buf.data) return; @@ -1568,26 +1569,27 @@ static void prepare_rgui_colors(rgui_t *rgui, settings_t *settings) else { const rgui_theme_t *current_theme = get_theme(rgui); - theme_colors.hover_color = current_theme->hover_color; - theme_colors.normal_color = current_theme->normal_color; - theme_colors.title_color = current_theme->title_color; - theme_colors.bg_dark_color = current_theme->bg_dark_color; - theme_colors.bg_light_color = current_theme->bg_light_color; - theme_colors.border_dark_color = current_theme->border_dark_color; - theme_colors.border_light_color = current_theme->border_light_color; - theme_colors.shadow_color = current_theme->shadow_color; - } - rgui->colors.hover_color = argb32_to_pixel_platform_format(theme_colors.hover_color); - rgui->colors.normal_color = argb32_to_pixel_platform_format(theme_colors.normal_color); - rgui->colors.title_color = argb32_to_pixel_platform_format(theme_colors.title_color); - rgui->colors.bg_dark_color = argb32_to_pixel_platform_format(theme_colors.bg_dark_color); - rgui->colors.bg_light_color = argb32_to_pixel_platform_format(theme_colors.bg_light_color); - rgui->colors.border_dark_color = argb32_to_pixel_platform_format(theme_colors.border_dark_color); - rgui->colors.border_light_color = argb32_to_pixel_platform_format(theme_colors.border_light_color); - rgui->colors.shadow_color = argb32_to_pixel_platform_format(theme_colors.shadow_color); - rgui->bg_modified = true; - rgui->force_redraw = true; + theme_colors.hover_color = current_theme->hover_color; + theme_colors.normal_color = current_theme->normal_color; + theme_colors.title_color = current_theme->title_color; + theme_colors.bg_dark_color = current_theme->bg_dark_color; + theme_colors.bg_light_color = current_theme->bg_light_color; + theme_colors.border_dark_color = current_theme->border_dark_color; + theme_colors.border_light_color = current_theme->border_light_color; + theme_colors.shadow_color = current_theme->shadow_color; + } + rgui->colors.hover_color = argb32_to_pixel_platform_format(theme_colors.hover_color); + rgui->colors.normal_color = argb32_to_pixel_platform_format(theme_colors.normal_color); + rgui->colors.title_color = argb32_to_pixel_platform_format(theme_colors.title_color); + rgui->colors.bg_dark_color = argb32_to_pixel_platform_format(theme_colors.bg_dark_color); + rgui->colors.bg_light_color = argb32_to_pixel_platform_format(theme_colors.bg_light_color); + rgui->colors.border_dark_color = argb32_to_pixel_platform_format(theme_colors.border_dark_color); + rgui->colors.border_light_color = argb32_to_pixel_platform_format(theme_colors.border_light_color); + rgui->colors.shadow_color = argb32_to_pixel_platform_format(theme_colors.shadow_color); + + rgui->bg_modified = true; + rgui->force_redraw = true; } /* ============================== @@ -1810,8 +1812,10 @@ static const uint8_t *rgui_get_symbol_data(enum rgui_symbol_type symbol) case RGUI_SYMBOL_TEXT_CURSOR: return rgui_symbol_data_text_cursor; default: - return NULL; + break; } + + return NULL; } static void blit_symbol_regular(int x, int y, diff --git a/menu/menu_shader.c b/menu/menu_shader.c index a27a042235..a25c6cebc8 100644 --- a/menu/menu_shader.c +++ b/menu/menu_shader.c @@ -77,7 +77,7 @@ bool menu_shader_manager_init(void) if (is_preset) { - conf = config_file_new(path_shader); + conf = config_file_read(path_shader); new_path = strdup(path_shader); } else @@ -101,20 +101,20 @@ bool menu_shader_manager_init(void) fill_pathname_join(preset_path, shader_dir, "menu.glslp", sizeof(preset_path)); - conf = config_file_new(preset_path); + conf = config_file_read(preset_path); if (!conf) { fill_pathname_join(preset_path, shader_dir, "menu.cgp", sizeof(preset_path)); - conf = config_file_new(preset_path); + conf = config_file_read(preset_path); } if (!conf) { fill_pathname_join(preset_path, shader_dir, "menu.slangp", sizeof(preset_path)); - conf = config_file_new(preset_path); + conf = config_file_read(preset_path); } new_path = strdup(preset_path); @@ -174,7 +174,7 @@ bool menu_shader_manager_set_preset(void *data, * Used when a preset is directly loaded. * No point in updating when the Preset was * created from the menu itself. */ - conf = config_file_new(preset_path); + conf = config_file_read(preset_path); if (!conf) return false; diff --git a/tasks/task_overlay.c b/tasks/task_overlay.c index da6dfd49b0..6a6a2ac61a 100644 --- a/tasks/task_overlay.c +++ b/tasks/task_overlay.c @@ -749,7 +749,7 @@ bool task_push_overlay_load_default( if (task_queue_find(&find_data)) goto error; - conf = config_file_new(overlay_path); + conf = config_file_read(overlay_path); if (!conf) goto error;