mirror of
https://github.com/libretro/RetroArch
synced 2025-03-02 19:13:34 +00:00
(SoftFilter) Cleaner and more portable way of grabbing the name from the filter
This commit is contained in:
parent
a090806abc
commit
9772c48016
@ -2257,22 +2257,12 @@ void menu_set_settings_label(char *type_str, size_t type_str_size, unsigned *w,
|
||||
break;
|
||||
case RGUI_SETTINGS_VIDEO_SOFTFILTER:
|
||||
{
|
||||
#ifdef HAVE_FILTERS_BUILTIN
|
||||
unsigned cpu_features;
|
||||
const struct softfilter_implementation *impl;
|
||||
softfilter_get_implementation_t cb = softfilter_get_implementation_from_idx(g_settings.video.filter_idx);
|
||||
if (cb)
|
||||
{
|
||||
cpu_features = rarch_get_cpu_features();
|
||||
impl = (const struct softfilter_implementation *)cb(cpu_features);
|
||||
if (impl)
|
||||
strlcpy(type_str, impl->ident, type_str_size);
|
||||
}
|
||||
const char *filter_name = rarch_softfilter_get_name(g_extern.filter.filter);
|
||||
|
||||
if (filter_name != NULL)
|
||||
strlcpy(type_str, filter_name, type_str_size);
|
||||
else
|
||||
strlcpy(type_str, "N/A", type_str_size);
|
||||
#else
|
||||
strlcpy(type_str, path_basename(g_settings.video.filter_path), type_str_size);
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
#ifdef HAVE_OVERLAY
|
||||
|
@ -105,6 +105,14 @@ static softfilter_get_implementation_t softfilter_get_implementation_from_idx(un
|
||||
}
|
||||
#endif
|
||||
|
||||
const char *rarch_softfilter_get_name(rarch_softfilter_t *filt)
|
||||
{
|
||||
if (!filt || !filt->impl)
|
||||
return NULL;
|
||||
|
||||
return filt->impl->ident;
|
||||
}
|
||||
|
||||
rarch_softfilter_t *rarch_softfilter_new(const char *filter_path,
|
||||
unsigned threads,
|
||||
enum retro_pixel_format in_pixel_format,
|
||||
|
@ -44,6 +44,8 @@ void rarch_softfilter_process(rarch_softfilter_t *filt,
|
||||
void *output, size_t output_stride,
|
||||
const void *input, unsigned width, unsigned height, size_t input_stride);
|
||||
|
||||
const char *rarch_softfilter_get_name(rarch_softfilter_t *filt);
|
||||
|
||||
enum
|
||||
{
|
||||
SOFTFILTER_NONE = 0,
|
||||
|
Loading…
x
Reference in New Issue
Block a user