mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-29 03:00:24 +00:00
Create main_entry_decide to delegate decisionmaking process of
what to bind frontend_loop to
This commit is contained in:
parent
2d64c7aa8f
commit
e9c865f56a
@ -80,6 +80,26 @@ static int main_entry_iterate_shutdown(signature(), args_type() args)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main_entry_decide(signature(), args_type() args)
|
||||
{
|
||||
frontend_loop = NULL;
|
||||
|
||||
if (g_extern.lifecycle_state & (1ULL << MODE_CLEAR_INPUT))
|
||||
frontend_loop = main_entry_iterate_clear_input;
|
||||
else if (g_extern.lifecycle_state & (1ULL << MODE_LOAD_GAME))
|
||||
frontend_loop = main_entry_iterate_load_content;
|
||||
else if (g_extern.lifecycle_state & (1ULL << MODE_GAME))
|
||||
frontend_loop = main_entry_iterate_content;
|
||||
#ifdef HAVE_MENU
|
||||
else if (g_extern.lifecycle_state & (1ULL << MODE_MENU_PREINIT))
|
||||
frontend_loop = main_entry_iterate_menu_preinit;
|
||||
else if (g_extern.lifecycle_state & (1ULL << MODE_MENU))
|
||||
frontend_loop = main_entry_iterate_menu;
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main_entry_iterate_content(signature(), args_type() args)
|
||||
{
|
||||
if (g_extern.system.shutdown)
|
||||
|
@ -77,6 +77,7 @@ const frontend_ctx_driver_t *frontend_ctx_find_driver(const char *ident);
|
||||
/* Finds first suitable driver and initialize. */
|
||||
const frontend_ctx_driver_t *frontend_ctx_init_first(void);
|
||||
|
||||
int main_entry_decide(signature(), args_type() args);
|
||||
int main_entry_iterate_clear_input(signature(), args_type() args);
|
||||
int main_entry_iterate_load_content(signature(), args_type() args);
|
||||
int main_entry_iterate_content(signature(), args_type() args);
|
||||
|
13
retroarch.c
13
retroarch.c
@ -3336,18 +3336,7 @@ void rarch_main_set_state(unsigned cmd)
|
||||
break;
|
||||
}
|
||||
|
||||
if (g_extern.lifecycle_state & (1ULL << MODE_CLEAR_INPUT))
|
||||
frontend_loop = main_entry_iterate_clear_input;
|
||||
else if (g_extern.lifecycle_state & (1ULL << MODE_LOAD_GAME))
|
||||
frontend_loop = main_entry_iterate_load_content;
|
||||
else if (g_extern.lifecycle_state & (1ULL << MODE_GAME))
|
||||
frontend_loop = main_entry_iterate_content;
|
||||
#ifdef HAVE_MENU
|
||||
else if (g_extern.lifecycle_state & (1ULL << MODE_MENU_PREINIT))
|
||||
frontend_loop = main_entry_iterate_menu_preinit;
|
||||
else if (g_extern.lifecycle_state & (1ULL << MODE_MENU))
|
||||
frontend_loop = main_entry_iterate_menu;
|
||||
#endif
|
||||
frontend_loop = main_entry_decide;
|
||||
}
|
||||
|
||||
void rarch_main_command(unsigned cmd)
|
||||
|
Loading…
Reference in New Issue
Block a user