diff --git a/command_event.c b/command_event.c index 51becca1bc..5ad658aa8d 100644 --- a/command_event.c +++ b/command_event.c @@ -536,7 +536,7 @@ static bool event_init_content(void) if (!global->inited.core.no_content) rarch_ctl(RARCH_CTL_FILL_PATHNAMES, NULL); - if (!init_content_file()) + if (!content_ctl(CONTENT_CTL_INIT, NULL)) return false; if (global->inited.core.no_content) diff --git a/content.c b/content.c index a7af776c26..76f343ae16 100644 --- a/content.c +++ b/content.c @@ -688,7 +688,7 @@ static bool init_content_file_set_attribs( } /** - * init_content_file: + * content_init_file: * * Initializes and loads a content file for the currently * selected libretro core. @@ -698,7 +698,7 @@ static bool init_content_file_set_attribs( * * Returns : true if successful, otherwise false. **/ -bool init_content_file(void) +static bool content_init_file(void) { unsigned i; struct retro_game_info *info = NULL; @@ -729,8 +729,7 @@ bool init_content_file(void) calloc(content->size, sizeof(*info)); additional_path_allocs = string_list_new(); - ret = load_content(info, content, special, additional_path_allocs); - + ret = load_content(info, content, special, additional_path_allocs); for (i = 0; i < content->size; i++) free((void*)info[i].data); @@ -760,6 +759,8 @@ bool content_ctl(enum content_ctl_state state, void *data) switch(state) { + case CONTENT_CTL_INIT: + return content_init_file(); case CONTENT_CTL_TEMPORARY_FREE: if (!temporary_content) return false; diff --git a/content.h b/content.h index da0e587f55..f7692df7c0 100644 --- a/content.h +++ b/content.h @@ -31,6 +31,15 @@ enum content_ctl_state { CONTENT_CTL_NONE = 0, + /* Initializes and loads a content file for the currently + * selected libretro core. + * + * global->content_is_init will be set to the return value + * on exit. + * + * Returns : true if successful, otherwise false. */ + CONTENT_CTL_INIT, + /* Frees temporary content handle. */ CONTENT_CTL_TEMPORARY_FREE }; @@ -78,19 +87,6 @@ void load_ram_file(const char *path, int type); */ void save_ram_file(const char *path, int type); -/** - * init_content_file: - * - * Initializes and loads a content file for the currently - * selected libretro core. - * - * global->content_is_init will be set to the return value - * on exit. - * - * Returns : true if successful, otherwise false. - **/ -bool init_content_file(void); - bool content_ctl(enum content_ctl_state state, void *data); #ifdef __cplusplus