(Menu) Don't pass menu data to menu_iterate

(Menu) Don't pass menu data to backend - postprocess
This commit is contained in:
twinaphex 2014-05-30 20:53:10 +02:00
parent 04c84dc36c
commit b2d9c60613
9 changed files with 20 additions and 27 deletions

View File

@ -633,10 +633,7 @@ void uninit_drivers(void)
#ifdef HAVE_MENU
if (!driver.menu_data_own)
{
menu_free(driver.menu);
driver.menu = NULL;
}
#endif
uninit_video_input();

View File

@ -420,7 +420,7 @@ typedef struct menu_ctx_driver
void (*free_assets)(void*);
void (*populate_entries)(void*, unsigned);
void (*iterate)(void*, unsigned);
int (*input_postprocess)(void *, uint64_t);
int (*input_postprocess)(uint64_t);
void (*navigation_clear)(void *);
void (*navigation_decrement)(void *);
void (*navigation_increment)(void *);

View File

@ -207,7 +207,7 @@ static int main_entry_iterate_menu_preinit(args_type() args)
static int main_entry_iterate_menu(args_type() args)
{
if (menu_iterate(driver.menu))
if (menu_iterate())
{
if (driver.frontend_ctx && driver.frontend_ctx->process_events)
driver.frontend_ctx->process_events(args);

View File

@ -1192,10 +1192,9 @@ static void lakka_free(void *data)
free((uint8_t*)rgui->font);
}
static int lakka_input_postprocess(void *data, uint64_t old_state)
static int lakka_input_postprocess(uint64_t old_state)
{
rgui_handle_t *rgui = (rgui_handle_t*)data;
rgui_handle_t *rgui = (rgui_handle_t*)driver.menu;
int ret = 0;
if ((rgui && rgui->trigger_state & (1ULL << RARCH_MENU_TOGGLE)) &&

View File

@ -612,15 +612,12 @@ static void rgui_free(void *data)
free((uint8_t*)rgui->font);
}
static int rgui_input_postprocess(void *data, uint64_t old_state)
static int rgui_input_postprocess(uint64_t old_state)
{
int ret;
rgui_handle_t *rgui;
rgui_handle_t *rgui = (rgui_handle_t*)driver.menu;
int ret = 0;
(void)old_state;
rgui = (rgui_handle_t*)data;
ret = 0;
if ((rgui->trigger_state & (1ULL << RARCH_MENU_TOGGLE)) &&
g_extern.main_is_init &&

View File

@ -482,12 +482,10 @@ static void rmenu_free(void *data)
rmenu_free_assets(data);
}
static int rmenu_input_postprocess(void *data, uint64_t old_state)
static int rmenu_input_postprocess(uint64_t old_state)
{
int ret;
rgui_handle_t *rgui = (rgui_handle_t*)data;
ret = 0;
rgui_handle_t *rgui = (rgui_handle_t*)driver.menu;
int ret = 0;
if ((rgui->trigger_state & (1ULL << RARCH_MENU_TOGGLE)) &&
g_extern.main_is_init &&

View File

@ -331,9 +331,9 @@ static void rmenu_xui_frame(void *data)
d3dr->SetViewport(&d3d->final_viewport);
}
static int rmenu_xui_input_postprocess(void *data, uint64_t old_state)
static int rmenu_xui_input_postprocess(uint64_t old_state)
{
rgui_handle_t *rgui = (rgui_handle_t*)data;
rgui_handle_t *rgui = (rgui_handle_t*)driver.menu;
bool quit = false;
bool resize = false;
unsigned width;

View File

@ -385,7 +385,7 @@ void menu_free(void *data)
rom_history_free(rgui->history);
core_info_list_free(rgui->core_info);
free(rgui);
free(data);
}
void menu_ticker_line(char *buf, size_t len, unsigned index, const char *str, bool selected)
@ -525,19 +525,19 @@ void load_menu_game_new_core(void)
#endif
}
bool menu_iterate(void *data)
bool menu_iterate(void)
{
unsigned action;
static bool initial_held = true;
static bool first_held = false;
uint64_t input_state;
int32_t input_entry_ret, ret;
rgui_handle_t *rgui;
rgui_handle_t *rgui= (rgui_handle_t*)driver.menu;
RARCH_LOG("rgui is NULL: %d\n", rgui == NULL);
input_state = 0;
input_entry_ret = 0;
ret = 0;
rgui = (rgui_handle_t*)data;
if (!rgui)
return false;
@ -620,6 +620,8 @@ bool menu_iterate(void *data)
if (driver.menu_ctx && driver.menu_ctx->backend && driver.menu_ctx->backend->iterate)
input_entry_ret = driver.menu_ctx->backend->iterate(action);
rgui = (rgui_handle_t*)driver.menu;
if (driver.video_data && driver.video_poke && driver.video_poke->set_texture_enable)
driver.video_poke->set_texture_enable(driver.video_data, rgui->frame_buf_show, MENU_TEXTURE_FULLSCREEN);
@ -640,7 +642,7 @@ bool menu_iterate(void *data)
MENU_TEXTURE_FULLSCREEN);
if (driver.menu_ctx && driver.menu_ctx->input_postprocess)
ret = driver.menu_ctx->input_postprocess(rgui, rgui->old_input_state);
ret = driver.menu_ctx->input_postprocess(rgui->old_input_state);
if (ret < 0)
{

View File

@ -187,7 +187,7 @@ typedef struct
} rgui_handle_t;
void *menu_init(const void *data);
bool menu_iterate(void *data);
bool menu_iterate(void);
void menu_free(void *data);
void menu_ticker_line(char *buf, size_t len, unsigned tick, const char *str, bool selected);