mirror of
https://github.com/libretro/RetroArch
synced 2025-02-11 15:40:28 +00:00
menu_shader.c - cleanups
This commit is contained in:
parent
5c798e6994
commit
3419a1846c
@ -123,43 +123,46 @@ void menu_shader_manager_set_preset(struct gfx_shader *shader,
|
|||||||
unsigned type, const char *preset_path)
|
unsigned type, const char *preset_path)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SHADER_MANAGER
|
#ifdef HAVE_SHADER_MANAGER
|
||||||
RARCH_LOG("Setting Menu shader: %s.\n", preset_path ? preset_path : "N/A (stock)");
|
config_file_t *conf = NULL;
|
||||||
|
|
||||||
g_settings.video.shader_enable = false;
|
g_settings.video.shader_enable = false;
|
||||||
|
|
||||||
if (driver.video->set_shader && driver.video->set_shader(driver.video_data,
|
if (!driver.video->set_shader)
|
||||||
|
return;
|
||||||
|
if (!driver.video->set_shader(driver.video_data,
|
||||||
(enum rarch_shader_type)type, preset_path))
|
(enum rarch_shader_type)type, preset_path))
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* Makes sure that we use Menu Preset shader on driver reinit.
|
||||||
|
* Only do this when the cgp actually works to avoid potential errors. */
|
||||||
|
strlcpy(g_settings.video.shader_path, preset_path ? preset_path : "",
|
||||||
|
sizeof(g_settings.video.shader_path));
|
||||||
|
g_settings.video.shader_enable = true;
|
||||||
|
|
||||||
|
if (!preset_path)
|
||||||
|
return;
|
||||||
|
if (!shader)
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* Load stored Preset into menu on success.
|
||||||
|
* 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);
|
||||||
|
|
||||||
|
if (conf)
|
||||||
{
|
{
|
||||||
config_file_t *conf = NULL;
|
RARCH_LOG("Setting Menu shader: %s.\n", preset_path ? preset_path : "N/A (stock)");
|
||||||
|
|
||||||
/* Makes sure that we use Menu Preset shader on driver reinit.
|
if (gfx_shader_read_conf_cgp(conf, shader))
|
||||||
* Only do this when the cgp actually works to avoid potential errors. */
|
|
||||||
strlcpy(g_settings.video.shader_path, preset_path ? preset_path : "",
|
|
||||||
sizeof(g_settings.video.shader_path));
|
|
||||||
g_settings.video.shader_enable = true;
|
|
||||||
|
|
||||||
if (!preset_path)
|
|
||||||
return;
|
|
||||||
if (!shader)
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* Load stored Preset into menu on success.
|
|
||||||
* 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);
|
|
||||||
|
|
||||||
if (conf)
|
|
||||||
{
|
{
|
||||||
if (gfx_shader_read_conf_cgp(conf, shader))
|
gfx_shader_resolve_relative(shader, preset_path);
|
||||||
{
|
gfx_shader_resolve_parameters(conf, shader);
|
||||||
gfx_shader_resolve_relative(shader, preset_path);
|
|
||||||
gfx_shader_resolve_parameters(conf, shader);
|
|
||||||
}
|
|
||||||
config_file_free(conf);
|
|
||||||
}
|
}
|
||||||
|
config_file_free(conf);
|
||||||
driver.menu->need_refresh = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
driver.menu->need_refresh = true;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user