Revert "retroarch_load_shader_preset_internal - cleanups"

This reverts commit b51ee5fafd743bd16cad93973023703febc1c304.
This commit is contained in:
twinaphex 2021-02-21 01:06:41 +01:00
parent 069470aff6
commit d1280b4196

View File

@ -35920,49 +35920,33 @@ static bool retroarch_load_shader_preset_internal(
RARCH_SHADER_GLSL, RARCH_SHADER_SLANG, RARCH_SHADER_CG, RARCH_SHADER_HLSL RARCH_SHADER_GLSL, RARCH_SHADER_SLANG, RARCH_SHADER_CG, RARCH_SHADER_HLSL
}; };
if (string_is_empty(core_name))
{
if (string_is_empty(special_name))
{
for (i = 0; i < ARRAY_SIZE(types); i++)
{
if (!video_shader_is_supported(types[i]))
continue;
/* Concatenate strings into full paths */
fill_pathname_join(shader_path, shader_directory,
special_name, sizeof(shader_path));
strlcat(shader_path,
video_shader_get_preset_extension(types[i]),
sizeof(shader_path));
if (path_is_valid(shader_path))
goto success;
}
}
}
else
{
for (i = 0; i < ARRAY_SIZE(types); i++) for (i = 0; i < ARRAY_SIZE(types); i++)
{ {
if (!video_shader_is_supported(types[i])) if (!video_shader_is_supported(types[i]))
continue; continue;
/* Concatenate strings into full paths */ /* Concatenate strings into full paths */
if (!string_is_empty(core_name))
fill_pathname_join_special_ext(shader_path, fill_pathname_join_special_ext(shader_path,
shader_directory, core_name, shader_directory, core_name,
special_name, special_name,
video_shader_get_preset_extension(types[i]), video_shader_get_preset_extension(types[i]),
sizeof(shader_path)); sizeof(shader_path));
else
{
if (string_is_empty(special_name))
break;
if (path_is_valid(shader_path)) fill_pathname_join(shader_path, shader_directory,
goto success; special_name, sizeof(shader_path));
} strlcat(shader_path,
video_shader_get_preset_extension(types[i]),
sizeof(shader_path));
} }
return false; if (!path_is_valid(shader_path))
continue;
success:
/* Shader preset exists, load it. */ /* Shader preset exists, load it. */
RARCH_LOG("[Shaders]: Specific shader preset found at %s.\n", RARCH_LOG("[Shaders]: Specific shader preset found at %s.\n",
shader_path); shader_path);
@ -35970,6 +35954,9 @@ success:
return true; return true;
} }
return false;
}
/** /**
* retroarch_load_shader_preset: * retroarch_load_shader_preset:
* *