This commit is contained in:
Jean-André Santoni 2014-09-14 15:25:33 +02:00
commit 9b1253e9bd
5 changed files with 28 additions and 18 deletions

View File

@ -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)

View File

@ -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);

View File

@ -327,7 +327,7 @@ static int glui_input_postprocess(uint64_t old_state)
return 0;
}
static GLuint png_texture_load(const char * file_name)
static GLuint glui_png_texture_load(const char * file_name)
{
struct texture_image ti = {0};
texture_image_load(&ti, file_name);
@ -364,7 +364,7 @@ static void glui_context_reset(void *data)
fill_pathname_join(bgpath, bgpath, "bg.png", sizeof(bgpath));
if (path_file_exists(bgpath))
glui_bg = png_texture_load(bgpath);
glui_bg = glui_png_texture_load(bgpath);
}
menu_ctx_driver_t menu_ctx_glui = {

View File

@ -661,7 +661,7 @@ static void lakka_frame(void)
gl_set_viewport(gl, gl->win_width, gl->win_height, false, false);
}
static GLuint png_texture_load(const char * file_name)
static GLuint lakka_png_texture_load(const char * file_name)
{
struct texture_image ti = {0};
texture_image_load(&ti, file_name);
@ -883,7 +883,7 @@ static void lakka_context_reset(void *data)
"reload.png", sizeof(textures[TEXTURE_RELOAD].path));
for (k = 0; k < TEXTURE_LAST; k++)
textures[k].id = png_texture_load(textures[k].path);
textures[k].id = lakka_png_texture_load(textures[k].path);
lakka_settings_context_reset();
for (i = 1; i < num_categories; i++)
@ -926,8 +926,8 @@ static void lakka_context_reset(void *data)
strlcat(content_texturepath, core_id, sizeof(content_texturepath));
strlcat(content_texturepath, "-content.png", sizeof(content_texturepath));
category->icon = png_texture_load(texturepath);
category->item_icon = png_texture_load(content_texturepath);
category->icon = lakka_png_texture_load(texturepath);
category->item_icon = lakka_png_texture_load(content_texturepath);
for (j = 0; j < category->num_items; j++)
{

View File

@ -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)