mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 06:44:27 +00:00
(menu_entries.c) Refactor perf counter list push
This commit is contained in:
parent
4d94aca1db
commit
e83334433d
@ -55,6 +55,20 @@ static void add_setting_entry(menu_handle_t *menu,
|
|||||||
setting->name, id, 0);
|
setting->name, id, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void menu_entries_push_perfcounter(menu_handle_t *menu,
|
||||||
|
const struct retro_perf_counter **counters,
|
||||||
|
unsigned num, unsigned id)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
if (!counters || num == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (i = 0; i < num; i++)
|
||||||
|
if (counters[i] && counters[i]->ident)
|
||||||
|
file_list_push(menu->selection_buf, counters[i]->ident, "",
|
||||||
|
id + i, 0);
|
||||||
|
}
|
||||||
|
|
||||||
int menu_entries_push(menu_handle_t *menu,
|
int menu_entries_push(menu_handle_t *menu,
|
||||||
const char *path, const char *label,
|
const char *path, const char *label,
|
||||||
unsigned menu_type)
|
unsigned menu_type)
|
||||||
@ -517,33 +531,13 @@ int menu_entries_push(menu_handle_t *menu,
|
|||||||
break;
|
break;
|
||||||
case MENU_SETTINGS_PERFORMANCE_COUNTERS_LIBRETRO:
|
case MENU_SETTINGS_PERFORMANCE_COUNTERS_LIBRETRO:
|
||||||
file_list_clear(menu->selection_buf);
|
file_list_clear(menu->selection_buf);
|
||||||
{
|
menu_entries_push_perfcounter(menu, perf_counters_libretro,
|
||||||
const struct retro_perf_counter **counters = (const struct retro_perf_counter**)perf_counters_libretro;
|
perf_ptr_libretro, MENU_SETTINGS_LIBRETRO_PERF_COUNTERS_BEGIN);
|
||||||
unsigned num = perf_ptr_libretro;
|
|
||||||
|
|
||||||
if (!counters || num == 0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
for (i = 0; i < num; i++)
|
|
||||||
if (counters[i] && counters[i]->ident)
|
|
||||||
file_list_push(menu->selection_buf, counters[i]->ident, "",
|
|
||||||
MENU_SETTINGS_LIBRETRO_PERF_COUNTERS_BEGIN + i, 0);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case MENU_SETTINGS_PERFORMANCE_COUNTERS_FRONTEND:
|
case MENU_SETTINGS_PERFORMANCE_COUNTERS_FRONTEND:
|
||||||
file_list_clear(menu->selection_buf);
|
file_list_clear(menu->selection_buf);
|
||||||
{
|
menu_entries_push_perfcounter(menu, perf_counters_rarch,
|
||||||
const struct retro_perf_counter **counters = (const struct retro_perf_counter**)perf_counters_rarch;
|
perf_ptr_rarch, MENU_SETTINGS_PERF_COUNTERS_BEGIN);
|
||||||
unsigned num = perf_ptr_rarch;
|
|
||||||
|
|
||||||
if (!counters || num == 0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
for (i = 0; i < num; i++)
|
|
||||||
if (counters[i] && counters[i]->ident)
|
|
||||||
file_list_push(menu->selection_buf, counters[i]->ident, "",
|
|
||||||
MENU_SETTINGS_PERF_COUNTERS_BEGIN + i, 0);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user