Create new function types

This commit is contained in:
twinaphex 2015-12-07 15:54:06 +01:00
parent ed7e4af287
commit 2daf9832a9
3 changed files with 16 additions and 9 deletions

View File

@ -631,7 +631,8 @@ bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data)
{ {
static bool menu_driver_alive = false; static bool menu_driver_alive = false;
static bool menu_driver_data_own = false; static bool menu_driver_data_own = false;
const menu_ctx_driver_t *driver = menu_ctx_driver_get_ptr(); const menu_ctx_driver_t *driver = menu_ctx_driver_get_ptr();
menu_handle_t *menu = menu_driver_get_ptr();
switch (state) switch (state)
{ {
@ -680,6 +681,12 @@ bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data)
menu_free(menu_driver_data); menu_free(menu_driver_data);
menu_driver_data = NULL; menu_driver_data = NULL;
break; break;
case RARCH_MENU_CTL_SET_LOAD_NO_CONTENT:
menu->load_no_content = true;
break;
case RARCH_MENU_CTL_UNSET_LOAD_NO_CONTENT:
menu->load_no_content = false;
break;
default: default:
case RARCH_MENU_CTL_NONE: case RARCH_MENU_CTL_NONE:
break; break;

View File

@ -106,7 +106,9 @@ enum rarch_menu_ctl_state
RARCH_MENU_CTL_IS_SET_TEXTURE, RARCH_MENU_CTL_IS_SET_TEXTURE,
RARCH_MENU_CTL_SET_OWN_DRIVER, RARCH_MENU_CTL_SET_OWN_DRIVER,
RARCH_MENU_CTL_UNSET_OWN_DRIVER, RARCH_MENU_CTL_UNSET_OWN_DRIVER,
RARCH_MENU_CTL_OWNS_DRIVER RARCH_MENU_CTL_OWNS_DRIVER,
RARCH_MENU_CTL_SET_LOAD_NO_CONTENT,
RARCH_MENU_CTL_UNSET_LOAD_NO_CONTENT
}; };
typedef enum typedef enum

View File

@ -1522,13 +1522,9 @@ void rarch_main_deinit(void)
**/ **/
void rarch_playlist_load_content(void *data, unsigned idx) void rarch_playlist_load_content(void *data, unsigned idx)
{ {
unsigned i;
const char *core_path = NULL; const char *core_path = NULL;
const char *path = NULL; const char *path = NULL;
content_playlist_t *playlist = (content_playlist_t*)data; content_playlist_t *playlist = (content_playlist_t*)data;
#ifdef HAVE_MENU
menu_handle_t *menu = menu_driver_get_ptr();
#endif
if (!playlist) if (!playlist)
return; return;
@ -1538,6 +1534,7 @@ void rarch_playlist_load_content(void *data, unsigned idx)
if (path && path[0] != '\0') if (path && path[0] != '\0')
{ {
unsigned i;
RFILE *fp = NULL; RFILE *fp = NULL;
char *path_check = NULL; char *path_check = NULL;
char *path_tolower = strdup(path); char *path_tolower = strdup(path);
@ -1545,7 +1542,6 @@ void rarch_playlist_load_content(void *data, unsigned idx)
for (i = 0; i < strlen(path_tolower); ++i) for (i = 0; i < strlen(path_tolower); ++i)
path_tolower[i] = tolower(path_tolower[i]); path_tolower[i] = tolower(path_tolower[i]);
if (strstr(path_tolower, ".zip")) if (strstr(path_tolower, ".zip"))
strstr(path_tolower, ".zip")[4] = '\0'; strstr(path_tolower, ".zip")[4] = '\0';
else if (strstr(path_tolower, ".7z")) else if (strstr(path_tolower, ".7z"))
@ -1571,8 +1567,10 @@ void rarch_playlist_load_content(void *data, unsigned idx)
runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, (void*)core_path); runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, (void*)core_path);
#ifdef HAVE_MENU #ifdef HAVE_MENU
if (menu) if (path)
menu->load_no_content = (path) ? false : true; menu_driver_ctl(RARCH_MENU_CTL_UNSET_LOAD_NO_CONTENT, NULL);
else
menu_driver_ctl(RARCH_MENU_CTL_SET_LOAD_NO_CONTENT, NULL);
#endif #endif
rarch_environment_cb(RETRO_ENVIRONMENT_EXEC, (void*)path); rarch_environment_cb(RETRO_ENVIRONMENT_EXEC, (void*)path);