(Menu) Cleanups

This commit is contained in:
twinaphex 2014-07-22 06:58:49 +02:00
parent 2c0c4d629f
commit 9701e28f8c
3 changed files with 8 additions and 21 deletions

View File

@ -46,17 +46,10 @@
#endif #endif
#ifdef HAVE_SHADER_MANAGER #ifdef HAVE_SHADER_MANAGER
static inline struct gfx_shader *shader_manager_get_current_shader(void *data, unsigned type) static inline struct gfx_shader *shader_manager_get_current_shader(menu_handle_t *menu, unsigned type)
{ {
menu_handle_t *menu = (menu_handle_t*)data;
struct gfx_shader *shader = NULL; struct gfx_shader *shader = NULL;
if (!menu)
{
RARCH_ERR("Cannot get current shader, menu handle is not initialized.\n");
return NULL;
}
if (type == MENU_SETTINGS_SHADER_PRESET_PARAMETERS) if (type == MENU_SETTINGS_SHADER_PRESET_PARAMETERS)
shader = menu->shader; shader = menu->shader;
@ -87,7 +80,7 @@ static void menu_common_entries_init(void *data, unsigned menu_type)
{ {
file_list_clear(menu->selection_buf); file_list_clear(menu->selection_buf);
struct gfx_shader *shader = shader_manager_get_current_shader(menu, menu_type); struct gfx_shader *shader = (struct gfx_shader*)shader_manager_get_current_shader(menu, menu_type);
if (shader) if (shader)
for (i = 0; i < shader->num_parameters; i++) for (i = 0; i < shader->num_parameters; i++)
file_list_push(menu->selection_buf, shader->parameters[i].desc, MENU_SETTINGS_SHADER_PARAMETER_0 + i, 0); file_list_push(menu->selection_buf, shader->parameters[i].desc, MENU_SETTINGS_SHADER_PARAMETER_0 + i, 0);

View File

@ -48,15 +48,10 @@ void menu_update_system_info(menu_handle_t *menu, bool *load_no_rom)
} }
// When selection is presented back, returns 0. If it can make a decision right now, returns -1. // When selection is presented back, returns 0. If it can make a decision right now, returns -1.
int menu_defer_core(void *info_, const char *dir, const char *path, char *deferred_path, size_t sizeof_deferred_path) int menu_defer_core(core_info_list_t *core_info, const char *dir, const char *path, char *deferred_path, size_t sizeof_deferred_path)
{ {
core_info_list_t *core_info; const core_info_t *info = NULL;
const core_info_t *info; size_t supported = 0;
size_t supported;
core_info = (core_info_list_t*)info_;
info = NULL;
supported = 0;
fill_pathname_join(deferred_path, dir, path, sizeof_deferred_path); fill_pathname_join(deferred_path, dir, path, sizeof_deferred_path);
@ -674,12 +669,11 @@ static inline bool menu_list_elem_is_dir(file_list_t *buf, unsigned offset)
return type != MENU_FILE_PLAIN; return type != MENU_FILE_PLAIN;
} }
void menu_build_scroll_indices(void *data) void menu_build_scroll_indices(file_list_t *buf)
{ {
size_t i; size_t i;
int current; int current;
bool current_is_dir; bool current_is_dir;
file_list_t *buf = (file_list_t*)data;
if (!driver.menu || !buf) if (!driver.menu || !buf)
return; return;

View File

@ -113,13 +113,13 @@ bool menu_replace_config(const char *path);
bool menu_save_new_config(void); bool menu_save_new_config(void);
int menu_defer_core(void *data, const char *dir, const char *path, char *deferred_path, size_t sizeof_deferred_path); int menu_defer_core(core_info_list_t *data, const char *dir, const char *path, char *deferred_path, size_t sizeof_deferred_path);
uint64_t menu_input(void); uint64_t menu_input(void);
void menu_flush_stack_type(unsigned final_type); void menu_flush_stack_type(unsigned final_type);
void menu_update_system_info(menu_handle_t *menu, bool *load_no_rom); void menu_update_system_info(menu_handle_t *menu, bool *load_no_rom);
void menu_build_scroll_indices(void *data); void menu_build_scroll_indices(file_list_t *buf);
#ifdef __cplusplus #ifdef __cplusplus
} }